Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GrammarBasedDictionary Class

Implements the base API for dictionaries that split words into roots and affixes.

Namespace: DevExpress.Blazor.RichEdit.SpellCheck

Assembly: DevExpress.Blazor.RichEdit.v24.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
public abstract class GrammarBasedDictionary :
    DictionaryBase

#Remarks

A Hunspell and ISpell dictionaries consist of base words files and affix files. A base words file lists root words with applicable flags. A flag defines which affixes (prefixes and suffixes) can be added to a root, and the affix file lists all flags and their meanings. The Rich Text Editor combines these files to create a complete list of words.

The following code snippet adds an ISpell dictionary:

C#
public void ConfigureServices(IServiceCollection services) {
    services.AddDevExpressBlazor().AddSpellCheck(opts => {
        opts.FileProvider = new PhysicalFileProvider(
            Path.Combine(Directory.GetCurrentDirectory(), "Data", "Dictionaries")
        );
        opts.Dictionaries.Add(new ISpellDictionary {
            DictionaryPath = "american.xlg",
            GrammarPath = "english.aff",
            Culture = "en-US"
        });
    });
}

Refer to the following topic for more information: Spell Check.

See Also