We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
字典文件内容:
张三 3 n
程序:
var sgr sego.Segmenter sgr.LoadDictionary("main.dic") var words []string for _, sg := range sgr.Segment([]byte("张三,你好啊")) { token := sg.Token() words = append(words, fmt.Sprintf("%s/%s", token.Text(), token.Pos())) } fmt.Println(strings.Join(words, " ")) // 张/x 三/x ,/x 你/x 好/x 啊/x words = words[:0] for _, sg := range sgr.Segment([]byte("你好啊,张三")) { token := sg.Token() words = append(words, fmt.Sprintf("%s/%s", token.Text(), token.Pos())) } fmt.Println(strings.Join(words, " ")) // 你/x 好/x 啊/x ,/x 张三/n
The text was updated successfully, but these errors were encountered:
No branches or pull requests
字典文件内容:
程序:
The text was updated successfully, but these errors were encountered: