Aho-Corasick algorithm (source code)

= Aho-Corasick algorithm
{c}

The Aho-Corasick algorithm matches multiple patterns in a <string> using a <trie> equipped with failure links. After preprocessing the patterns, it scans the input while reporting every pattern ending at each position.