stopwords

package
v1.18.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnglishPreset = "en"
	NoPreset      = "none"
)

Variables

View Source
var Presets = map[string][]string{
	EnglishPreset: {
		"a", "an", "and", "are", "as", "at", "be", "but", "by", "for",
		"if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "such", "that",
		"the", "their", "then", "there", "these", "they", "this", "to", "was", "will",
		"with",
	},
	NoPreset: {},
}

Functions

This section is empty.

Types

type Detector

type Detector struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewDetectorFromConfig

func NewDetectorFromConfig(config models.StopwordConfig) (*Detector, error)

func NewDetectorFromPreset

func NewDetectorFromPreset(preset string) (*Detector, error)

func (*Detector) IsStopword

func (d *Detector) IsStopword(word string) bool

func (*Detector) SetAdditions

func (d *Detector) SetAdditions(additions []string)

func (*Detector) SetRemovals

func (d *Detector) SetRemovals(removals []string)

type StopwordDetector

type StopwordDetector interface {
	IsStopword(string) bool
}

Jump to

Keyboard shortcuts

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