Klasse SoundexEncoder
java.lang.Object
org.xbib.interlibrary.catalog.matching.string.SoundexEncoder
- Alle implementierten Schnittstellen:
StringEncoder
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.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final SoundexEncoder
This static variable contains an instance of the Soundex using the US_ENGLISH mapping. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates an instance of the Soundex object using the default US_ENGLISH mapping.SoundexEncoder
(List<Character> mapping) Creates a soundex instance using a custom mapping. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungRetrieves the Soundex code for a given string.int
Returns the maxLength.void
setMaxLength
(int maxLength) Sets the maxLength.
-
Felddetails
-
US_ENGLISH
This static variable contains an instance of the Soundex using the US_ENGLISH mapping.
-
-
Konstruktordetails
-
SoundexEncoder
public SoundexEncoder()Creates an instance of the Soundex object using the default US_ENGLISH mapping. -
SoundexEncoder
Creates a 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.- Parameter:
mapping
- Mapping array to use when finding the corresponding code for a given character
-
-
Methodendetails
-
encode
Retrieves the Soundex code for a given string.- Angegeben von:
encode
in SchnittstelleStringEncoder
- Parameter:
str
- String to encode using the Soundex algorithm- Gibt zurück:
- A soundex code for the String supplied
- Löst aus:
EncoderException
- if there is an error condition during the encoding process.
-
getMaxLength
public int getMaxLength()Returns the maxLength. Standard Soundex- Gibt zurück:
- int
-
setMaxLength
public void setMaxLength(int maxLength) Sets the maxLength.- Parameter:
maxLength
- The maxLength to set
-