Method SuggestSimilar
SuggestSimilar(Term, Int32, IndexReader)
Calls SuggestSimilar(Term, Int32, IndexReader, SuggestMode) SuggestSimilar(term, numSug, ir, SuggestMode.SUGGEST_WHEN_NOT_IN_INDEX)
Declaration
public virtual SuggestWord[] SuggestSimilar(Term term, int numSug, IndexReader ir)
Parameters
Type | Name | Description |
---|---|---|
Term | term | |
System.Int32 | numSug | |
IndexReader | ir |
Returns
Type | Description |
---|---|
SuggestWord[] |
SuggestSimilar(Term, Int32, IndexReader, SuggestMode)
Calls SuggestSimilar(Term, Int32, IndexReader, SuggestMode, Single) SuggestSimilar(term, numSug, ir, suggestMode, this.accuracy)
Declaration
public virtual SuggestWord[] SuggestSimilar(Term term, int numSug, IndexReader ir, SuggestMode suggestMode)
Parameters
Type | Name | Description |
---|---|---|
Term | term | |
System.Int32 | numSug | |
IndexReader | ir | |
SuggestMode | suggestMode |
Returns
Type | Description |
---|---|
SuggestWord[] |
SuggestSimilar(Term, Int32, IndexReader, SuggestMode, Single)
Suggest similar words.
Unlike SpellChecker, the similarity used to fetch the most relevant terms is an edit distance, therefore typically a low value for numSug will work very well.
Declaration
public virtual SuggestWord[] SuggestSimilar(Term term, int numSug, IndexReader ir, SuggestMode suggestMode, float accuracy)
Parameters
Type | Name | Description |
---|---|---|
Term | term | Term you want to spell check on |
System.Int32 | numSug | the maximum number of suggested words |
IndexReader | ir | IndexReader to find terms from |
SuggestMode | suggestMode | specifies when to return suggested words |
System.Single | accuracy | return only suggested words that match with this similarity |
Returns
Type | Description |
---|---|
SuggestWord[] | sorted list of the suggested words according to the comparer |
SuggestSimilar(Term, Int32, IndexReader, Int32, Int32, Single, CharsRef)
Provide spelling corrections based on several parameters.
Declaration
protected virtual IEnumerable<DirectSpellChecker.ScoreTerm> SuggestSimilar(Term term, int numSug, IndexReader ir, int docfreq, int editDistance, float accuracy, CharsRef spare)
Parameters
Type | Name | Description |
---|---|---|
Term | term | The term to suggest spelling corrections for |
System.Int32 | numSug | The maximum number of spelling corrections |
IndexReader | ir | The index reader to fetch the candidate spelling corrections from |
System.Int32 | docfreq | The minimum document frequency a potential suggestion need to have in order to be included |
System.Int32 | editDistance | The maximum edit distance candidates are allowed to have |
System.Single | accuracy | The minimum accuracy a suggested spelling correction needs to have in order to be included |
CharsRef | spare | a chars scratch |
Returns
Type | Description |
---|---|
IEnumerable<DirectSpellChecker.ScoreTerm> | a collection of spelling corrections sorted by 's natural order.
|