analysis

package
v0.0.0-...-e7141a1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(line string) string

Clean removes all non-alphanumeric characters from the line

func ValidLanguage

func ValidLanguage(language string) bool

ValidLanguage returns true if the given language is supported

Types

type AnalysisStrategy

type AnalysisStrategy interface {
	Analyze(line string) ([]string, error)
}

the AnalysisStrategy interface is used to analyze a line of text and return a slice of words for a specific language

func GetStrategy

func GetStrategy(language string) (AnalysisStrategy, error)

GetStrategy returns an AnalysisStrategy for the given language

type EnglishStrategy

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

EnglishStrategy is an analysis strategy for English

func NewEnglishStrategy

func NewEnglishStrategy() (*EnglishStrategy, error)

NewEnglishStrategy returns a new EnglishStrategy

func (*EnglishStrategy) Analyze

func (es *EnglishStrategy) Analyze(line string) ([]string, error)

Analyze returns a slice of stemmed words from the given line

type JapaneseStrategy

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

JapaneseStrategy is an AnalysisStrategy that uses the kagome tokenizer to tokenize Japanese text

func NewJapaneseStrategy

func NewJapaneseStrategy() (*JapaneseStrategy, error)

NewJapaneseStrategy returns a new JapaneseStrategy

func (*JapaneseStrategy) Analyze

func (js *JapaneseStrategy) Analyze(line string) ([]string, error)

Analyze returns a slice of words from the given line

Jump to

Keyboard shortcuts

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