Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Soundex()
Message
 
À
08/08/2002 07:20:44
Philip Jones
Cornwall County Council
Truro, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00687433
Message ID:
00687435
Vues:
15
This message has been marked as the solution to the initial question of the thread.
Philip
Check this out
The Soundex Algorithm uses the following steps to encode a word:
1) The first character of the word is retained as the first character of the Soundex code.
2) The following letters are discarded: a,e,i,o,u,h,w, and y.
3) If consonants having the same code number appear consecutively, the number will only be coded once. (e.g. "B233" becomes "B23")
4) With this in mind, the following mappings are made:
   Letter:               Number It's Mapped To: 
b, p, f, and v                1  
c, s, k, g, j, q, x, z        2  
d and t                       3  
l                             4  
m and n                       5  
r                             6  

5) The resulting code is modified so that it becomes exactly four characters long: 
If it is less than 4 characters, zeroes are added to the end (e.g. "B2" becomes "B200")
If it is more than 4 characters, the code is truncated (e.g. "B2435" becomes "B243")
Cheers,
Jaime

>This might be a really stupid question but can anyone explain to me exactly how the soundex() function arrives at the 4 character values that it produces?
>
>The first character seems to always be the first character of the string that you pass into it.
>
>How does it come up with the other three?
>
>Phil.
Why do programs stop working correctly as soon as you leave the Fox?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform