The C1SpellChecker control uses up to three dictionaries while checking text:
- Main dictionaries: Read-only dictionary that contains the main word list. The US-English version of this dictionary is built into the control, so there's no need for any additional files. Other languages are available as .dct files that ship with the control, and can be selected using the FileName property.
- User dictionaries: Read-write dictionary used to store words that are correct, but are not part of the main dictionaries. These files are stored as plain UTF-8 text, and can be selected using the FileName property.
- Custom dictionaries: Any .NET object that implements the ISpellDictionary interface. This allows users to create their own dictionary classes, using whatever scheme makes sense in their application. A custom dictionary could, for example, look up words on the Web using a Web service (and then cache them for speed).
Word Lists
The main dictionaries are zip files with a .dct extension. The zip file may contain several word lists, each one stored as a UTF-8-encoded text file containing lists of valid words. All such entries must have a ".words" extension. For information on how to add word lists, see the Editing the Contents of the DCT File and Creating a New DCT File topics.
Rules
The file may also include a "rules" entry that specifies rules to apply when spell-checking text in the dictionary language. For example, the French dictionary that ships with C1SpellChecker contains the following entries:
- IgnorePrefix: l' d' j' da' m' s' n' qu'
- IgnoreSuffix: 's
These tell the spell checker to ignore some common prefixes and suffixes; they are removed before the word is checked. For example:
- · l'amour (check 'amour' -> correct)
- · l'amuor (check 'amuor' -> incorrect)
- · Maxim's (check 'Maxim' -> correct)
- · Naxim's (check 'Naxim' -> incorrect)
Prefixes and suffixes not included will be tagged as spelling errors:
- h'amour (check 'h'amour' -> incorrect)
- x'amuor (check 'x'amuor' -> incorrect)