tangentum technologies    
 

Deutsch

   
   
 
    DoubleMetaphone (Phonetix)
Phonetix
v0.2

com.tangentum.phonetix
Class DoubleMetaphone

java.lang.Object
  |
  +--com.tangentum.phonetix.PhoneticEncoder
        |
        +--com.tangentum.phonetix.MetaphoneEncoder
              |
              +--com.tangentum.phonetix.DoubleMetaphone

public final class DoubleMetaphone
extends MetaphoneEncoder

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.

This implementation is based on the original Visual C++ implementation by Lawrence Philips with slight modifications and bug fixes by Kevin Atkinson.

Author:
Claus Engel
See Also:
Metaphone, Soundex

Field Summary
 
Fields inherited from class com.tangentum.phonetix.MetaphoneEncoder
maxLength
 
Fields inherited from class com.tangentum.phonetix.PhoneticEncoder
EMPTY_KEYS
 
Constructor Summary
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
isVowel, match, match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleMetaphone

public DoubleMetaphone(int maxLength)
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.

Specified by:
generateKey in class PhoneticEncoder
Parameters:
word - the word to encode.
Returns:
the encoding of the word. This is never null.

generateKeys

public java.lang.String[] generateKeys(java.lang.String word)
Returns the encodings of the given word. The first is based on the most commonly heard pronounciation of the word in the U.S.A.

Specified by:
generateKeys in class PhoneticEncoder
Parameters:
word - the word to encode.
Returns:
an array of the encodings of the word. This is never null.

main

public static void main(java.lang.String[] argv)
Test of algorithm with default constructed encoder. The encoded arguments are printed to System.out.


Phonetix
v0.2

Copyright © 1996-2003 Claus Engel. All Rights Reserved. how to upload instagram from mac;sftp mac os
 
     
how to upload instagram from mac;sftp mac os