exiting aho-corasick algorithm code, modified to fit our theoretical analysis, todo- need to deal with space and special characters .,! etc