Back to Devexpress

SpellCheckerISpellDictionary Class

corelibraries-devexpress-dot-xtraspellchecker-b913910c.md

latest4.3 KB
Original Source

SpellCheckerISpellDictionary Class

Represents an XtraSpellChecker dictionary originated from a dictionary in the ISpell format.

Namespace : DevExpress.XtraSpellChecker

Assembly : DevExpress.SpellChecker.v25.2.Core.dll

NuGet Package : DevExpress.SpellChecker.Core

Declaration

csharp
public class SpellCheckerISpellDictionary :
    SpellCheckerDictionaryBase
vb
Public Class SpellCheckerISpellDictionary
    Inherits SpellCheckerDictionaryBase

The following members return SpellCheckerISpellDictionary objects:

Remarks

The SpellCheckerISpellDictionary instance is created by decompressing the base file, specified by the DictionaryBase.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 the 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 (i.e. not processed with the buildhash utility). Search for them on this page.

Example

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

Note

A complete sample project is available at https://github.com/DevExpress-Examples/winforms-spellchecker-enable-in-text-box

csharp
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;
            spellChecker1.Dictionaries.Clear();

            SpellCheckerISpellDictionary ispellDictionaryEnglish = new SpellCheckerISpellDictionary();
            ispellDictionaryEnglish.DictionaryPath = @"Dictionaries\ISpell\en_US\american.xlg";
            ispellDictionaryEnglish.GrammarPath = @"Dictionaries\ISpell\en_US\english.aff";
            ispellDictionaryEnglish.AlphabetPath = @"Dictionaries\EnglishAlphabet.txt";
            ispellDictionaryEnglish.Culture = new CultureInfo("en-US");
            ispellDictionaryEnglish.Load();
            spellChecker1.Dictionaries.Add(ispellDictionaryEnglish);
vb
Imports DevExpress.XtraSpellChecker
Imports System
Imports System.Globalization
            spellChecker1.Dictionaries.Clear()

            Dim ispellDictionaryEnglish As New SpellCheckerISpellDictionary()
            ispellDictionaryEnglish.DictionaryPath = "Dictionaries\ISpell\en_US\american.xlg"
            ispellDictionaryEnglish.GrammarPath = "Dictionaries\ISpell\en_US\english.aff"
            ispellDictionaryEnglish.AlphabetPath = "Dictionaries\EnglishAlphabet.txt"
            ispellDictionaryEnglish.Culture = New CultureInfo("en-US")
            ispellDictionaryEnglish.Load()
            spellChecker1.Dictionaries.Add(ispellDictionaryEnglish)

Implements

ISpellCheckerDictionary

Inheritance

Object DictionaryBase SpellCheckerDictionaryBase SpellCheckerISpellDictionary SpellCheckerOpenOfficeDictionary

See Also

SpellCheckerISpellDictionary Members

DevExpress.XtraSpellChecker Namespace