Soundex Algorithm
1. Capitalize all letters in the word and drop all punctuation marks. Pad the word with rightmost blanks as needed during each procedure step.
2. Retain the first letter of the word.
3. Change all occurrence of the following letters to '0' (zero):
'A', E', 'I', 'O', 'U', 'H', 'W', 'Y'.
4. Change letters from the following sets into the digit given:
* 1 = 'B', 'F', 'P', 'V'
* 2 = 'C', 'G', 'J', 'K', 'Q', 'S', 'X', 'Z'
* 3 = 'D','T'
* 4 = 'L'
* 5 = 'M','N'
* 6 = 'R'
5. Remove all pairs of digits which occur beside each other from the string that resulted after step (4).
6. Remove all zeros from the string that results from step 5.0 (placed there in step 3)
7. Pad the string that resulted from step (6) with trailing zeros and return only the first four positions, which will be of the form
0 Comments:
发表评论
<< Home