finish Aho-Corasick automation, add testcase for C