lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Moiz Chinoy <moizchi...@gmail.com>
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
suggestion.

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(FSDirectory.getDirectory("index1"));
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

-- 
Regards,
Moiz Chinoy.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message