|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.api.MatchingRule<ApproximateMatchingRuleCfg>
org.opends.server.api.ApproximateMatchingRule
org.opends.server.schema.DoubleMetaphoneApproximateMatchingRule
public class DoubleMetaphoneApproximateMatchingRule
This class defines an approximate matching rule based on the Double Metaphone algorithm. The Metaphone and Double Metaphone algorithms were originally devised by Lawrence Philips (published in the December 1990 issue of Computer Language and the June 2000 issue of C/C++ Users Journal, respectively), and this version of the algorithm is based on a version modified by Kevin Atkinson to include bugfixes and additional functionality (source is available here and additional Metaphone and Double Metaphone information is available at http://aspell.net/metaphone/). This implementation is largely the same as the one provided by Kevin Atkinson, but it has been re-written for better readability, for more efficiency, to get rid of checks for conditions that can't possibly happen, and to get rid of redundant checks that aren't needed. It has also been updated to always only generate a single value rather than one or possibly two values.
| Constructor Summary | |
|---|---|
DoubleMetaphoneApproximateMatchingRule()
Creates a new instance of this double metaphone approximate matching rule. |
|
| Method Summary | |
|---|---|
boolean |
approximatelyMatch(ByteString value1,
ByteString value2)
Indicates whether the two provided normalized values are approximately equal to each other. |
java.lang.String |
getDescription()
Retrieves the description for this matching rule. |
java.lang.String |
getName()
Retrieves the common name for this matching rule. |
java.lang.String |
getOID()
Retrieves the OID for this matching rule. |
java.lang.String |
getSyntaxOID()
Retrieves the OID of the syntax with which this matching rule is associated. |
void |
initializeMatchingRule(ApproximateMatchingRuleCfg configuration)
Initializes this matching rule based on the information in the provided configuration entry. |
ByteString |
normalizeValue(ByteString value)
Retrieves the normalized form of the provided value, which is best suited for efficiently performing matching operations on that value. |
| Methods inherited from class org.opends.server.api.ApproximateMatchingRule |
|---|
valuesMatch |
| Methods inherited from class org.opends.server.api.MatchingRule |
|---|
equals, finalizeMatchingRule, getNameOrOID, hashCode, isConfigurationAcceptable, isObsolete, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DoubleMetaphoneApproximateMatchingRule()
| Method Detail |
|---|
public void initializeMatchingRule(ApproximateMatchingRuleCfg configuration)
throws ConfigException,
InitializationException
initializeMatchingRule in class MatchingRule<ApproximateMatchingRuleCfg>configuration - The configuration to use to intialize this
matching rule.
ConfigException - If an unrecoverable problem arises in
the process of performing the
initialization.
InitializationException - If a problem that is not
configuration-related occurs
during initialization.public java.lang.String getName()
getName in class MatchingRule<ApproximateMatchingRuleCfg>null if
it does not have a name.public java.lang.String getOID()
getOID in class MatchingRule<ApproximateMatchingRuleCfg>public java.lang.String getDescription()
getDescription in class MatchingRule<ApproximateMatchingRuleCfg>null if
there is none.public java.lang.String getSyntaxOID()
getSyntaxOID in class MatchingRule<ApproximateMatchingRuleCfg>
public ByteString normalizeValue(ByteString value)
throws DirectoryException
normalizeValue in class MatchingRule<ApproximateMatchingRuleCfg>value - The value to be normalized.
DirectoryException - If the provided value is invalid according to
the associated attribute syntax.
public boolean approximatelyMatch(ByteString value1,
ByteString value2)
approximatelyMatch in class ApproximateMatchingRulevalue1 - The normalized form of the first value to compare.value2 - The normalized form of the second value to compare.
true if the provided values are approximately equal,
or false if not.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||