Answer the question
In order to leave comments, you need to log in
How to check if one of the phrases occurs in the text?
There is a set of phrases that are similar in meaning, but differ in spelling, for example
, discount, discount
is possible,
discounts until November 30,
huge discounts,
discounts of the year
How can I check if one of these phrases occurs in the text?
(it is desirable that with a large number of phrases (> 300) the search is fast)
Or advise what you can read on this topic.
Answer the question
In order to leave comments, you need to log in
If I understand you correctly, then the Aho-Korasik algorithm
does exactly what you need. And in linear time
You can try to find a match for a common word first, for example. " СКИДК
"
Find out the starting position of the word, cut 10-20 characters back and forth ( У НАС САМЫЕ ОГРОМНЫЕ СКИДКИ И ПОДАР...
) and in the resulting string you are already looking for other more complete phrases.
Anything faster than scouring the entire text.
What is Tomita-parser, how Yandex can use it ...
How Yandex uses linguistics in search
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question