com.sun.mdm.index.phonetic
Interface PhoneticEncoder

All Known Implementing Classes:
DoubleMetaphone, Metaphone, Nysiis, RefinedSoundex, Soundex

public interface PhoneticEncoder

Interface to be implemented by a phonetic encoder so the framework can use it.


Method Summary
 java.lang.String encode(java.lang.String strToEncode)
          Encode a string phoneticaly
 java.lang.String encode(java.lang.String strToEncode, java.lang.String domain)
          Encode a string phoneticaly
 java.lang.String getEncodingType()
          Getter for the encoding type
 

Method Detail

encode

public java.lang.String encode(java.lang.String strToEncode)
                        throws PhoneticEncoderException
Encode a string phoneticaly

Parameters:
strToEncode - The string to encode
Returns:
the encoded version of the strToEncode
Throws:
PhoneticEncoderException - if the encoding fails.

encode

public java.lang.String encode(java.lang.String strToEncode,
                               java.lang.String domain)
                        throws PhoneticEncoderException
Encode a string phoneticaly

Parameters:
strToEncode - The string to encode
domain - A domain marking the country/language context. An optional feature for an encoder to implement.
Returns:
the encoded version of the strToEncode
Throws:
PhoneticEncoderException - if the encoding fails.

getEncodingType

public java.lang.String getEncodingType()
Getter for the encoding type

Returns:
the encoding type the Phonetic Encoder implements (such as NYSIIS or Soundex) This value is for information purposes and is not enforced to be of the same value as the 'encoding type' listed in the PhoneticEncodersConfiguration for the encoder class instance. As a result it should not be used for calls to the Phoneticizer.


Sun Microsystems, Inc.