emacs / lisp / soundex.el  ;;; soundex.el --- implement Soundex
algorithm   ;; Author: Christian Plaunt
<chris@bliss.berkeley.edu> ;; Maintainer: FSF  ;; Keywords:
matching ;; Created: Sat May 15 14:48:18 1993  ;; This file is
part of GNU Emacs.  ;; any later version.  ;; GNU General Public
License for more details.  ;; Boston, MA 02111-1307, USA.  ;;;
Commentary:  ;; The Soundex algorithm maps English words into
representations of ;; how they sound.  Words with vaguely
similar sound map to the same string.  ;;; Code:  (defvar
soundex-alist   '((?B . "1") (?F . "1") (?P . "1") (?V . "1")
(?C . "2") (?G . "2") (?J . "2") (?K . "2") (?Q . "2") (?S .
"2")     (?X . "2") (?Z . "2") (?D . "3") (?T . "3") (?L . "4")
(?M . "5")     (?N . "5") (?R . "6"))   "Alist of chars-to-key-
code for building Soundex keys.")  (defun soundex (word)
"Return a Soundex key for WORD. Implemented as described in:
Knuth, Donald E. \"The Art of Computer Programming, Vol. 3:
Sorting and Searching\", Addison-Wesley (1973), pp. 391-3