HunspellDictionary Class

A dictionary for the Hunspell spell checking algorithm.

Namespace: DevExpress.XtraSpellChecker

Assembly: DevExpress.SpellChecker.v20.1.Core.dll

Declaration

public class HunspellDictionary :
    DictionaryBase,
    ICloseWordsCalculatorFactory
Public Class HunspellDictionary
    Inherits DictionaryBase
    Implements ICloseWordsCalculatorFactory

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.

Examples

The following code demonstrates how to create the HunspellDictionary dictionary at runtime.

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);

Inheritance

Object
DictionaryBase
HunspellDictionary
See Also