org.apache.commons.codec.language
public class RefinedSoundex extends Object implements StringEncoder
Version: $Id: RefinedSoundex.java 130375 2004-06-05 18:32:04Z ggregory $
Field Summary | |
---|---|
char[] | soundexMapping
Every letter of the alphabet is "mapped" to a numerical value. |
static RefinedSoundex | US_ENGLISH
This static variable contains an instance of the RefinedSoundex using
the US_ENGLISH mapping. |
static char[] | US_ENGLISH_MAPPING
RefinedSoundex is *refined* for a number of reasons one being that the
mappings have been altered. |
Constructor Summary | |
---|---|
RefinedSoundex()
Creates an instance of the RefinedSoundex object using the default US
English mapping. | |
RefinedSoundex(char[] mapping)
Creates a refined soundex instance using a custom mapping. |
Method Summary | |
---|---|
int | difference(String s1, String s2)
Returns the number of characters in the two encoded Strings that are the
same. |
Object | encode(Object pObject)
Encodes an Object using the refined soundex algorithm. |
String | encode(String pString)
Encodes a String using the refined soundex algorithm.
|
char | getMappingCode(char c)
Returns the mapping code for a given character. |
String | soundex(String str)
Retreives the Refined Soundex code for a given String object.
|
Parameters: mapping Mapping array to use when finding the corresponding code for a given character
Parameters: s1 A String that will be encoded and compared. s2 A String that will be encoded and compared.
Returns: The number of characters in the two encoded Strings that are the same from 0 to to the length of the shortest encoded String.
Throws: EncoderException if an error occurs encoding one of the strings
Since: 1.3
See Also: difference
MS T-SQL DIFFERENCE
Parameters: pObject Object to encode
Returns: An object (or type java.lang.String) containing the refined soundex code which corresponds to the String supplied.
Throws: EncoderException if the parameter supplied is not of type java.lang.String
Parameters: pString A String object to encode
Returns: A Soundex code corresponding to the String supplied
Parameters: c char to get mapping for
Returns: A character (really a numeral) to return for the given char
Parameters: str String to encode using the Refined Soundex algorithm
Returns: A soundex code for the String supplied