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