Skip to content
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

CoreStopWordDictionary.dictionary.clear()空指针 #1603

Closed
1 task done
zerofancy opened this issue Jan 16, 2021 · 1 comment
Closed
1 task done

CoreStopWordDictionary.dictionary.clear()空指针 #1603

zerofancy opened this issue Jan 16, 2021 · 1 comment
Assignees
Labels

Comments

@zerofancy
Copy link

Describe the bug
A clear and concise description of what the bug is.

调用CoreStopWordDictionary.reload()后调用CoreStopWordDictionary.dictionary.clear()会空指针。

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

CoreStopWordDictionary.reload()
CoreStopWordDictionary.dictionary.clear()

Describe the current behavior
A clear and concise description of what happened.

执行CoreStopWordDictionary.dictionary.clear()equivalenceClassMDAGNodeHashMap空指针异常。

Expected behavior
A clear and concise description of what you expected to happen.

正确清空停用词。

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):macOS Big Sur 11.0.1 20B29 x86_64.
  • Python version:非python版本
  • HanLP version:1.7.8

Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

分析原因为StopWordDictionary.reload()时执行了MDAG.simplify(),其中有equivalenceClassMDAGNodeHashMap = null;

MDAGSet.clear()方法中equivalenceClassMDAGNodeHashMap.clear();没有判空。

相关:a57645c

  • I've completed this form and searched the web for solutions.
@hankcs
Copy link
Owner

hankcs commented Jan 16, 2021

感谢反馈,已经修复,请参考上面的commit。
如果还有问题,欢迎重开issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants