Apache Lucene - Improving the results of Spell Checker
问题 I recently implemented a SpellChecker using Apache Lucene. My code is provided below: public void loadDictionary() { try { File dir = new File("c:/spellchecker/"); Directory directory = FSDirectory.open(dir); spellChecker = new SpellChecker(directory); Dictionary dictionary = new PlainTextDictionary(new File("c:/dictionary.txt")); IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, null); spellChecker.indexDictionary(dictionary, config, false); } catch (IOException e) { e