I am trying to understand aho-corasick string matching algorithm. Suppose our patterns are abcd and bc . We get a tree like this
[] /\ [a]..[b] / : | [b].: [c] | : [c]..... | [d]
The dashed line indicates the failure function.
Now suppose we are rooted in the string abcd . This will follow the tree and determine the match "abcd", however, as far as I can tell, the match bc not reported. Do I not understand the algorithm?
substring string-matching algorithm aho-corasick
Winston ewert
source share