ahocorasick icon indicating copy to clipboard operation
ahocorasick copied to clipboard

Doesn't support incremental string matching

Open issamemari opened this issue 3 years ago • 0 comments

The algorithm assumes that the dictionary is fixed. I've found that in practical applications it may happen that the user needs to add new strings to the keyword dictionary and have the matching algorithm be able to start matching those on the fly.

This problem has been studied and a modification to the Aho Corasick algorithm to make it support incremental matching has been proposed by Bertrand Meyer in his article "Incremental string matching".

I've made several modifications to the implementation in my fork , among which is adding the possibility to do incremental string matching as described in Bertrand's article.

I'm happy to submit a PR with only the changes related to this.

issamemari avatar Nov 10 '21 23:11 issamemari