-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jieba怎么在本地词库动态添加新词 #108
Comments
求关注、求解答 |
有人看到这个问题吗 |
这作者没有考虑的运行环境,我也遇到这个问题,load函数不能正确加载文件 loadUserDict(path); |
这个很好解决,只需要在自己的项目中创建一个全限定名相同的类com.huaban.analysis.jieba.WordDictionary,就可以随意修改他的代码了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景:我引入本地词库,项目启动成功,通过接口可以正常调用并获取分词结果
新需求:通过接口或者手动修改本地词库的方式,添加一些新词,并且项目不重启、新词生效。
我看了python的代码,有一个add_word的方法可以调用,java也有一个addWord,但是addWord是private修饰的,不能直接调用,各位大神有方法能动态刷新本地词库吗
附addWord方法
The text was updated successfully, but these errors were encountered: