gofound/sdk/word.go

16 lines
363 B
Go
Raw Permalink Normal View History

2022-10-14 09:01:07 +00:00
package gofound
// WordCut 分词
func (c *Client) WordCut(keyword string) []string {
return c.container.Tokenizer.Cut(keyword)
}
// BatchWordCut 批量分词
func (c *Client) BatchWordCut(keywords []string) *[][]string {
res := make([][]string, len(keywords))
for _, w := range keywords {
res = append(res, c.container.Tokenizer.Cut(w))
}
return &res
}