Exemplo n.º 1
0
func NewNGramAnalyzer(min, max int) *Analyzer {
	return &Analyzer{
		charFilters: []char.Filter{
			char.NewRemovePunctuationFilter(),
			char.NewNorwegianFoldingFilter()},
		tokenizer:    NewNGramTokenizer(min, max),
		tokenFilters: []token.Filter{token.NewLowerCaseFilter()},
		Idx:          index.NewMapIndex(),
	}
}
Exemplo n.º 2
0
func NewStandardAnalyzer() *Analyzer {
	return &Analyzer{
		charFilters: []char.Filter{
			char.NewRemovePunctuationFilter(),
			char.NewNorwegianFoldingFilter()},
		tokenizer:    NewWhiteSpaceTokenizer(),
		tokenFilters: []token.Filter{token.NewLowerCaseFilter()},
		Idx:          index.NewMapIndex(),
	}
}