CreateSynonyms Method
- Namespace
TXTextControl.Proofing
- Package
TXTextControl.asTXSpell. WinForms. SDK TXSpell.from the private NuGet feed or Text Control Offline Packagesdll
- Also in
TXTextControl.asTXSpell. Core. SDK 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);Public Function CreateSynonyms(text As String) As SynonymGroup()| Parameter | Description |
|---|---|
| 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);Public Function CreateSynonyms(text As String, language As CultureInfo) As SynonymGroup()| Parameter | Description |
|---|---|
| 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);Public Function CreateSynonyms(text As String, synonymList As SynonymList) As SynonymGroup()| Parameter | Description |
|---|---|
| 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);
}Dim results As TXTextControl.Proofing.SynonymGroup() = tXSpell.CreateSynonyms("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"))
For Each synonymGroup As TXTextControl.Proofing.SynonymGroup In results
Console.WriteLine(synonymGroup)
Next