soundex

by kalai 2010-01-11 20:11:50

Soundex is a really cool, and very often overlooked feature of a ton of different programming languages

SOUNDEX(str)
Returns a soundex string from str. Two strings that sound almost the same should have identical soundex strings. A standard soundex string is 4 characters long, but the SOUNDEX() function returns an arbitrarily long string. You can use SUBSTRING() on the result to get a standard soundex string. All non-alphanumeric characters are ignored in the given string. All international alpha characters outside the A-Z range are treated as vowels:

mysql> SELECT SOUNDEX('Hello');
-> 'H400'
mysql> SELECT SOUNDEX('Quadratically');
-> 'Q36324'

mysql> select uname,title from slideshow where soundex(title) like soundex("aisha takia");

+----------+--------------+
| uname | title |
+----------+--------------+
| raven | Ayesha-Takia |
| dvvel | Ayesha-Takia |
| kalai111 | Ayesha-Takia |
| sanjesh | Ayesha-takia |
| nirmala | Ajay-Jadeja- |
| menaka | Ayesha-takia |
| kalai111 | Ayesha-takia |
+----------+--------------+
7 rows in set (0.01 sec)

This function is used to return search string with similar pronunciation.

Tagged in:

1078
like
0
dislike
0
mail
flag

You must LOGIN to add comments