| | |
| | | public void initializeMatchingRule(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getName() |
| | | { |
| | | |
| | | return AMR_DOUBLE_METAPHONE_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getOID() |
| | | { |
| | | |
| | | return AMR_DOUBLE_METAPHONE_OID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getDescription() |
| | | { |
| | | |
| | | // There is no standard description for this matching rule. |
| | | return AMR_DOUBLE_METAPHONE_DESCRIPTION; |
| | | } |
| | |
| | | */ |
| | | public String getSyntaxOID() |
| | | { |
| | | |
| | | // Approximate matching is really only appropriate for DirectoryString |
| | | // values. |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | String valueString = value.stringValue(); |
| | | int length = valueString.length(); |
| | | if (length == 0) |
| | |
| | | */ |
| | | public boolean approximatelyMatch(ByteString value1, ByteString value2) |
| | | { |
| | | |
| | | // If the values have been normalized, then we just need to compare their |
| | | // byte arrays. |
| | | return Arrays.equals(value1.value(), value2.value()); |
| | |
| | | private boolean hasSubstring(String value, int start, |
| | | String substring) |
| | | { |
| | | |
| | | try |
| | | { |
| | | // This can happen since a lot of the rules "look behind" and |
| | |
| | | */ |
| | | private boolean isVowel(char c) |
| | | { |
| | | |
| | | switch (c) |
| | | { |
| | | case 'A': |
| | |
| | | */ |
| | | private boolean isSlavoGermanic(String s) |
| | | { |
| | | |
| | | return (s.contains("W") || s.contains("K") || s.contains("CZ") || |
| | | s.contains("WITZ")); |
| | | } |
| | |
| | | */ |
| | | private boolean isGermanic(String s) |
| | | { |
| | | |
| | | return (s.startsWith("VAN ") || s.startsWith("VON ") || |
| | | s.startsWith("SCH")); |
| | | } |