diff options
author | Rocky Madden <git@rockymadden.com> | 2012-10-15 16:43:41 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2012-10-15 16:43:41 -0600 |
commit | 929d2fea2affc40291adf6b1585c9ad1ad837a17 (patch) | |
tree | b5bfbc0428efd1e34f971ed7bd920131f607538c /core | |
parent | 7c281741232063f7df85bc2f9c07a93fc9adf044 (diff) | |
download | stringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.tar.gz stringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.tar.bz2 stringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.zip |
Fixed bug where require on variable p was incorrectly allowing values from o.last.
Diffstat (limited to 'core')
-rwxr-xr-x | core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala b/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala index b3033de..40de464 100755 --- a/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala +++ b/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala @@ -36,7 +36,7 @@ object SoundexMetric extends StringMetric { @tailrec def code(i: Array[Char], p: Char, o: Array[Char]): Array[Char] = { require(i.length > 0) - require((p >= 97 && p <= 122) || (p >= 49 && p <= 54)) + require(p >= 97 && p <= 122) require(o.length > 0) val c = i.head.toLower @@ -58,7 +58,6 @@ object SoundexMetric extends StringMetric { case 'r' if pc != '6' => '6' case _ => '\0' } - val a = p match { // Code twice. |