TX Spell .NET for Windows Forms

Installing Dictionaries and Language Data

Topic

TX Spell .NET reads its language data from files: dictionaries for spell checking, hyphenation lists, thesaurus files and the data for language detection. US English comes with the packages and the setup, and every other language is a download. Where the files are decides whether the spell checker finds them, on your development machine and on the machines of your users.

The Four Folders

FolderHoldsUsed forProperty
DictionariesHunspell dictionaries (.dic and .aff) and user dictionaries (.txd)Spell checking and suggestionsDictionariesDirectoryPath
HyphenationListsHunspell hyphenation lists (hyph_*.dic)HyphenationHyphenationListsDirectoryPath
SynonymListsThesaurus files (.dat and .idx)SynonymsSynonymListsDirectoryPath
LanguageRecognitionlanguageRecognition.resourcesLanguage detectionLanguageRecognitionDirectoryPath

The spell checker uses the files in these folders automatically.

What You Get Out of the Box

  • .NET projects. The TX Spell .NET packages contain the US English files of all four folders and copy them into the output folder when you build: en_US.dic and en_US.aff, hyph_en_US.dic, th_en_US_v2.dat and th_en_US_v2.idx, and languageRecognition.resources.
  • .NET Framework projects. The setup installs the same files in the four folders below the Assembly folder of the installation.

With either, English text is checked, hyphenated and given synonyms without any setup.

Where the Spell Checker Looks

The four folder properties in the table above are "(Auto)" by default. "(Auto)" means:

  1. The folder of that name next to the application, such as Dictionaries in the output folder.
  2. On the development machine, the folder of that name below the Assembly folder of the TX Spell .NET installation.

To keep the files elsewhere, for example in a folder shared by several applications, set the property to that folder:

txSpellChecker1.DictionariesDirectoryPath = @"C:\Data\Dictionaries";
txSpellChecker1.SynonymListsDirectoryPath = @"C:\Data\SynonymLists";

Set the properties before the first check. The TXSpell class, which checks text without a user interface, has the same four properties. When a folder can't be found, the spell checker throws an exception; Dictionaries Not Found lists the causes. Loading and Managing Dictionaries shows how the spell checker then chooses among the dictionaries it finds.

Add Other Languages

Text Control offers tested dictionaries, hyphenation lists and thesaurus files for about 40 languages on the dictionary download page of TX Spell .NET for Windows Forms. No sign-in is needed:

The Download Dictionaries page of TX Spell .NET for Windows Forms, with the note that it is compatible with Hunspell dictionary, hyphenation and thesaurus files, and the Afrikaans entry expanded with its file South Africa.

Each language opens a list of files per region:

The German entry of the dictionary download page expanded, with the files Austria, Germany and Switzerland, each 9.4 MB.

  1. Download the file of the language and region.
  2. Unzip it. The archive contains a folder named after the locale, such as tx_spell_dictionary.de_DE, with the folders Dictionaries, HyphenationLists and SynonymLists, as far as the language has them.
  3. In a .NET project, add the files to folders of the same names in the project and set their Copy to Output Directory property, so that every build copies them next to the packaged English files.
  4. In a .NET Framework project, copy the files into the folders below the Assembly folder of the installation while you develop, and ship them with the application.

Hunspell and OpenOffice Dictionaries describes the archives, the file names and the licenses of the dictionaries.

Ship the Language Data

The application needs its language data folders on the user's machine: with the NuGet packages, Publish copies them; without them, you copy the four folders next to the executable. The Deployment Guide covers deployment in full, and Check the License of Each Dictionary the licenses of the files you ship.

Next Steps