Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WordFinder ¶
WordFinder is an implementation of a Tokenizer designed to break up text on word boundaries.
Types ¶
type Engine ¶
type Engine interface { // Ignore registers a new ignored word. Ignore(input string) error // Match registers and returns a new Match. Match(needle string) (Match, error) // Process breaks up the input into a slice of Tokens based on Matches // and ignores. Process(input string) []Token }
Engine represents a multisearch engine capable of registering new matches, ignores (stopwords) and - most importantly - processing new inputs.
type Match ¶
type Match interface { // Size provides the total length of the Match. Size() int // String returns a full string representation of the Match. String() string }
Match represents a matched term.
type Stemmer ¶
type Stemmer interface { // StemString stems a string to produce another string. The original // is not changed in the process. StemString(word string) string }
Stemmer does the job of stemming words.
type Token ¶
type Token interface { // Ignored tells whether this given piece of text has been ignored. Ignored() bool // Matches returns an array of Matches that were matched against // this particular piece of text. Matches() []Match // String returns the content of the token. String() string }
Token represents a piece of processed text. From user's perspective this is behaves like a single linked list.
Click to show internal directories.
Click to hide internal directories.