analysis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailableStemmer = errors.New("Unavailable stemmer")

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	Analyze(text string) (terms []string)
	GetStopwords() []string
	GetSynonyms() map[string]string
	GetStemmer() string
	String() string
}

type Settings

type Settings struct {
	Stopwords map[string]struct{}
	Synonyms  map[string]string
	Stemmer   string
}

func NewSettings

func NewSettings(stopWords map[string]struct{}, synonyms map[string]string, stemmer string) (s Settings, err error)

func (Settings) GetStemmer

func (b Settings) GetStemmer() string

func (Settings) GetStopwords

func (b Settings) GetStopwords() []string

func (Settings) GetSynonyms

func (b Settings) GetSynonyms() map[string]string

type SimpleAnalyzer

type SimpleAnalyzer struct {
	Settings
}

func (SimpleAnalyzer) Analyze

func (s SimpleAnalyzer) Analyze(text string) []string

func (SimpleAnalyzer) String

func (s SimpleAnalyzer) String() string

type StandardAnalyzer

type StandardAnalyzer struct {
	Settings
}

func (StandardAnalyzer) Analyze

func (s StandardAnalyzer) Analyze(text string) (result []string)

func (StandardAnalyzer) String

func (s StandardAnalyzer) String() string

type WhitespaceAnalyzer

type WhitespaceAnalyzer struct {
	Settings
}

func (WhitespaceAnalyzer) Analyze

func (w WhitespaceAnalyzer) Analyze(text string) []string

func (WhitespaceAnalyzer) String

func (w WhitespaceAnalyzer) String() string

Jump to

Keyboard shortcuts

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