soundex

Expand a query into phonetic equivalents.

Language specific - mainly for names.

E.g. chebyshev -> tchebycheff

Method

  1. Retain first letter

  2. Word transformation aeiouhwy -> 0 bfpv -> 1 cgjkqsxzz -> 2 dt -> 3 l -> 4 mn -> 5 r -> 6

  3. Recursively collpase pair of consecutive identical digits into 1.

333 -> 33 -> 3
  1. Remove all zeros
  2. Pad resulting string with trailing zeros, return first 4.

Example

Herman
Herman -> perform 1.
H06505 -> perform 2.
H06505 -> perform 3.
H655   -> perform 4.
H65500 -> perform 5.
H655   -> perform 5.