| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.apache.commons.codec.language.DoubleMetaphoneNested Class Summary | |
class |
|
Field Summary | |
private static String[] | |
private static String[] | |
private static String[] | |
private static String[] |
|
private static String |
|
protected int |
|
Constructor Summary | |
| |
Method Summary | |
protected char |
|
private String |
|
private boolean |
|
private boolean |
|
private boolean |
|
private boolean |
|
private boolean |
|
private static boolean |
|
private static boolean |
|
private static boolean |
|
private static boolean |
|
private static boolean |
|
private static boolean |
|
protected static boolean |
|
String |
|
String |
|
Object |
|
String |
|
int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
private int |
|
boolean |
|
boolean |
|
private boolean |
|
private boolean |
|
private boolean |
|
void |
|
private static final String[] ES_EP_EB_EL_EY_IB_IL_IN_IE_EI_ER
private static final String[] L_R_N_M_B_H_F_V_W_SPACE
private static final String[] L_T_K_S_N_M_B_Z
private static final String[] SILENT_START
Prefixes when present which are not pronounced
private static final String VOWELS
"Vowels" to test for
protected int maxCodeLen
Maximum length of an encoding, default is 4
protected char charAt(String value,
int index)Gets the character at indexindexif available, otherwise it returnsCharacter.MIN_VALUEso that there is some sort of a default
private String cleanInput(String input)
Cleans the input
private boolean conditionC0(String value,
int index)Complex condition 0 for 'C'
private boolean conditionCH0(String value,
int index)Complex condition 0 for 'CH'
private boolean conditionCH1(String value,
int index)Complex condition 1 for 'CH'
private boolean conditionL0(String value,
int index)Complex condition 0 for 'L'
private boolean conditionM0(String value,
int index)Complex condition 0 for 'M'
private static boolean contains(String value,
int start,
int length,
String criteria)Shortcut method with 1 criteria
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2)Shortcut method with 2 criteria
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3)Shortcut method with 3 criteria
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3,
String criteria4)Shortcut method with 4 criteria
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3,
String criteria4,
String criteria5)Shortcut method with 5 criteria
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3,
String criteria4,
String criteria5,
String criteria6)Shortcut method with 6 criteria
protected static boolean contains(String value,
int start,
int length,
String[] criteria)Determines whethervaluecontains any of the criteria starting at indexstartand matching up to lengthlength
public String doubleMetaphone(String value)
Encode a value with Double Metaphone
- Parameters:
value- String to encode
- Returns:
- an encoded string
public String doubleMetaphone(String value,
boolean alternate)Encode a value with Double Metaphone, optionally using the alternate encoding.
- Parameters:
value- String to encodealternate- use alternate encode
- Returns:
- an encoded string
public Object encode(Object obj)
throws EncoderExceptionEncode the value using DoubleMetaphone. It will only work ifobjis aString(likeMetaphone).
- Parameters:
obj- Object to encode (should be of type String)
- Returns:
- An encoded Object (will be of type String)
- Throws:
EncoderException- encode parameter is not of type String
public String encode(String value)
Encode the value using DoubleMetaphone.
- Specified by:
- encode in interface StringEncoder
- Parameters:
value- String to encode
- Returns:
- An encoded String
public int getMaxCodeLen()
Returns the maxCodeLen.
- Returns:
- int
private int handleAEIOUY(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'A', 'E', 'I', 'O', 'U', and 'Y' cases
private int handleC(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'C' cases
private int handleCC(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'CC' cases
private int handleCH(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'CH' cases
private int handleD(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'D' cases
private int handleG(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index,
boolean slavoGermanic)Handles 'G' cases
private int handleGH(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'GH' cases
private int handleH(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'H' cases
private int handleJ(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index,
boolean slavoGermanic)Handles 'J' cases
private int handleL(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'L' cases
private int handleP(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'P' cases
private int handleR(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index,
boolean slavoGermanic)Handles 'R' cases
private int handleS(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index,
boolean slavoGermanic)Handles 'S' cases
private int handleSC(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'SC' cases
private int handleT(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'T' cases
private int handleW(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'W' cases
private int handleX(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index)Handles 'X' cases
private int handleZ(String value,
DoubleMetaphone.DoubleMetaphoneResult result,
int index,
boolean slavoGermanic)Handles 'Z' cases
public boolean isDoubleMetaphoneEqual(String value1,
String value2)Check if the Double Metaphone values of twoStringvalues are equal.
- Parameters:
value1- The left-hand side of the encodedString.equals(Object).value2- The right-hand side of the encodedString.equals(Object).
- Returns:
trueif the encodedStrings are equal;falseotherwise.
public boolean isDoubleMetaphoneEqual(String value1,
String value2,
boolean alternate)Check if the Double Metaphone values of twoStringvalues are equal, optionally using the alternate value.
- Parameters:
value1- The left-hand side of the encodedString.equals(Object).value2- The right-hand side of the encodedString.equals(Object).alternate- use the alternate value iftrue.
- Returns:
trueif the encodedStrings are equal;falseotherwise.
private boolean isSilentStart(String value)
Determines whether or not the value starts with a silent letter. It will returntrueif the value starts with any of 'GN', 'KN', 'PN', 'WR' or 'PS'.
private boolean isSlavoGermanic(String value)
Determines whether or not a value is of slavo-germanic orgin. A value is of slavo-germanic origin if it contians any of 'W', 'K', 'CZ', or 'WITZ'.
private boolean isVowel(char ch)
Determines whether or not a character is a vowel or not
public void setMaxCodeLen(int maxCodeLen)
Sets the maxCodeLen.
- Parameters:
maxCodeLen- The maxCodeLen to set