Answer the question
In order to leave comments, you need to log in
Searching for words in a text using a dictionary?
There is a dictionary of 2-3 (Anya, Sasha, Alexandra, Alex) thousands of names and an arbitrary text of 2-3k characters
Is there an optimal way to search for exact occurrences of names in this arbitrary text. 100 thousand names. Perhaps there are any libraries or tools for this?
Answer the question
In order to leave comments, you need to log in
I think full-text search systems - sphynx, elasticsearch - will perfectly cope with the task.
But maybe it's a cannon for a sparrow
Simple task. The dictionary of names is converted to lowercase and loaded into a hash table or binary search tree. Next, we run through the text, select the words, copy them to the buffer, converting uppercase letters to lowercase, and look for the word in the hash table (or search tree). Faster only due to low-level optimizations or I misunderstood the task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question