mirror of https://github.com/apache/lucene.git
- 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
This commit is contained in:
parent
ce19aa28c0
commit
8b11f3b077
|
@ -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 () {
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ public class SpellChecker {
|
|||
}
|
||||
|
||||
public SpellChecker(Directory spellIndex) throws IOException {
|
||||
this(spellIndex,new TRStringDistance());
|
||||
this(spellIndex, new LevensteinDistance());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue