StringTools - Maple Programming Help

Home : Support : Online Help : Programming : Names and Strings : StringTools Package : String Homology Routines : StringTools/Soundex

StringTools

 Soundex
 implements the classical Soundex algorithm

 Calling Sequence Soundex( s )

Parameters

 s - Maple string

Description

 • The Soundex(s) command implements the classical Soundex algorithm.
 The Soundex algorithm is intended to hash words into a small space by using a model which approximates the sound of the word when spoken by an English speaker.  Each word is reduced to a four character string (a Soundex key), where the first character is an uppercase letter and the remaining three characters are digits. Soundex keys have the property that words, which are pronounced similarly, produce the same soundex key and can thus be used to simplify searches in databases where the pronunciation but not the spelling is known.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Soundex}\left("James"\right)$
 ${"J520"}$ (1)
 > $\mathrm{Soundex}\left("Barb"\right)$
 ${"B610"}$ (2)
 > $\mathrm{Soundex}\left("Gauss"\right)$
 ${"G200"}$ (3)
 > $\mathrm{Soundex}\left("Goethe"\right)$
 ${"G300"}$ (4)
 > $\mathrm{Soundex}\left("Ghosh"\right)$
 ${"G200"}$ (5)
 > $\mathrm{Soundex}\left("Kline"\right)$
 ${"K450"}$ (6)
 > $\mathrm{Soundex}\left("Cline"\right)$
 ${"C450"}$ (7)
 > $\mathrm{Soundex}\left("Vallis"\right)$
 ${"V420"}$ (8)
 > $\mathrm{Soundex}\left("Fallis"\right)$
 ${"F420"}$ (9)

References

 Knuth, Donald. The Art of Computer Programming, Volume 3: Sorting and Searching. Reading, Massachusetts: Addison-Wesley, 1973, pp. 391-392.