As the Lucene similarity that is used to fetch the most relevant n-grammed terms is not the same as the edit distance strategy used to calculate the best matching spell-checked word from the hits that Lucene found, one usually has to retrieve a couple of numSug's in order to get the true best match.
I.e. if numSug == 1, don't count on that suggestion being the best one. Thus, you should set this value to at least 5 for a good suggestion. @param word the word you want a spell check done on @param numSug the number of suggested words @throws IOException if the underlying index throws an {@link IOException} @throws AlreadyClosedException if the Spellchecker is already closed @return String[] @see #suggestSimilar(String,int,org.apache.lucene.index.IndexReader,String,boolean,float)
|
|
|
|