1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-05 00:32:51 +08:00
Files
jieba/posseg/example_test.go
2022-11-30 14:14:48 +08:00

22 lines
343 B
Go
Executable File

package posseg_test
import (
"fmt"
"github.com/fumiama/jieba/posseg"
)
func Example() {
var seg posseg.Segmenter
seg.LoadDictionaryAt("../dict.txt")
for segment := range seg.Cut("我爱北京天安门", true) {
fmt.Printf("%s %s\n", segment.Text(), segment.Pos())
}
// Output:
// 我 r
// 爱 v
// 北京 ns
// 天安门 ns
}