You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Salem <ch...@mainsequence.net> on 2006/09/26 22:56:57 UTC
spell checker
Does anyone have sample code on how to build a dictionary?
I found this article online and but it uses version 1.4.3 and it doesn't seem to work on 2.0.0: http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1
Here's the code I have:
indexReader = IndexReader.open(originalIndexDirectory);
Dictionary dictionary = new LuceneDictionary(indexReader, "experience_desired");
SpellChecker spellChckr = new SpellChecker(spellIndexDirectory);
spellChckr.indexDictionary(dictionary);
I'm getting a null pointer exception when I call indexDirectory().
Here's how I index the field "experience_desired":
doc.add(new Field("experience_desired", value, Field.Store.NO, Field.Index.TOKENIZED));
Is there another way I should do it so there is a way to build a dictionary on that field?
Thanks
Chris Salem
440.946.5214 x5458
chris@mainsequence.net
(The following links were included with this email:)
http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1
mailto:chris@mainsequence.net
(The following links were included with this email:)
http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1
mailto:chris@mainsequence.net