Metaphone - Maple Help

StringTools

 Metaphone
 Metaphone function

 Calling Sequence Metaphone( s )

Parameters

 s - Maple string

Description

 • The Metaphone(s) command implements the Metaphone algorithm.
 • The metaphone of a name is a phonetic hash of the consonant sounds in the name. It is designed to be an improvement on the traditional soundex algorithm. Metaphones have the property that words, which are pronounced similarly, produce the same metaphone and can thus be used to simplify searches in databases where the pronunciation but not the spelling is known.
 • While the soundex algorithm hashes words to a four character string consisting of a letter followed by three digits, the metaphone of a word produces a varying length string consisting entirely of consonants, with the possible exception of a leading vowel.
 • All of the StringTools package commands treat strings as (null-terminated) sequences of $8$-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Metaphone}\left("James"\right)$
 ${"JM"}$ (1)
 > $\mathrm{Metaphone}\left("Barb"\right)$
 ${"BRB"}$ (2)
 > $\mathrm{Metaphone}\left("Whitting"\right)$
 ${"WTNK"}$ (3)
 > $\mathrm{Metaphone}\left("Gauss"\right)$
 ${"KS"}$ (4)
 > $\mathrm{Metaphone}\left("Goethe"\right)$
 ${"K0"}$ (5)
 > $\mathrm{Metaphone}\left("Ghosh"\right)$
 ${"KX"}$ (6)
 > $\mathrm{Metaphone}\left("Kline"\right)$
 ${"KLN"}$ (7)
 > $\mathrm{Metaphone}\left("Cline"\right)$
 ${"KLN"}$ (8)
 > $\mathrm{Metaphone}\left("Vallis"\right)$
 ${"FL"}$ (9)
 > $\mathrm{Metaphone}\left("Fallis"\right)$
 ${"FL"}$ (10)

References

 Philips, Lawrence. "Hanging on the Metaphone." Computer Language. December 1990, pp. 38-44.