HunspellDictionary Class
A dictionary for the Hunspell spell checking algorithm.
Namespace: DevExpress.XtraSpellChecker
Assembly: DevExpress.SpellChecker.v18.1.Core.dll
Declaration
Related API Members
The following members accept/return HunspellDictionary objects:
Remarks
A hunspell spell-checking dictionary instance is created by loading two files: a dictionary file and an affix file. The dictionary file, specified by the DictionaryBase.DictionaryPath property, contains only the root forms of words with information about morphological affix classes to combine with the roots. The affix file, specified by the HunspellDictionary.GrammarPath property, contains lists of affixes along with their context restrictions and effects. The affix file also serves as a settings file for the dictionary, containing all meta-data and settings.
The DictionaryBase.Load method is used to load Hunspell dictionary from files. You can load it from two streams containing dictionary and grammar data by using the HunspellDictionary.LoadFromStream method.
Note
We bear no responsibility for the content and availability of Hunspell dictionaries and affix files, since they are part of Hunspellproject (for more information visit the Hunspell web site.
Example
The following code demonstrates how to create the HunspellDictionary dictionary at runtime.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/spellchecker-an-example-of-use-e3372
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;
spellChecker1.Dictionaries.Clear();
HunspellDictionary hunspellDictionaryEnglish = new HunspellDictionary();
hunspellDictionaryEnglish.DictionaryPath = @"Dictionaries\Hunspell\en_US\en_US.dic";
hunspellDictionaryEnglish.GrammarPath = @"Dictionaries\Hunspell\en_US\en_US.aff";
hunspellDictionaryEnglish.Culture = new CultureInfo("en-US");
hunspellDictionaryEnglish.Load();
spellChecker1.Dictionaries.Add(hunspellDictionaryEnglish);
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the HunspellDictionary class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.