Dictionary represented by a text file. Format allowed: 1 word per line: word1 word2 word3
Inheritance: IDictionary
 public void TestBuild()
 {
     string LF = Environment.NewLine;
     string input = "oneword" + LF + "twoword" + LF + "threeword";
     PlainTextDictionary ptd = new PlainTextDictionary(new StringReader(input));
     Store.Directory ramDir = NewDirectory();
     SpellChecker spellChecker = new SpellChecker(ramDir);
     spellChecker.IndexDictionary(ptd, NewIndexWriterConfig(TEST_VERSION_CURRENT, null), false);
     string[] similar = spellChecker.SuggestSimilar("treeword", 2);
     assertEquals(2, similar.Length);
     assertEquals(similar[0], "threeword");
     assertEquals(similar[1], "oneword");
     spellChecker.Dispose();
     ramDir.Dispose();
 }
 public FileIterator(PlainTextDictionary outerInstance)
 {
     this.outerInstance = outerInstance;
 }
示例#3
0
 public FileIterator(PlainTextDictionary outerInstance)
 {
     this.outerInstance = outerInstance;
 }