1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-09 02:50:24 +08:00

优化 jieba

This commit is contained in:
源文雨
2022-11-30 16:00:56 +08:00
parent 4d76899e79
commit 6982ead703
8 changed files with 114 additions and 109 deletions

View File

@@ -5,8 +5,10 @@ import (
)
func Example() {
var seg Segmenter
seg.LoadDictionaryAt("dict.txt")
seg, err := LoadDictionaryAt("dict.txt")
if err != nil {
panic(err)
}
fmt.Print("【全模式】:")
fmt.Println(seg.CutAll("我来到北京清华大学"))
@@ -27,8 +29,10 @@ func Example() {
}
func Example_suggestFrequency() {
var seg Segmenter
seg.LoadDictionaryAt("dict.txt")
seg, err := LoadDictionaryAt("dict.txt")
if err != nil {
panic(err)
}
sentence := "超敏C反应蛋白是什么"
fmt.Print("Before:")
@@ -75,8 +79,10 @@ func Example_suggestFrequency() {
}
func Example_loadUserDictionary() {
var seg Segmenter
seg.LoadDictionaryAt("dict.txt")
seg, err := LoadDictionaryAt("dict.txt")
if err != nil {
panic(err)
}
sentence := "李小福是创新办主任也是云计算方面的专家"
fmt.Print("Before:")