mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
20.04.2006 fa56dc64651c2968b97847e7689336fc258ee967
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).

This fix was provided by Terry Sigle (username tsigle).

OpenDS Issue Number: 690
2 files modified
10 ■■■■■ changed files
opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java 4 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java 6 ●●●●● patch | view | raw | blame | history
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;
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},
    };
  }