|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.mdm.index.phonetic.impl.Metaphone
Encodes a string into a metaphone value. The initial Java implementation, William B. Brogden. December, 1997 Permission given by wbrogden for code to be used anywhere. "Hanging on the Metaphone" by Lawrence Philips Computer Language of Dec. 1990, p 39
Field Summary | |
static java.lang.String |
ENCODING_TYPE
informative String about the encoding type this encoder does |
Constructor Summary | |
Metaphone()
Creates an instance of the Metaphone encoder |
Method Summary | |
java.lang.Object |
encode(java.lang.Object pObject)
Encodes an Object using the metaphone algorithm. |
java.lang.String |
encode(java.lang.String pString)
Encodes a String using the Metaphone algorithm. |
java.lang.String |
encode(java.lang.String value,
java.lang.String domain)
Encode the value using Metaphone. |
java.lang.String |
getEncodingType()
|
int |
getMaxCodeLen()
Returns the maxCodeLen. |
boolean |
isMetaphoneEqual(java.lang.String str1,
java.lang.String str2)
Tests is the metaphones of two strings are identical. |
java.lang.String |
metaphone(java.lang.String txt)
Find the metaphone value of a String. |
void |
setMaxCodeLen(int maxCodeLen)
Sets the maxCodeLen. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ENCODING_TYPE
Constructor Detail |
public Metaphone()
Method Detail |
public java.lang.Object encode(java.lang.Object pObject) throws PhoneticEncoderException
pObject
- Object to encode
PhoneticEncoderException
- if the parameter supplied is not
of type java.lang.Stringpublic java.lang.String encode(java.lang.String pString)
encode
in interface PhoneticEncoder
pString
- String object to encode
PhoneticEncoderException
- thrown if a Metaphone specific exception
is encountered.public java.lang.String encode(java.lang.String value, java.lang.String domain)
encode
in interface PhoneticEncoder
value
- String to encodedomain
- locality
PhoneticEncoderException
- thrown if there is an exception during
the encoding process.public java.lang.String getEncodingType()
PhoneticEncoder
getEncodingType
in interface PhoneticEncoder
public int getMaxCodeLen()
public boolean isMetaphoneEqual(java.lang.String str1, java.lang.String str2)
str1
- First of two strings to comparestr2
- Second of two strings to compare
public java.lang.String metaphone(java.lang.String txt)
txt
- String to find the metaphone code for
public void setMaxCodeLen(int maxCodeLen)
maxCodeLen
- The maxCodeLen to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun Microsystems, Inc.