Example usage for org.apache.lucene.search.spell LevenshteinDistance LevenshteinDistance

List of usage examples for org.apache.lucene.search.spell LevenshteinDistance LevenshteinDistance

Introduction

In this page you can find the example usage for org.apache.lucene.search.spell LevenshteinDistance LevenshteinDistance.

Prototype

public LevenshteinDistance() 

Source Link

Document

Optimized to run a bit faster than the static getDistance().

Usage

From source file:com.ostrichemulators.semtool.rdf.engine.util.EngineConsistencyCheckerTest.java

@Before
public void setUp() {
    ecc = new EngineConsistencyChecker(engine, false, new LevenshteinDistance());
}

From source file:com.ostrichemulators.semtool.ui.components.CheckConsistencyPanel.java

public CheckConsistencyPanel() {
    initComponents();/*w  ww  . jav  a  2  s.co m*/
    conceptList.setCellRenderer(crenderer);
    relationList.setCellRenderer(rrenderer);
    LabeledPairRenderer<StringDistance> arend = new LabeledPairRenderer<>();
    algorithm.setRenderer(arend);

    Map<StringDistance, String> dists = new LinkedHashMap<>();
    dists.put(new LevenshteinDistance(), "Levenstein");
    dists.put(new DoubleMetaphoneDistance(), "Double Metaphone");
    dists.put(new MetaphoneDistance(), "Metaphone");
    dists.put(new SoundexDistance(), "Soundex");
    arend.cache(dists);

    for (StringDistance s : dists.keySet()) {
        algorithm.addItem(s);
    }
}