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

The base[1] always equals -1 #13

Closed yanwii closed 6 years ago

yanwii commented 6 years ago

According your code, I re-implement the algorithm with c++. Because the code of end node equals 0, so, when there is a separate end node, the begin always equals 1(because the code of others word starting at 1, (begin + code) > 1 ), so the base[0 + 1]=-1, it's obviously wrong. What's wrong?

turbanoff commented 6 years ago

@yanwii No, it's not. default