Details
-
Bug
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
6.6.1
-
None
-
None
-
New, Patch Available
Description
Hello, in Lucene javadoc for SpellChecker class there is an example of how to use it, however it's incorrect (wrong method signature).
File: lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
It should be:
SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); IndexWriterConfig config = new IndexWriterConfig(); spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), config, true); spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), config, true); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
Instead of:
SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt"))); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
I'm in the middle of sending pull request on Github. Just wanted to create JIRA ticket so I can reference it in my pull request.
Attachments
Issue Links
- links to