From fa56dc64651c2968b97847e7689336fc258ee967 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 20 Nov 2006 18:04:42 +0000
Subject: [PATCH] Update the double metaphone approximate matching rule implementation to fix a bug in which "TH" was incorrectly mapped to a capital letter "O" (oh) instead of the number "0" (zero).

---
 opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java          |    4 ++--
 opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java b/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java
index c64a07a..50acb91 100644
--- a/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java
+++ b/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java
@@ -1025,7 +1025,7 @@
 
 
           // TH or TTH  will be mapped to either T (for Germanic cases) or
-          // O for the rest.
+          // 0 (zero) for the rest.
           if (((posPlusOne = valueString.charAt(pos+1)) == 'H') ||
               ((posPlusOne == 'T') && (valueString.charAt(pos+2) == 'H')))
           {
@@ -1037,7 +1037,7 @@
             }
             else
             {
-              metaphone.append("O");
+              metaphone.append("0");
             }
 
             pos += 2;
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java
index 3fc113f..e10ebd1 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java
@@ -102,7 +102,7 @@
         {"DoubleMetaphoneApproximateMatchingRule", "odd", "ot", true},
         {"DoubleMetaphoneApproximateMatchingRule", "edgar", "etkar", true},
         {"DoubleMetaphoneApproximateMatchingRule", "edge", "eje", true},
-        {"DoubleMetaphoneApproximateMatchingRule", "accord", "akord", true},     
+        {"DoubleMetaphoneApproximateMatchingRule", "accord", "akord", true},
         {"DoubleMetaphoneApproximateMatchingRule", "noize", "noise", true},
         {"DoubleMetaphoneApproximateMatchingRule", "orchid", "orkid", true},
         {"DoubleMetaphoneApproximateMatchingRule", "chemistry", "kemistry", true},
@@ -124,7 +124,9 @@
         {"DoubleMetaphoneApproximateMatchingRule", "bouteille", "butaille", true},
         {"DoubleMetaphoneApproximateMatchingRule", "xeon", "zeon", true},
         {"DoubleMetaphoneApproximateMatchingRule", "achtung", "aktung", true},
-        {"DoubleMetaphoneApproximateMatchingRule", "", "", true},      
+        {"DoubleMetaphoneApproximateMatchingRule", "throttle", "throddle", true},
+        {"DoubleMetaphoneApproximateMatchingRule", "thimble", "thimblle", true},
+        {"DoubleMetaphoneApproximateMatchingRule", "", "", true},
     };
   }
 

--
Gitblit v1.10.0