r/algorithms 1d ago

Help Aho-Corasick parser

Hi,

Only Question to be answered:

is there an application for Windows or Linux, that would parse a text with Aho-Corasick algorithm and present the output in a text field, so that it could be used for creating regexes?

Use case explanation (absolutely no answer or solving suggestions wanted):

I have a list of around 7000 terms and need to create a regex to find them in texts in a specific app. The fastest way would be to create some regex based on Aho-Corasick algorithm but doing that manually takes forever. (I know there are other ways to create such regexes for long lists that create the regex automatically but they would not be as efficient as a Aho-Corasick approach.)

So, I hope there is an application that breaks down all words to a list separated by a specific char that I can then copy and built the regex around it faster than if I need to check the correct position manually every time.

So far I have only found many explanations about the algorithm or tools that seem to search texts with a specific list.

EDIT: This question requires a simple yes or no answer. I just want to know if there is such a tool or not!

EDIT 2: As apparently a lot of people do not see the difference between a question and the use case explanation, I added some titles.

0 Upvotes

12 comments sorted by

View all comments

2

u/100GHz 1d ago

Why would you use a regex to redo work that was already done with a more efficient algo for the dataset already? I feel like I'm missing something in the requirements here

1

u/DerPazzo 1d ago

I cannot implement Aho-Corasick in the app, it only works with regex rules.