Imagine searching a century-old census for your great-grandmother. You type Kowalski but the clerk wrote Kowalsky. A normal search finds nothing. Soundex finds her.
Soundex is a phonetic algorithm invented by Robert Russell and Margaret Odell around 1918 and adopted for the 1880 and 1900 US Censuses. Its idea is both ancient and elegant: instead of comparing letters, compare sounds. Strip vowels, merge similar consonants, and you get a short code â a phonetic hash â that stays the same no matter how a name is spelled, as long as it sounds the same.
The rules are surprisingly concise. Keep the first letter of the name as-is. Then scan the rest, drop vowels and the letters H, W, and Y (which rarely affect the sound), and replace consonants with digits according to a fixed table: B, F, P, V â 1; C, G, J, K, Q, S, X, Z â 2; D, T â 3; L â 4; M, N â 5; R â 6. Merge consecutive duplicates and pad or trim to exactly four characters total â one letter plus three digits.
The result: Smith â S530, Smyth â S530. Johnson â J525, Jonson â J525. Names that sound alike collide to the same hash; names that sound different stay apart.
Comments
Loading comments...