note 8873 deleted from function.soundex by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:35:41 +0000 |
| Subject: | note 8873 deleted from function.soundex by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22346@lists.php.net to get a copy of this message | ||
For those of you who don't have access to the "Art of Programming", heres a quick
outline of how soundex works:
The output is CNNN, where C is a capital letter and N are digits between 0 and 6, inclusive.
(1) Set C = to first letter of the target word.
(2) Ignore all occurences of the following letters 'aehiouwy' in the target word
(3) Convert the remaining letters using the following scheme
b,f,p,v to 1
c,g,j,k,q,s,x,z to 2
d,t to 3
l to 4
m,n to 5
r to 6
(4) If to or more of the same conversion value appear next to each other, just enter the first
occurance into N. Otherwise, just stick the value into N.
(5) If you have any unused N's left when you are done, set them to 0.
Things you have to keep in mind with soundex is that
(a) its very inaccurate
(b) the first letter of the word is critical