com.sun.mdm.index.phonetic
Class Phoneticizer

java.lang.Object
  extended bycom.sun.mdm.index.phonetic.Phoneticizer

public class Phoneticizer
extends java.lang.Object

Manages all Phonetic Encoder instances and provides access to their functionality by name


Constructor Summary
Phoneticizer()
          Creates new Phoneticizer
 
Method Summary
 java.lang.String encode(java.lang.String strToEncode, java.lang.String encodingType, java.lang.String domain)
          Encode a string phoneticaly with the relevant phonetic encoder for the specified encodingType
(package private)  void registerPhoneticEncoders()
          Read the available encoders from a Configuration, instantiate them and populate the internal map of encoding type to PhoneticEncoder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Phoneticizer

public Phoneticizer()
             throws PhoneticEncoderException
Creates new Phoneticizer

Throws:
PhoneticEncoderException - if the configured encoders can not be registred
Method Detail

encode

public java.lang.String encode(java.lang.String strToEncode,
                               java.lang.String encodingType,
                               java.lang.String domain)
                        throws PhoneticEncoderException
Encode a string phoneticaly with the relevant phonetic encoder for the specified encodingType

Parameters:
strToEncode - The string to encode
encodingType - The phonetic encoding type, which maps onto a responsible encoder
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 no phonetic encoder is present for the specified encodingType or the encoding by the PhoneticEncoder fails.

registerPhoneticEncoders

void registerPhoneticEncoders()
                        throws PhoneticEncoderException
Read the available encoders from a Configuration, instantiate them and populate the internal map of encoding type to PhoneticEncoder

Throws:
PhoneticEncoderException - if the encoders could not be loaded or registered


Sun Microsystems, Inc.