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...