20 jan 2007 kl. 14.51 skrev saikrishna venkata pendyala:

Hai all,
        This is what I did.
        """
        IndexReader reader = IndexReader.open("index");
        //static final File INDEX_DIR = new File("index");
        Directory directory = new RAMDirectory(index);
        SpellChecker spellchecker = new SpellChecker(directory);
        // To index a field of a user index:
        spellchecker.indexDictionary(new
LuceneDictionary(reader,"content"));
String[] suggestions = spellchecker.suggestSimilar ("fredom", 5);
        """

The problem with above code is every time I run the code it is indexing text
in "content" field.
                      {
spellchecker.indexDictionary(newLuceneDictionary(reader,"content"));
}
Is there any way I could save the spell checker index and use it straight
away.

You can use an FSDirectory instead of a RAMDirectory? It is simple to load an FSDirectory to a RAMDirectory and vice verse if that is something you need.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to