1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-13 13:40:28 +08:00

优化 Segmenter

This commit is contained in:
源文雨
2022-11-30 15:27:46 +08:00
parent b2508252d5
commit 7c685f789e
8 changed files with 203 additions and 249 deletions

View File

@@ -7,10 +7,12 @@ import (
)
func Example() {
var seg posseg.Segmenter
seg.LoadDictionaryAt("../dict.txt")
seg, err := posseg.LoadDictionaryAt("../dict.txt")
if err != nil {
panic(err)
}
for segment := range seg.Cut("我爱北京天安门", true) {
for _, segment := range seg.Cut("我爱北京天安门", true) {
fmt.Printf("%s %s\n", segment.Text(), segment.Pos())
}
// Output: