Dictionaries
- 3 minutes to read
DXSpellChecker supports five types of dictionaries:
- SpellCheckerDictionary, that is just a simple list of words;
- SpellCheckerISpellDictionary that has an ISpell project origin;
- SpellCheckerOpenOfficeDictionary that is part of the OpenOffice.org project;
- HunspellDictionary representing a dictionary that is part of the Hunspell project;
- SpellCheckerCustomDictionary representing a dictionary that can be extended by user additions.
For each dictionary, you should specify its SpellCheckerDictionaryBase.Culture and SpellCheckerDictionaryBase.Encoding. The ISpell and OpenOffice dictionaries require an affix file, located at the SpellCheckerISpellDictionary.GrammarPath. The need for the alphabet file is due to the method for generating suggestion lists. For more details, please refer to the SpellCheckerDictionaryBase.AlphabetPath topic.
The ISpell American English dictionary is included with the DXSpellChecker component by default. Since Silverlight technology restricts access to the local file system, use the LoadFromStream method for the dictionary of the required type to load data.
TIP
A complete sample project is available in the DevExpress Code Examples database at http://www.
#ISpell Dictionary
The SpellCheckerISpellDictionary instance is created by decompressing the base file specified by the SpellCheckerDictionaryBase.DictionaryPath property, with the help of the affix file located at the SpellCheckerISpellDictionary.GrammarPath file path. Base files and affix files are a part of a non-commercial GNU ISpell project.
NOTE
Currently, you should use ISpell dictionaries only in the plain text format - one word per line, rather than hashed (e.
#OpenOffice Dictionary
The SpellCheckerOpenOfficeDictionary instance is created by decompressing a base file specified by the SpellCheckerDictionaryBase.DictionaryPath property with the help of the affix file located at the SpellCheckerISpellDictionary.GrammarPath file path.
The dictionaries and affix files used are part of the OpenOffice.org project. They are available for download at the http://wiki.services.openoffice.org/wiki/Dictionaries page.
NOTE
We bear no responsibility for the content and availability of dictionaries and affix files, since they are part of an open source project Open
#Hunspell Dictionary
Hunspell allows dictionaries to define complex rules for compound word usage and was designed for languages with rich morphology and complex word compounding or character encoding. Its advantages include morphological analysis, Unicode support and reduced memory usage.
Hunspell dictionaries are used in the OpenOffice, FireFox, and OpenSpell spell check engines. As such, you can easily download existing dictionaries and thus streamline your deployment.
Hunspell dictionary includes two files - the Affix file with grammar rules- *.aff, and the Base Words file - *.dic file. The SpellChecker component uses them to create a HunspellDictionary in the same manner as it does for the OpenOffice dictionaries described above. You can specify the HunspellDictionary.GrammarPath and the HunspellDictionary.DictionaryPath, then use the HunspellDictionary.Load method to load a dictionary. Or you can load both dictionary parts from streams via the HunspellDictionary.LoadFromStream method.
#Custom Dictionary
This dictionary enables you to add words to the spelling dictionary during spell check. If you specify a SpellCheckerDictionaryBase.CacheKey value, this dictionary will be stored in a Session storage and shared between sessions.