TX Spell .NET for Windows Forms

CreateSuggestions Method

Method
Namespace
TXTextControl.Proofing
Package
TXTextControl.TXSpell.WinForms.SDK as TXSpell.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and fills the results into the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is set, all created suggestions are added to TXSpellChecker.Suggestions. Otherwise, only the first maximum number of suggestions are determined. The second and fourth implementation uses selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used where the Dictionary.IsGetSuggestionsEnabled property is set to true.

Syntax

CreateSuggestions(string)

Determines suggestions for a specific incorrect word.

public void CreateSuggestions(string incorrectWord);
ParameterDescription
incorrectWord

Specifies the incorrect word that has to be determined for suggestions.

CreateSuggestions(string, CultureInfo)

Determines suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

public void CreateSuggestions(string incorrectWord, CultureInfo language);
ParameterDescription
incorrectWord

Specifies the incorrect word that has to be determined for suggestions.

language

The language that is used to create suggestions for the specified incorrect word.

CreateSuggestions(string, int)

Determines a maximum number of suggestions for a specific incorrect word.

public void CreateSuggestions(string incorrectWord, int max);
ParameterDescription
incorrectWord

Specifies the incorrect word that has to be determined for suggestions.

max

Specifies the maximum number of suggestions that has to be determined.

CreateSuggestions(string, int, CultureInfo)

Determines a maximum number of suggestions for a specific incorrect word using selected dictionaries of the TXSpell.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.

public void CreateSuggestions(string incorrectWord, int max, CultureInfo language);
ParameterDescription
incorrectWord

Specifies the incorrect word that has to be determined for suggestions.

max

Specifies the maximum number of suggestions that has to be determined.

language

The language that is used to create suggestions for the specified incorrect word.

Examples

The following example uses Create Suggestions in a focused TXSpell Checker workflow. The created object is then available to the surrounding document workflow.

tXSpellChecker.CreateSuggestions("Quarterly report", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine("TXSpell Checker is ready for use.");