TX Spell .NET for Windows Forms

CreateSynonyms Method

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

Description

Returns groups of synonyms that represent equivalent expressions for a specific text. The first implementation uses selected synonym lists of the SynonymListCollection at TXSpell.SynonymLists. The second implementation uses selected synonym lists of the TXSpell.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 TXSpell.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 TXSpell.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 workflow.

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