1998-01-20 05:45:44 +01:00
|
|
|
\section{Built-in Module \sectcode{soundex}}
|
1997-07-17 18:34:52 +02:00
|
|
|
\label{module-soundex}
|
1998-01-20 05:45:44 +01:00
|
|
|
\bimodindex{soundex}
|
1996-12-12 18:02:21 +01:00
|
|
|
|
1998-02-13 07:58:54 +01:00
|
|
|
\setindexsubitem{(in module soundex)}
|
1996-12-12 18:02:21 +01:00
|
|
|
The soundex algorithm takes an English word, and returns an
|
|
|
|
easily-computed hash of it; this hash is intended to be the same for
|
|
|
|
words that sound alike. This module provides an interface to the
|
|
|
|
soundex algorithm.
|
|
|
|
|
|
|
|
Note that the soundex algorithm is quite simple-minded, and isn't
|
|
|
|
perfect by any measure. Its main purpose is to help looking up names
|
1998-01-20 05:45:44 +01:00
|
|
|
in databases, when the name may be misspelled --- soundex hashes common
|
1996-12-12 18:02:21 +01:00
|
|
|
misspellings together.
|
|
|
|
|
|
|
|
\begin{funcdesc}{get_soundex}{string}
|
|
|
|
Return the soundex hash value for a word; it will always be a
|
|
|
|
6-character string. \var{string} must contain the word to be hashed,
|
|
|
|
with no leading whitespace; the case of the word is ignored.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{sound_similar}{string1, string2}
|
|
|
|
Compare the word in \var{string1} with the word in \var{string2}; this
|
|
|
|
is equivalent to
|
|
|
|
\code{get_soundex(\var{string1})==get_soundex(\var{string2})}.
|
|
|
|
\end{funcdesc}
|