java.lang.Object | |
↳ | org.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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | US_ENGLISH_MAPPING_STRING | This is a default mapping of the 26 letters used in US English. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
US_ENGLISH | An instance of Soundex using the US_ENGLISH_MAPPING mapping. | ||||||||||
US_ENGLISH_MAPPING | This is a default mapping of the 26 letters used in US English. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an instance using US_ENGLISH_MAPPING
| |||||||||||
Creates a soundex instance using the given mapping.
| |||||||||||
Creates a refined soundex instance using a custom mapping.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Encodes the Strings and returns the number of characters in the two encoded Strings that are the same.
| |||||||||||
Encodes an Object using the soundex algorithm.
| |||||||||||
Encodes a String using the soundex algorithm.
| |||||||||||
This method is deprecated.
This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
| |||||||||||
This method is deprecated.
This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
| |||||||||||
Retrieves the Soundex code for a given String object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.commons.codec.Encoder
| |||||||||||
From interface
org.apache.commons.codec.StringEncoder
|
This is a default mapping of the 26 letters used in US English. A value of 0
for a letter position
means do not encode.
(This constant is provided as both an implementation convenience and to allow Javadoc to pick up the value for the constant values page.)
An instance of Soundex using the US_ENGLISH_MAPPING mapping.
This is a default mapping of the 26 letters used in US English. A value of 0
for a letter position
means do not encode.
Creates an instance using US_ENGLISH_MAPPING
Creates a soundex instance using the given mapping. This constructor can be used to provide an internationalized mapping for a non-Western character set. Every letter of the alphabet is "mapped" to a numerical value. This char array holds the values to which each letter is mapped. This implementation contains a default map for US_ENGLISH
mapping | Mapping array to use when finding the corresponding code for a given character |
---|
Creates a refined soundex instance using a custom mapping. This constructor can be used to customize the mapping, and/or possibly provide an internationalized mapping for a non-Western character set.
mapping | Mapping string to use when finding the corresponding code for a given character |
---|
Encodes the Strings and returns the number of characters in the two encoded Strings that are the same. This return value ranges from 0 through 4: 0 indicates little or no similarity, and 4 indicates strong similarity or identical values.
s1 | A String that will be encoded and compared. |
---|---|
s2 | A String that will be encoded and compared. |
EncoderException | if an error occurs encoding one of the strings |
---|
Encodes an Object using the soundex algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an EncoderException if the supplied object is not of type java.lang.String.
pObject | Object to encode |
---|
EncoderException | if the parameter supplied is not of type java.lang.String |
---|---|
IllegalArgumentException | if a character is not mapped |
Encodes a String using the soundex algorithm.
pString | A String object to encode |
---|
IllegalArgumentException | if a character is not mapped |
---|
This method is deprecated.
This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
Returns the maxLength. Standard Soundex
This method is deprecated.
This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
Sets the maxLength.
maxLength | The maxLength to set |
---|
Retrieves the Soundex code for a given String object.
str | String to encode using the Soundex algorithm |
---|
IllegalArgumentException | if a character is not mapped |
---|