예제 #1
0
파일: analyzer.go 프로젝트: postfix/ftx
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(),
	}
}
예제 #2
0
파일: analyzer.go 프로젝트: postfix/ftx
func NewStandardAnalyzer() *Analyzer {
	return &Analyzer{
		charFilters: []char.Filter{
			char.NewRemovePunctuationFilter(),
			char.NewNorwegianFoldingFilter()},
		tokenizer:    NewWhiteSpaceTokenizer(),
		tokenFilters: []token.Filter{token.NewLowerCaseFilter()},
		Idx:          index.NewMapIndex(),
	}
}