Method SuggestSimilar
SuggestSimilar(String, Int32)
Suggest similar words.
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.
Declaration
public virtual string[] SuggestSimilar(string word, int numSug)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | the word you want a spell check done on |
System.Int32 | numSug | the number of suggested words |
Returns
Type | Description |
---|---|
System.String[] | string[] the sorted list of the suggest words with these 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 |
See Also
SuggestSimilar(String, Int32, Single)
Suggest similar words.
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.
Declaration
public virtual string[] SuggestSimilar(string word, int numSug, float accuracy)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | the word you want a spell check done on |
System.Int32 | numSug | the number of suggested words |
System.Single | accuracy | The minimum score a suggestion must have in order to qualify for inclusion in the results |
Returns
Type | Description |
---|---|
System.String[] | string[] the sorted list of the suggest words with these 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 |
See Also
SuggestSimilar(String, Int32, IndexReader, String, SuggestMode)
Calls SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single) SuggestSimilar(word, numSug, ir, suggestMode, field, this.accuracy)
Declaration
public virtual string[] SuggestSimilar(string word, int numSug, IndexReader ir, string field, SuggestMode suggestMode)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | |
System.Int32 | numSug | |
IndexReader | ir | |
System.String | field | |
SuggestMode | suggestMode |
Returns
Type | Description |
---|---|
System.String[] |
SuggestSimilar(String, Int32, IndexReader, String, SuggestMode, Single)
Suggest similar words (optionally restricted to a field of an index).
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.
Declaration
public virtual string[] SuggestSimilar(string word, int numSug, IndexReader ir, string field, SuggestMode suggestMode, float accuracy)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | the word you want a spell check done on |
System.Int32 | numSug | the number of suggested words |
IndexReader | ir | the indexReader of the user index (can be null see field param) |
System.String | field | the field of the user index: if field is not null, the suggested words are restricted to the words present in this field. |
SuggestMode | suggestMode | (NOTE: if indexReader==null and/or field==null, then this is overridden with SuggestMode.SUGGEST_ALWAYS) |
System.Single | accuracy | The minimum score a suggestion must have in order to qualify for inclusion in the results |
Returns
Type | Description |
---|---|
System.String[] | string[] the sorted list of the suggest words with these 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 |