Date: 2004-10-11T10:27:08 Editor: NicolasMaisonneuve <[EMAIL PROTECTED]> Wiki: Jakarta Lucene Wiki Page: SpellChecker URL: http://wiki.apache.org/jakarta-lucene/SpellChecker
no comment Change Log: ------------------------------------------------------------------------------ @@ -1,6 +1,8 @@ -SpellChecker +===SpellChecker=== -a Spell Checker allow to suggest a list of words close to a misspelled word. This implementation use the n-gram technic and the levensthein distance. +a Spell Checker allow to suggest a list of words close to a misspelled word. This implementation is based on the David Spencer code using the n-gram technic and the levensthein distance. + +==Structure of a dictionary index == A Index (the dictionary) with all the possible words (a lucene index) must be created. The structure of this index is (for a 3-4 gram): word: gram3: @@ -14,9 +16,12 @@ it's independant of the user index. So we can add words becoming to several fields of several index for example or, why not, to a file with a list of words. -source: +we can add all the keywords of a specific field of your index. +code: -SpellChecker spellChecker= new SpellChecker(); +SpellChecker spell= new SpellChecker(dictionaryDirectory); + +spell.addWords(myIndex_Reader, myField) The suggestSimilar method return a list of suggests word sorted by the --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]