tangentum technologies    
 

Deutsch

   
   
 
    PhoneticEncoder (Phonetix)
Phonetix
v0.2

com.tangentum.phonetix
Class PhoneticEncoder

java.lang.Object
  |
  +--com.tangentum.phonetix.PhoneticEncoder
Direct Known Subclasses:
Exact, LowerCase, MetaphoneEncoder, Soundex, UpperCase

public abstract class PhoneticEncoder
extends java.lang.Object

PhoneticEncoders generate one or more keys for a given word using a phonetic algorithm. The goal of each phonetic algorithm is to generate the same keys for words which have a similar pronunciation.

Author:
Claus Engel

Field Summary
static java.lang.String[] EMPTY_KEYS
           
 
Constructor Summary
PhoneticEncoder()
           
 
Method Summary
abstract  java.lang.String generateKey(java.lang.String word)
          Generates a key.
abstract  java.lang.String[] generateKeys(java.lang.String word)
          Generates an array of keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_KEYS

public static final java.lang.String[] EMPTY_KEYS
Constructor Detail

PhoneticEncoder

public PhoneticEncoder()
Method Detail

generateKeys

public abstract java.lang.String[] generateKeys(java.lang.String word)
Generates an array of keys.

Parameters:
word - the word for which the keys have to be generated.
Returns:
an array of keys. The keys of more importance are found at the smaller indices, i.e. the most important key is found at index zero. The array is never null, but of length zero, if the given word is null or the empty-string.

generateKey

public abstract java.lang.String generateKey(java.lang.String word)
Generates a key. If the underlying algorithm creates more than one key, the default key, i.e. the most important key, is returned.

Parameters:
word - the word for which the key has to be generated.
Returns:
a key. The result is never null, i.e. if the given word is null or the empty-string, then the empty-string is returned.

Phonetix
v0.2

Copyright © 1996-2003 Claus Engel. All Rights Reserved.