lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Moiz Chinoy <>
Subject Lucene - Spell Check...
Date Tue, 14 Jul 2009 11:28:10 GMT
Hi all,

I am new to lucene and trying the spell checker in contrib\spellchecker.

The problem is that if I enter a wrong word it gives me the correct
suggestion but if I enter the correct word, lucene gives me alternate

For e.g.
I have "tour" and "tours" both in the text. If I enter "tors", it
gives me "tours". Now if I enter "tour" it gives me "tours" and if I
enter "tours" it gives me "tour".

Below is the code snippet:

SpellChecker spellchecker = new
spellchecker.indexDictionary(new LuceneDictionary(reader, "contents"));
String[] suggestions = spellchecker.suggestSimilar("tour", 5);

I am using StandardAnalyzer while indexing and searching.
Lucene Version: 2.4.1

Moiz Chinoy.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message