mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-13 13:40:28 +08:00
优化 Segmenter
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user