| java.lang.Object org.apache.commons.codec.language.DoubleMetaphone
DoubleMetaphone | public class DoubleMetaphone implements StringEncoder(Code) | | Encodes a string into a double metaphone value.
This Implementation is based on the algorithm by Lawrence Philips.
author: Apache Software Foundation version: $Id: DoubleMetaphone.java,v 1.24 2004/06/05 18:32:04 ggregory Exp $ |
Inner Class :public class DoubleMetaphoneResult | |
Method Summary | |
protected char | charAt(String value, int index) | protected static boolean | contains(String value, int start, int length, String[] criteria) | public String | doubleMetaphone(String value) | public String | doubleMetaphone(String value, boolean alternate) Encode a value with Double Metaphone, optionally using the alternate
encoding. | public Object | encode(Object obj) Encode the value using DoubleMetaphone. | public String | encode(String value) Encode the value using DoubleMetaphone. | public int | getMaxCodeLen() Returns the maxCodeLen. | public boolean | isDoubleMetaphoneEqual(String value1, String value2) Check if the Double Metaphone values of two String values
are equal.
Parameters: value1 - The left-hand side of the encoded String.equals(Object). Parameters: value2 - The right-hand side of the encoded String.equals(Object). | 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.
Parameters: value1 - The left-hand side of the encoded String.equals(Object). Parameters: value2 - The right-hand side of the encoded String.equals(Object). Parameters: alternate - use the alternate value if true . | public void | setMaxCodeLen(int maxCodeLen) Sets the maxCodeLen. |
maxCodeLen | protected int maxCodeLen(Code) | | Maximum length of an encoding, default is 4
|
DoubleMetaphone | public DoubleMetaphone()(Code) | | Creates an instance of this DoubleMetaphone encoder
|
charAt | protected char charAt(String value, int index)(Code) | | Gets the character at index index if available, otherwise
it returns Character.MIN_VALUE so that there is some sort
of a default
|
contains | protected static boolean contains(String value, int start, int length, String[] criteria)(Code) | | Determines whether value contains any of the criteria
starting
at index start and matching up to length length
|
doubleMetaphone | public String doubleMetaphone(String value)(Code) | | Encode a value with Double Metaphone
Parameters: value - String to encode an encoded string |
doubleMetaphone | public String doubleMetaphone(String value, boolean alternate)(Code) | | Encode a value with Double Metaphone, optionally using the alternate
encoding.
Parameters: value - String to encode Parameters: alternate - use alternate encode an encoded string |
encode | public Object encode(Object obj) throws EncoderException(Code) | | Encode the value using DoubleMetaphone. It will only work if
obj is a String (like Metaphone ).
Parameters: obj - Object to encode (should be of type String) An encoded Object (will be of type String) throws: EncoderException - encode parameter is not of type String |
encode | public String encode(String value)(Code) | | Encode the value using DoubleMetaphone.
Parameters: value - String to encode An encoded String |
getMaxCodeLen | public int getMaxCodeLen()(Code) | | Returns the maxCodeLen.
int |
isDoubleMetaphoneEqual | public boolean isDoubleMetaphoneEqual(String value1, String value2, boolean alternate)(Code) | | Check if the Double Metaphone values of two String values
are equal, optionally using the alternate value.
Parameters: value1 - The left-hand side of the encoded String.equals(Object). Parameters: value2 - The right-hand side of the encoded String.equals(Object). Parameters: alternate - use the alternate value if true . true if the encoded String s are equal;false otherwise. |
setMaxCodeLen | public void setMaxCodeLen(int maxCodeLen)(Code) | | Sets the maxCodeLen.
Parameters: maxCodeLen - The maxCodeLen to set |
|
|