charAt
protected char charAt(String value,
int index)
Gets the character at index index
if available, otherwise
it returns Character.MIN_VALUE
so that there is some sort
of a default
cleanInput
private String cleanInput(String input)
Cleans the input
conditionC0
private boolean conditionC0(String value,
int index)
Complex condition 0 for 'C'
conditionCH0
private boolean conditionCH0(String value,
int index)
Complex condition 0 for 'CH'
conditionCH1
private boolean conditionCH1(String value,
int index)
Complex condition 1 for 'CH'
conditionL0
private boolean conditionL0(String value,
int index)
Complex condition 0 for 'L'
conditionM0
private boolean conditionM0(String value,
int index)
Complex condition 0 for 'M'
contains
private static boolean contains(String value,
int start,
int length,
String criteria)
Shortcut method with 1 criteria
contains
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2)
Shortcut method with 2 criteria
contains
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3)
Shortcut method with 3 criteria
contains
private static boolean contains(String value,
int start,
int length,
String criteria1,
String criteria2,
String criteria3,
String criteria4)
Shortcut method with 4 criteria
contains
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
contains
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
contains
protected static boolean contains(String value,
int start,
int length,
String[] criteria)
Determines whether value
contains any of the criteria
starting
at index start
and matching up to length length
doubleMetaphone
public String doubleMetaphone(String value)
Encode a value with Double Metaphone
doubleMetaphone
public String doubleMetaphone(String value,
boolean alternate)
Encode a value with Double Metaphone, optionally using the alternate
encoding.
value
- String to encodealternate
- use alternate encode
encode
public Object encode(Object obj)
throws EncoderException
Encode the value using DoubleMetaphone. It will only work if
obj
is a String
(like Metaphone
).
- encode in interface Encoder
obj
- Object to encode (should be of type String)
- An encoded Object (will be of type String)
encode
public String encode(String value)
Encode the value using DoubleMetaphone.
- encode in interface StringEncoder
getMaxCodeLen
public int getMaxCodeLen()
Returns the maxCodeLen.
isDoubleMetaphoneEqual
public boolean isDoubleMetaphoneEqual(String value1,
String value2)
Check if the Double Metaphone values of two String
values
are equal.
value1
- The left-hand side of the encoded String.equals(Object)
.value2
- The right-hand side of the encoded String.equals(Object)
.
true
if the encoded String
s are equal;
false
otherwise.
isDoubleMetaphoneEqual
public boolean isDoubleMetaphoneEqual(String value1,
String value2,
boolean alternate)
Check if the Double Metaphone values of two String
values
are equal, optionally using the alternate value.
value1
- The left-hand side of the encoded String.equals(Object)
.value2
- The right-hand side of the encoded String.equals(Object)
.alternate
- use the alternate value if true
.
true
if the encoded String
s are equal;
false
otherwise.
isSilentStart
private boolean isSilentStart(String value)
Determines whether or not the value starts with a silent letter. It will
return true
if the value starts with any of 'GN', 'KN',
'PN', 'WR' or 'PS'.
isSlavoGermanic
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'.
isVowel
private boolean isVowel(char ch)
Determines whether or not a character is a vowel or not
setMaxCodeLen
public void setMaxCodeLen(int maxCodeLen)
Sets the maxCodeLen.
maxCodeLen
- The maxCodeLen to set