diff --git a/README.md b/README.md index 905ee33..393edc4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Include this dependency in your POM. Be sure to check for the latest version in com.hankcs aho-corasick-double-array-trie - 1.2.1 + 1.2.2 ``` diff --git a/pom.xml b/pom.xml index e6a502d..81ade24 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.hankcs aho-corasick-double-array-trie - 1.2.1 + 1.2.2 AhoCorasickDoubleArrayTrie https://github.com/hankcs/AhoCorasickDoubleArrayTrie diff --git a/src/main/java/com/hankcs/algorithm/AhoCorasickDoubleArrayTrie.java b/src/main/java/com/hankcs/algorithm/AhoCorasickDoubleArrayTrie.java index a6e15ac..2fa72a6 100644 --- a/src/main/java/com/hankcs/algorithm/AhoCorasickDoubleArrayTrie.java +++ b/src/main/java/com/hankcs/algorithm/AhoCorasickDoubleArrayTrie.java @@ -889,7 +889,7 @@ private void insert(List> firstSiblings) { Queue>>> siblingQueue = new ArrayDeque>>>(); siblingQueue.add(new AbstractMap.SimpleEntry>>(null, firstSiblings)); - + while (siblingQueue.isEmpty() == false) { insert(siblingQueue); @@ -901,10 +901,11 @@ private void insert(List> firstSiblings) * * @param siblingQueue a queue holding all siblings being inserted and the position to insert them */ - private void insert(Queue>>> siblingQueue) { + private void insert(Queue>>> siblingQueue) + { Map.Entry>> tCurrent = siblingQueue.remove(); List> siblings = tCurrent.getValue(); - + int begin = 0; int pos = Math.max(siblings.get(0).getKey() + 1, nextCheckPos) - 1; int nonzero_num = 0;