0

I have searched for this topic before and all the existing answers in stackoverflow have issues with the Standard analyzer. Could anybody please share a standalone code that uses the Spellchecker class for coming up with DID YOU MEAN RESULTS

  • Can you share some of your code or how you want to implement the SpellChecker? Otherwise you might not get any useful answers. – Juan Carlos Farah Feb 27 '15 at 21:16
  • Thanks for your reply. I am not looking to implement a SOLR search engine . . I want the code to read from a dictionary file from a local directory and recommend me possible candidates for correct spelling within 2 edit distances. Very importantly i want it to implement leveinstein rule and use a dynamic algorithm that does not have a high run time. I hope that is some what more clear? – Karthik Feb 27 '15 at 22:33
  • That sounds good. You might want to include that in your question for clarity. – Juan Carlos Farah Feb 27 '15 at 22:34
  • SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt"))); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); – Karthik Feb 27 '15 at 23:26
  • I am trying to use this code i found in apache lucene documentation http://lucene.apache.org/core/4_10_0/suggest/org/apache/lucene/search/spell/SpellChecker.html But looks like the plainTextDictionary class has a different initialization evn when i download the 4_10_0 core and suggest jars for lucene. I get the following error:The method indexDictionary(Dictionary, IndexWriterConfig, boolean) in the type SpellChecker is not applicable for the arguments (PlainTextDictionary) – Karthik Feb 27 '15 at 23:34

0 Answers0