What are the practical uses of metaphone () and soundex () in PHP?

Metaphone and Soundex are phonetic algorithms for indexing strings with their English pronunciation.

Have you ever used the metaphone () or soundex () functions that are present in the standard PHP library?

What for? What are the real possibilities for using these features?

+4
source share
2 answers

More generally, soundex and metaphone can be used to find strings that sound the same when pronounced loudly.

This can be used outside of situations where you are simply trying to find the "right" spelling. It can be used, for example, to help detect a mistake, for example, the misuse of a correctly spelled word that sounds like the right one.

Another attractive use is to try and find the correct name. When I tell someone, my name is “Nicholas”, there are at least two “alternative” spellings that I see, they try to use a lot: Nicholas and Nicholas. When they enter it and it does not find me in the database, soundex or metaphone can be used to say "There is no Nicholas Knight, but there is a Knight Nicholas."

The extent to which these algorithms actually work, however, is somewhat controversial. They sometimes come up with rather strange results.

+5
source

You can use them when doing spell checking. Then you could easily notice that, for example, “phorensics” is a good match for “forensics.”

+2
source

Source: https://habr.com/ru/post/1315284/


All Articles