TX Spell .NET for Windows Forms

CreateSynonyms Method

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

Description

Returns groups of synonyms that represent equivalent expressions for a specific text. The first implementation uses selected synonym lists of the SynonymListCollection at TXSpellChecker.SynonymLists. The second implementation uses selected synonym lists of the TXSpellChecker.SynonymLists collection and the default synonym lists folder where the synonym list's language equals to the defined language parameter. The last overload creates synonym groups for a specific synonym list. Only those synonym lists are used whose SynonymList.IsCreateSynonymsEnabled properties are set to true.

Syntax

CreateSynonyms(string)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists.

public SynonymGroup[] CreateSynonyms(string text);
ParameterDescription
text

Specifies the text that has to be determined for synonyms.

CreateSynonyms(string, CultureInfo)

Returns synonyms for a specific text using the selected synonym lists of the SynonymListCollection at the TXSpellChecker.SynonymLists and the default synonym lists folder where the synonym list's language equals to the defined language parameter.

public SynonymGroup[] CreateSynonyms(string text, CultureInfo language);
ParameterDescription
text

Specifies the text that has to be determined for synonyms.

language

The language that is used to create synonyms for the specified text.

CreateSynonyms(string, SynonymList)

Returns synonyms for a specific text using a specific SynonymList.

public SynonymGroup[] CreateSynonyms(string text, SynonymList synonymList);
ParameterDescription
text

Specifies the text that has to be determined for synonyms.

synonymList

The synonymList that is used to create synonyms for the specified text.

Examples

The following example uses Create Synonyms in a focused TXSpell Checker workflow.

TXTextControl.Proofing.SynonymGroup[] results = tXSpellChecker.CreateSynonyms("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
foreach (TXTextControl.Proofing.SynonymGroup synonymGroup in results)
{
    Console.WriteLine(synonymGroup);
}