blob: 4c15c55aaafb6ce2a3ce47cc37adca0c402b41b2 [file] [log] [blame]
Guido van Rossum3486f271996-12-12 17:02:21 +00001\section{Standard Module \sectcode{soundex}}
2\stmodindex{soundex}
3
4\renewcommand{\indexsubitem}{(in module soundex)}
5The soundex algorithm takes an English word, and returns an
6easily-computed hash of it; this hash is intended to be the same for
7words that sound alike. This module provides an interface to the
8soundex algorithm.
9
10Note that the soundex algorithm is quite simple-minded, and isn't
11perfect by any measure. Its main purpose is to help looking up names
12in databases, when the name may be misspelled -- soundex hashes common
13misspellings together.
14
15\begin{funcdesc}{get_soundex}{string}
16Return the soundex hash value for a word; it will always be a
176-character string. \var{string} must contain the word to be hashed,
18with no leading whitespace; the case of the word is ignored.
19\end{funcdesc}
20
21\begin{funcdesc}{sound_similar}{string1, string2}
22Compare the word in \var{string1} with the word in \var{string2}; this
23is equivalent to
24\code{get_soundex(\var{string1})==get_soundex(\var{string2})}.
25\end{funcdesc}