Python 3 port of ahocorasick extension