TX Spell .NET for Windows Forms

Dictionary and Language Examples

Topic

Dictionaries decide what TX Spell .NET for Windows Forms accepts as correct: the Hunspell dictionaries of each language, and user dictionaries with the words your users add. The same language data serves hyphenation, synonyms and the detection of the language a text is written in. The samples and articles below show how an application loads and manages this data.

Samples of the Setup

The setup installs these samples in C# and Visual Basic, below TX Spell 11.0.NET for Windows Forms\Samples\WinForms in your Documents folder:

ExampleWhat it showsWhere
User dictionaryA UserDictionary created or loaded from a file; with IsEditable set to true, a list box shows its words while they are added and removedUserDictionary
HyphenationA word typed in a text box, hyphenated with GetHyphenationPoints and the rules of a HyphenationList, such as the minimum number of characters at the beginning and the end of a wordHyphenation

No sample of the setup shows synonyms or language detection in a Windows Forms application; the Web API below does both.

GitHub Samples

Two repositories on GitHub work with language data: the spell checking Web API, an ASP.NET Core Web API on the TXSpell class that also creates synonyms with CreateSynonyms and detects languages with DetectLanguageScopes, and user dictionaries loaded into and saved from the Document Editor of TX Text Control .NET Server. The Repositories describes both.

The class TXSpell is part of TX Spell .NET for Windows Forms as well, so the code of the Web API works in a Windows Forms application. The user dictionary sample needs TX Text Control .NET Server; TX Text Control .NET Server Document Editor describes spell checking in the editor.

Blog Articles With Code

These articles contain their code, without a repository. They were written for earlier versions of TX Spell .NET; check the members they use in the reference:

ExampleWhat it showsWhere
An ignore listA second user dictionary that users can't edit, used as a list of words to ignoreTX Spell .NET: Ignore Word List Using User Dictionaries
Dictionaries loaded on demandThe dictionary chosen by the culture at the input position and loaded from a shared locationLoading Dictionaries Dynamically in TX Spell .NET
Merged text in a user dictionaryThe text of merged fields added to a temporary user dictionary, so that names from a database aren't marked as misspelledSpell Checking, MailMerge and UserDictionaries
Dictionaries from embedded resourcesAn OpenOfficeDictionary created from the lines of a dictionary and affix file stored as resources in the assemblyTX Spell .NET 3.0: Loading Dictionaries from Embedded Resources
Hunspell dictionaries from OpenOfficeThe .dic and .aff files taken from an OpenOffice extensionUsing Hunspell Dictionaries from OpenOffice.org in TX Spell .NET

Next Steps