Encoder implementing the phonetic algorithm "DoubleMetaphone".
DoubleMetaphone was developed by Lawrence Philips
and published in the June 2000 issue of the C/C++ Users Journal.
DoubleMetaphone is an improvement
of Philips' original Metaphone algorithm.
DoubleMetaphone sometimes generates two encodings of a word,
instead of only one like Soundex and Metaphone.
The first encoding is usually based on the most commonly heard
pronounciation of the word in the U.S.A.
For more information on DoubleMetaphone, please see Philips' article
article.
DoubleMetaphone()
Constructs a DoubleMetaphone encoder which generates keys with
maximal length 4.
DoubleMetaphone(int maxLength)
Constructs a DoubleMetaphone encoder which generates keys of given
maximal length.
Method Summary
java.lang.String
generateKey(java.lang.String word)
Returns an encoding of the given word, that is based on the most
commonly heard pronounciation of the word in the U.S.A.
java.lang.String[]
generateKeys(java.lang.String word)
Returns the encodings of the given word.
static void
main(java.lang.String[] argv)
Test of algorithm with default constructed encoder.
java.lang.String
toString()
Returns a String identifying the algorithm.
Methods inherited from class com.tangentum.phonetix.MetaphoneEncoder
Constructs a DoubleMetaphone encoder which generates keys of given
maximal length.
Parameters:
maxLength - the maximal length of the generated keys. If negative,
the lengths of the keys returned are only limited
by the lengths of the words to encode.
DoubleMetaphone
public DoubleMetaphone()
Constructs a DoubleMetaphone encoder which generates keys with
maximal length 4.
Method Detail
toString
public java.lang.String toString()
Returns a String identifying the algorithm.
Overrides:
toString in class java.lang.Object
generateKey
public java.lang.String generateKey(java.lang.String word)
Returns an encoding of the given word, that is based on the most
commonly heard pronounciation of the word in the U.S.A.