stopwords

package module
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2022 License: Apache-2.0 Imports: 1 Imported by: 4

README

Stop Words

Go Report Card Coverage GoDoc

List of stop-words for convenient consumption in Go projects.

Supported languages:

Usage

  • import github.com/zoomio/stopwords and it will have stop-words registered;
  • use stopwords.Setup().IsStopWord("a") to check whether given string is a stop-word;
  • use stopwords.Setup().Slice() to retrieve a list of registered stop-words.

Changelog

See CHANGELOG.md

Contributing

See CONTRIBUTING.md

License

Released under the Apache License 2.0.

Documentation

Index

Constants

View Source
const (
	StopWords = `` /* 4507-byte string literal not displayed */

	StopWordsEn = StopWords
)

StopWords is a string with each English stop-word on a new line.

View Source
const Domains = `` /* 9908-byte string literal not displayed */

Domains is a string with each first level domain on a new line.

View Source
const StopWordsAr = `` /* 4336-byte string literal not displayed */

StopWordsAr is a string with each Arabic stop-word on a new line.

View Source
const StopWordsDe = `` /* 3950-byte string literal not displayed */

StopWordsDe is a string with each German stop-word on a new line.

View Source
const StopWordsEs = `` /* 4936-byte string literal not displayed */

StopWordsEs is a string with each Spanish stop-word on a new line.

View Source
const StopWordsFr = `` /* 4568-byte string literal not displayed */

StopWordsFr is a string with each French stop-word on a new line.

View Source
const StopWordsHe = `` /* 1657-byte string literal not displayed */

StopWordsHe is a string with each Hebrew stop-word on a new line.

View Source
const StopWordsHi = `` /* 2671-byte string literal not displayed */

StopWordsHi is a string with each Hindi stop-word on a new line.

View Source
const StopWordsJa = `` /* 1008-byte string literal not displayed */

StopWordsJa is a string with each Japanese stop-word on a new line.

View Source
const StopWordsKo = `` /* 6531-byte string literal not displayed */

StopWordsKo is a string with each Korean stop-word on a new line.

View Source
const StopWordsRu = `` /* 6231-byte string literal not displayed */

StopWordsRu is a string with each Russian stop-word on a new line.

View Source
const StopWordsZh = `` /* 4962-byte string literal not displayed */

StopWordsZh is a string with each Chinese stop-word on a new line.

Variables

View Source
var (
	// WordsSlice registers given word set.
	WordsSlice = func(words []string) Option {
		return func(c *config) {
			c.words = append(c.words, words)
		}
	}
	// Text splits provided text based on the sep.
	Text = func(text, sep string) Option {
		return func(c *config) {
			c.words = append(c.words, strings.Split(text, sep))
		}
	}
	// Words registers given word set.
	Words = func(words string) Option {
		return func(c *config) {
			Text(words, "\n")(c)
		}
	}
	WithDomains = func(v bool) Option {
		return func(c *config) {
			if v {
				Text(Domains, "\n")(c)
			}
		}
	}
)

Functions

This section is empty.

Types

type Option added in v0.5.0

type Option func(*config)

Option allows to customise stopwords configuration.

type Register added in v0.6.0

type Register struct {
	// contains filtered or unexported fields
}

Register an instance of the register of the stopwords.

func Setup added in v0.5.0

func Setup(opts ...Option) *Register

Setup configures stpwords.

func (*Register) Index added in v0.11.0

func (r *Register) Index() map[string]bool

Index returns a copy of the map of all registered stop-words.

func (*Register) IsStopWord added in v0.6.0

func (r *Register) IsStopWord(s string) bool

IsStopWord returns true if given string as a stop-word.

func (*Register) Slice added in v0.6.0

func (r *Register) Slice() []string

Slice returns a copy of the list of all registered stop-words.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL