mirror of https://github.com/apache/lucene.git
javadoc fixes
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@178880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
06bb3230ff
commit
fe52019614
|
@ -26,7 +26,7 @@ import org.apache.lucene.index.Term;
|
|||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Lucene Dictionnary
|
||||
* Lucene Dictionary
|
||||
*
|
||||
* @author Nicolas Maisonneuve
|
||||
*/
|
||||
|
|
|
@ -25,11 +25,12 @@ import java.io.*;
|
|||
|
||||
|
||||
/**
|
||||
* dictionary represented by a file text
|
||||
* Format allowed: 1 word per line:
|
||||
* word1
|
||||
* word2
|
||||
* word3
|
||||
* Dictionary represented by a file text.
|
||||
*
|
||||
* <p>Format allowed: 1 word per line:<br>
|
||||
* word1<br>
|
||||
* word2<br>
|
||||
* word3<br>
|
||||
*
|
||||
* @author Nicolas Maisonneuve
|
||||
*/
|
||||
|
|
|
@ -42,15 +42,16 @@ import java.util.*;
|
|||
* (initially inspired by the David Spencer code).
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Spell Checker spellchecker= new SpellChecker (spellDirectory);<br/>
|
||||
* <br/>
|
||||
* //To index a field of a user index <br/>
|
||||
* spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field));<br/>
|
||||
*<br/>
|
||||
* //To index a file containing words <br/>
|
||||
* spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")));<br/>
|
||||
*</p>
|
||||
* <p>Example Usage:
|
||||
*
|
||||
* <pre>
|
||||
* SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
|
||||
* // To index a field of a user index:
|
||||
* spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field));
|
||||
* // To index a file containing words:
|
||||
* spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")));
|
||||
* String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
|
||||
* </pre>
|
||||
*
|
||||
* @author Nicolas Maisonneuve
|
||||
* @version 1.0
|
||||
|
@ -83,8 +84,7 @@ public class SpellChecker {
|
|||
|
||||
|
||||
/**
|
||||
* Set the accuraty 0<min<1 default 0.5
|
||||
* @param min float
|
||||
* Set the accuracy 0 < min < 1; default 0.5
|
||||
*/
|
||||
public void setAccuraty (float min) {
|
||||
this.min=min;
|
||||
|
@ -109,17 +109,17 @@ public class SpellChecker {
|
|||
|
||||
|
||||
/**
|
||||
* Suggest similar words (restricted or not of a field of a user index)
|
||||
* Suggest similar words (restricted or not to a field of a user index)
|
||||
* @param word String the word you want a spell check done on
|
||||
* @param num_sug int the number of suggest words
|
||||
* @param ir the indexReader of the user index (can be null see field param)
|
||||
* @param field String the field of the user index: if field is not null ,the suggest
|
||||
* @param field String the field of the user index: if field is not null, the suggested
|
||||
* words are restricted to the words present in this field.
|
||||
* @param morePopular boolean return only the suggest words that are more frequent than the searched word
|
||||
* (only if restricted mode = (indexReader!=null and field!=null)
|
||||
* @throws IOException
|
||||
* @return String[] the sorted list of the suggest words with this 2 criteri
|
||||
* first criteria : the edit distance, second criteria (only if restricted mode): the popularity
|
||||
* @return String[] the sorted list of the suggest words with this 2 criteria:
|
||||
* first criteria: the edit distance, second criteria (only if restricted mode): the popularity
|
||||
* of the suggest words in the field of the user index
|
||||
*/
|
||||
public String[] suggestSimilar (String word, int num_sug, IndexReader ir, String field
|
||||
|
@ -249,10 +249,10 @@ public class SpellChecker {
|
|||
|
||||
|
||||
/**
|
||||
* if the word exist in the index
|
||||
* Check whether the word exists in the index.
|
||||
* @param word String
|
||||
* @throws IOException
|
||||
* @return boolean
|
||||
* @return true iff the word exists in the index
|
||||
*/
|
||||
public boolean exist (String word) throws IOException {
|
||||
if (reader==null) {
|
||||
|
@ -319,7 +319,6 @@ public class SpellChecker {
|
|||
return 3;
|
||||
}
|
||||
return 2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ package org.apache.lucene.search.spell;
|
|||
*/
|
||||
|
||||
/**
|
||||
* SuggestWord Class
|
||||
* used in suggestSimilat method in SpellChecker class
|
||||
* SuggestWord Class, used in suggestSimilar method in SpellChecker class.
|
||||
*
|
||||
* @author Nicolas Maisonneuve
|
||||
*/
|
||||
final class SuggestWord {
|
||||
|
|
Loading…
Reference in New Issue