From 8b11f3b077b3ea89a1afbe13bf58c104083aa7e3 Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Wed, 18 Jun 2008 05:09:11 +0000 Subject: [PATCH] - Renamed TRStringDistance to LevensteinDistance (related to LUCENE-1297) git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@669086 13f79535-47bb-0310-9956-ffa450edef68 --- .../spell/{TRStringDistance.java => LevensteinDistance.java} | 4 ++-- .../src/java/org/apache/lucene/search/spell/SpellChecker.java | 2 +- .../apache/lucene/search/spell/TestLevenshteinDistance.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename contrib/spellchecker/src/java/org/apache/lucene/search/spell/{TRStringDistance.java => LevensteinDistance.java} (97%) diff --git a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/TRStringDistance.java b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LevensteinDistance.java similarity index 97% rename from contrib/spellchecker/src/java/org/apache/lucene/search/spell/TRStringDistance.java rename to contrib/spellchecker/src/java/org/apache/lucene/search/spell/LevensteinDistance.java index 58faf372c32..c646089a93e 100755 --- a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/TRStringDistance.java +++ b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/LevensteinDistance.java @@ -20,13 +20,13 @@ package org.apache.lucene.search.spell; /** * Levenshtein edit distance class. */ -final class TRStringDistance implements StringDistance { +final class LevensteinDistance implements StringDistance { /** * Optimized to run a bit faster than the static getDistance(). * In one benchmark times were 5.3sec using ctr vs 8.5sec w/ static method, thus 37% faster. */ - public TRStringDistance () { + public LevensteinDistance () { } diff --git a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java index 14a50848a88..6c789e65c11 100755 --- a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java +++ b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java @@ -92,7 +92,7 @@ public class SpellChecker { } public SpellChecker(Directory spellIndex) throws IOException { - this(spellIndex,new TRStringDistance()); + this(spellIndex, new LevensteinDistance()); } /** diff --git a/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java b/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java index 47a009256dd..695e3ee8142 100644 --- a/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java +++ b/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLevenshteinDistance.java @@ -21,7 +21,7 @@ import junit.framework.TestCase; public class TestLevenshteinDistance extends TestCase { - private StringDistance sd = new TRStringDistance(); + private StringDistance sd = new LevensteinDistance(); public void testGetDistance() { float d = sd.getDistance("al", "al"); @@ -46,4 +46,4 @@ public class TestLevenshteinDistance extends TestCase { assertTrue(d1 > d2); } -} \ No newline at end of file +}