JavaScript implementation of the Aho-Corasick string matching algorithm