Skip to content

Commit

Permalink
修复 CoreStopWordDictionary.dictionary.clear() fix #1603
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Jan 16, 2021
1 parent 6265aec commit 2577426
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/hankcs/hanlp/collection/MDAG/MDAGSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ public void clear()
{
sourceNode = new MDAGNode(false);
simplifiedSourceNode = null;
equivalenceClassMDAGNodeHashMap.clear();
if (equivalenceClassMDAGNodeHashMap != null)
equivalenceClassMDAGNodeHashMap.clear();
mdagDataArray = null;
charTreeSet.clear();
transitionCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ public void testReload()
{
CoreStopWordDictionary.reload();
assertTrue(CoreStopWordDictionary.contains("这里"));
CoreStopWordDictionary.dictionary.clear();
assertFalse(CoreStopWordDictionary.contains("这里"));
}
}

0 comments on commit 2577426

Please sign in to comment.