|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.codec.language.Soundex
Encodes a string into a soundex value. Soundex is an encoding used to relate similar names, but can also be used as a general purpose scheme to find word with similar phonemes.
Field Summary | |
static Soundex |
US_ENGLISH
This static variable contains an instance of the Soundex using the US_ENGLISH mapping. |
static char[] |
US_ENGLISH_MAPPING
This is a default mapping of the 26 letters used in US english. |
Constructor Summary | |
Soundex()
Creates an instance of the Soundex object using the default US_ENGLISH mapping. |
|
Soundex(char[] mapping)
Creates a soundex instance using a custom mapping. |
Method Summary | |
Object |
encode(Object pObject)
Encodes an Object using the soundex algorithm. |
String |
encode(String pString)
Encodes a String using the soundex algorithm. |
int |
getMaxLength()
Deprecated. This feature is not needed since the encoding size must be constant. |
void |
setMaxLength(int maxLength)
Deprecated. This feature is not needed since the encoding size must be constant. |
String |
soundex(String str)
Retreives the Soundex code for a given String object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Soundex US_ENGLISH
public static final char[] US_ENGLISH_MAPPING
0
for a letter position means do not encode.
Constructor Detail |
public Soundex()
public Soundex(char[] mapping)
mapping
- Mapping array to use when finding the corresponding code for
a given characterMethod Detail |
public Object encode(Object pObject) throws EncoderException
encode
in interface Encoder
pObject
- Object to encode
EncoderException
- if the parameter supplied is not of type java.lang.Stringpublic String encode(String pString)
encode
in interface StringEncoder
pString
- A String object to encode
public int getMaxLength()
public void setMaxLength(int maxLength)
maxLength
- The maxLength to setpublic String soundex(String str)
str
- String to encode using the Soundex algorithm
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |