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

优化 dict, add fs.File 支持

This commit is contained in:
源文雨
2022-11-30 14:14:48 +08:00
parent c8785c7994
commit f3da9e6420
22 changed files with 190 additions and 91 deletions

View File

@@ -269,7 +269,7 @@ var (
)
func init() {
seg.LoadDictionary("../dict.txt")
seg.LoadDictionaryAt("../dict.txt")
}
func chanToArray(ch <-chan Segment) []Segment {
@@ -357,8 +357,8 @@ func TestBug137(t *testing.T) {
}
func TestUserDict(t *testing.T) {
seg.LoadUserDictionary("../userdict.txt")
defer seg.LoadDictionary("../dict.txt")
seg.LoadUserDictionaryAt("../userdict.txt")
defer seg.LoadDictionaryAt("../dict.txt")
sentence := "李小福是创新办主任也是云计算方面的专家; 什么是八一双鹿例如我输入一个带“韩玉赏鉴”的标题在自定义词库中也增加了此词为N类型"
cutResult := []Segment{