Aho-Corasick text matching on groups of patterns

24 Views Asked by At

Aho-Corasick algorithm has solved multi-pattern matching perfectly, here is my question:

There are several groups of words: ['hello', 'world'], ['foo', 'bar'], the text is 'I come to the world and say hello to everyone'.

Because both hello and world are in the text, we can say the pattern ['hello', 'world'] is matched regardless of the sequence but ['foo', 'bar'] is not.

Is there a Aho-Corasick based algorithm which can solve the problem?

0

There are 0 best solutions below