Aho corasick search algorithm written in Erlang. Fail function not implemented.