Klasse MetaphoneEncoder
java.lang.Object
org.xbib.interlibrary.catalog.matching.string.MetaphoneEncoder
- Alle implementierten Schnittstellen:
StringEncoder
A class to generate phonetic code. 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
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungFind the metaphone value of a String.int
Returns the maxCodeLen.boolean
isMetaphoneEqual
(String str1, String str2) Tests is the metaphones of two strings are identical.void
setMaxCodeLen
(int maxCodeLen) Sets the maxCodeLen.
-
Konstruktordetails
-
MetaphoneEncoder
public MetaphoneEncoder()
-
-
Methodendetails
-
encode
Find the metaphone value of a String. This is similar to the soundex algorithm, but better at finding similar sounding words. All input is converted to upper case. Limitations: Input format is expected to be a single ASCII word with only characters in the A - Z range, no punctuation or numbers.- Angegeben von:
encode
in SchnittstelleStringEncoder
- Parameter:
txt
- String to find the metaphone code for- Gibt zurück:
- A metaphone code corresponding to the String supplied
- Löst aus:
EncoderException
- if there is an error condition during the encoding process.
-
isMetaphoneEqual
Tests is the metaphones of two strings are identical.- Parameter:
str1
- First of two strings to comparestr2
- Second of two strings to compare- Gibt zurück:
- true if the metaphones of these strings are identical, false otherwise.
-
getMaxCodeLen
public int getMaxCodeLen()Returns the maxCodeLen.- Gibt zurück:
- int
-
setMaxCodeLen
public void setMaxCodeLen(int maxCodeLen) Sets the maxCodeLen.- Parameter:
maxCodeLen
- The maxCodeLen to set
-