com.sun.mdm.index.phonetic.impl
Class Nysiis

java.lang.Object
  extended bycom.sun.mdm.index.phonetic.impl.Nysiis
All Implemented Interfaces:
PhoneticEncoder

public class Nysiis
extends java.lang.Object
implements PhoneticEncoder

Encode a string using the NYSIIS algorithm.


Field Summary
static java.lang.String ENCODING_TYPE
          Informative String about the encoding type this encoder does
(package private)  java.lang.StringBuffer word
           
 
Constructor Summary
Nysiis()
          Creates new Nysiis
 
Method Summary
 java.lang.String encode(java.lang.String value)
          Encode the value using DoubleMetaphone.
 java.lang.String encode(java.lang.String originalWord, java.lang.String domain)
          Encode a string phoneticaly using NYSIIS
 java.lang.String getEncodingType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING_TYPE

public static final java.lang.String ENCODING_TYPE
Informative String about the encoding type this encoder does

See Also:
Constant Field Values

word

java.lang.StringBuffer word
Constructor Detail

Nysiis

public Nysiis()
Creates new Nysiis

Method Detail

encode

public java.lang.String encode(java.lang.String value)
                        throws PhoneticEncoderException
Encode the value using DoubleMetaphone.

Specified by:
encode in interface PhoneticEncoder
Parameters:
value - String to encode
Returns:
An encoded String
Throws:
PhoneticEncoderException - thrown if there is an exception during the encoding process.

encode

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

Specified by:
encode in interface PhoneticEncoder
Parameters:
originalWord - The string to encode
domain - A domain marking the country/language context. An optional feature for an encoder to implement. This encoder does not currently support domains.
Returns:
the NYSIIS encoded version of the strToEncode
Throws:
PhoneticEncoderException - if the encoding fails.

getEncodingType

public java.lang.String getEncodingType()
Description copied from interface: PhoneticEncoder
Getter for the encoding type

Specified by:
getEncodingType in interface PhoneticEncoder
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.