yanyiwu / gojieba

"结巴"中文分词的Golang版本
MIT License
2.39k stars 302 forks source link

NewJieba使用空字符串占位,以使用本身自带词库 #77

Closed xyanyue closed 1 year ago

yanyiwu commented 3 years ago

测试失败了,辛苦看下?

xyanyue commented 3 years ago

测试失败了,辛苦看下?

不好意思,测试的时候,config.go中有Println没有删除。导致测试失败

yanyiwu commented 3 years ago

但是目前这个pr里面的实现方式太trick了唉,代码可读性有提高空间,是否可以有更好的方式呢

发自我的iPhone

在 2021年1月4日,08:32,xjn notifications@github.com 写道:

 @xyanyue commented on this pull request.

In jieba_test.go:

@@ -12,6 +12,14 @@ func ExampleJieba() { var words []string use_hmm := true //equals with x := NewJieba(DICT_PATH, HMM_PATH, USER_DICT_PATH) +

  • //equals with x := NewJieba([
  • // [DictPath(dict_path string)], 实现类似 Python的关键字参数

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

yanyiwu commented 3 years ago

你需要的是不是一个比如ReloadDictPath的函数?

xyanyue commented 3 years ago

你需要的是不是一个比如ReloadDictPath的函数?

嗯,我也是使用的时候,发现自定义dictpath比较麻烦,然后顺手改成这样。

yanyiwu commented 3 years ago

你需要的是不是一个比如ReloadDictPath的函数?

嗯,我也是使用的时候,发现自定义dictpath比较麻烦,然后顺手改成这样。

如果是的话那可能要辛苦改成 ReloadDictPath 类似的形式哈,感谢,否则目前这样的改动可能不太适合merge,怕影响长期代码可读性。

yanyiwu commented 1 year ago

时间比较久了,而且代码也不是可merge状态,要不先close了,有需要再重新发起pr讨论?