hankcs / AhoCorasickDoubleArrayTrie

An extremely fast implementation of Aho Corasick algorithm based on Double Array Trie.
http://www.hankcs.com/program/algorithm/aho-corasick-double-array-trie.html
950 stars 290 forks source link

insert 函数抛出IndexOutOfBoundsException #31

Closed neofung closed 4 years ago

neofung commented 4 years ago

https://github.com/hankcs/AhoCorasickDoubleArrayTrie/blob/9552b2cadc2826c9479b08e0265732ba9b3864a2/src/main/java/com/hankcs/algorithm/AhoCorasickDoubleArrayTrie.java#L833-L847

846 行,如果siblings是空列表,还有需要插入么,如果为空列表,则会导致insert 函数抛出IndexOutOfBoundsException

hankcs commented 4 years ago

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