X
X
xmoonlight2017-10-03 01:20:06
PHP
xmoonlight, 2017-10-03 01:20:06

What else is missing in the logic of the function for more practical and wide application?

Hello.
There is a function for searching for words and phrases with fuzzy endings of words when comparing the words of the search string with words from the text in which the search is performed.
The code is here .
I think that this decision is not finished.
Advise / prompt: what else needs to be added so that the function can be used much more practically and in a wider list of tasks and projects where such functionality is needed.
In advance, Thanks everyone for the advice.
PS: Thanks to the one who put an asterisk on the github!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-10-03
@BorisKorobkov

Shitcode.

  1. No comments, crooked formatting.
  2. A lot of regulars that will slow down.
  3. Instead of duplicating upper and lower case, use the "i" modifier.
  4. The "i" character is in both $OnlyEn and $Eng.
  5. Why change Russian characters to English with a similar spelling? And vice versa.
  6. It does not take into account that the sentence may contain punctuation marks.
  7. The search for a partial entry has nothing to do with either Russian or English. For example, this algorithm considers the words "couples", "park", Paris, "barbershop", etc., to be the same word.
  8. If the problem of finding an occurrence is already being solved, then there is no need to reinvent the wheel with square wheels. It's easier to cut off the ending and call the finished function ru2.php.net/manual/en/function.mb-stristr.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question