Algorithm Trie / Aho-Corasick Python version