gofound/web/service/word.go

22 lines
346 B
Go

package service
import (
"myschools.me/suguo/gofound/global"
"myschools.me/suguo/gofound/searcher"
)
type Word struct {
Container *searcher.Container
}
func NewWord() *Word {
return &Word{
Container: global.Container,
}
}
// WordCut 分词
func (w *Word) WordCut(keyword string) []string {
return w.Container.Tokenizer.Cut(keyword)
}