@Superchen17
This isn't really a bug, but rather a request for information.
I am curious why you did not use the pip
-installable 'pyahocorasick` rather than writing your own. Please don't take this to be a criticism - sometimes there are particular reasons to work with a fresh implementation, e.g., other implementations may not be designed to be used in the way that you have in mind, etc.. Furthermore, I see the benefit in doing an implementation to understand the algorithm better. I also have tried to do implementations 'purely' in one language rather than relying upon libraries written in another language. And, indeed, I post to public GitHub repos things that I am coding for whatever reason without worrying whether it might somehow be useful to anyone else.
So, if you care to share what your motivation is, I'd like to know. What might be particularly informative is the execution speed of your implementation compared to pyahocorasick
.
Thank you in advance for taking this inquiry in the spirit intended, and happy coding!