Class
DocumentSpellChecker

Represents a spell checker for documents that utilizes Telerik's proofing framework. This class provides functionality to check the spelling of words within a document and suggests corrections for any misspelled words.

Definition

Namespace:Telerik.Windows.Documents.Proofing

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class DocumentSpellChecker : ISpellChecker

Inheritance: objectDocumentSpellChecker

Implements: ISpellChecker

Constructors

DocumentSpellChecker()

Declaration

cs-api-definition
public DocumentSpellChecker()

DocumentSpellChecker(ICustomWordDictionary)

Declaration

cs-api-definition
public DocumentSpellChecker(ICustomWordDictionary customDictionary)

Parameters

customDictionary

ICustomWordDictionary

Fields

EditDistanceCoefficient

Declaration

cs-api-definition
public static readonly int EditDistanceCoefficient

Field Value

int

EditDistanceLimit

Declaration

cs-api-definition
public static readonly int EditDistanceLimit

Field Value

int

EditDistanceOneBoost

Declaration

cs-api-definition
public static readonly int EditDistanceOneBoost

Field Value

int

EditDistanceScanLimit

Declaration

cs-api-definition
public static readonly int EditDistanceScanLimit

Field Value

int

EndsDifferencePenalty

Declaration

cs-api-definition
public static readonly int EndsDifferencePenalty

Field Value

int

MaxNumberOfSuggestions

Declaration

cs-api-definition
public static readonly int MaxNumberOfSuggestions

Field Value

int

MetaphoneEqualBoost

Declaration

cs-api-definition
public static readonly int MetaphoneEqualBoost

Field Value

int

Properties

AutomaticallyLoadDefaultDictionaries

Gets or sets a value indicating whether MEF should be used to load default dictionaries.

Declaration

cs-api-definition
public bool AutomaticallyLoadDefaultDictionaries { get; set; }

Property Value

bool

true if default dictionaries should be loaded automatically; otherwise, false.

Settings

Represents the settings for the DocumentSpellChecker in the Telerik.Windows.Documents.Proofing namespace.

Declaration

cs-api-definition
public SpellCheckerSettings Settings { get; set; }

Property Value

SpellCheckerSettings

Implements ISpellChecker.Settings

SpellCheckingCulture

Gets or sets the culture used for spell checking in the document.

Declaration

cs-api-definition
public CultureInfo SpellCheckingCulture { get; set; }

Property Value

CultureInfo

The culture information that determines the language for spell checking.

Implements ISpellChecker.SpellCheckingCulture

Methods

AddCustomDictionary(ICustomWordDictionary, CultureInfo)

Adds a custom dictionary with the specified culture to the spell checker. If a dictionary with this culture already exists, it is overwritten.

Declaration

cs-api-definition
public void AddCustomDictionary(ICustomWordDictionary customDictionary, CultureInfo culture)

Parameters

customDictionary

ICustomWordDictionary

culture

CultureInfo

AddDictionary(IWordDictionary, CultureInfo)

Adds a lazily initialized dictionary with the specified culture to the spell checker. If a dictionary with this culture already exists, it is overwritten.

Declaration

cs-api-definition
public void AddDictionary(IWordDictionary dictionary, CultureInfo culture)

Parameters

dictionary

IWordDictionary

culture

CultureInfo

AddWord(string)

Adds a specified word to the dictionary of the spell checker.

Declaration

cs-api-definition
public void AddWord(string word)

Parameters

word

string

The word to be added to the spell checker dictionary.

Implements ISpellChecker.AddWord(string)

AddWord(string, CultureInfo)

Adds a custom word to the spell checker's dictionary for the specified culture.

Declaration

cs-api-definition
public void AddWord(string word, CultureInfo culture)

Parameters

word

string

The word to be added to the dictionary.

culture

CultureInfo

The culture information for which the word should be recognized.

Implements ISpellChecker.AddWord(string, CultureInfo)

CanAddWord()

Determines whether a word can be added to the spell checker dictionary.

Declaration

cs-api-definition
public bool CanAddWord()

Returns

bool

A boolean value indicating if the word can be added. Returns true if the word can be added; otherwise, false.

Implements ISpellChecker.CanAddWord()

CanAddWord(CultureInfo)

Determines whether a word can be added to the spell checker dictionary for the specified culture.

Declaration

cs-api-definition
public bool CanAddWord(CultureInfo culture)

Parameters

culture

CultureInfo

The culture information that specifies the language for the spell checker.

Returns

bool

true if the word can be added; otherwise, false.

Implements ISpellChecker.CanAddWord(CultureInfo)

CheckWordIsCorrect(string)

Checks if the specified word is spelled correctly.

Declaration

cs-api-definition
public bool CheckWordIsCorrect(string word)

Parameters

word

string

The word to be checked for spelling accuracy.

Returns

bool

A boolean value indicating whether the word is spelled correctly. True if the word is correct; otherwise, false.

Implements ISpellChecker.CheckWordIsCorrect(string)

CheckWordIsCorrect(string, CultureInfo)

Checks if the specified word is spelled correctly according to the current dictionary.

Declaration

cs-api-definition
public bool CheckWordIsCorrect(string word, CultureInfo culture)

Parameters

word

string

The word to be checked for spelling accuracy.

culture

CultureInfo

The culture information that specifies the language of the dictionary used for checking.

Returns

bool

True if the word is spelled correctly; otherwise, false.

Implements ISpellChecker.CheckWordIsCorrect(string, CultureInfo)

GetCustomDictionary()

Retrieves the custom dictionary used by the document spell checker.

Declaration

cs-api-definition
public ICustomWordDictionary GetCustomDictionary()

Returns

ICustomWordDictionary

A CustomDictionary object representing the custom dictionary.

Implements ISpellChecker.GetCustomDictionary()

GetCustomDictionary(CultureInfo)

Retrieves a custom dictionary associated with the specified culture information.

Declaration

cs-api-definition
public ICustomWordDictionary GetCustomDictionary(CultureInfo culture)

Parameters

culture

CultureInfo

Returns

ICustomWordDictionary

A custom dictionary object corresponding to the specified culture, or null if no custom dictionary exists.

Implements ISpellChecker.GetCustomDictionary(CultureInfo)

GetDictionary()

Retrieves the spell-checking dictionary used by the DocumentSpellChecker.

Declaration

cs-api-definition
public IWordDictionary GetDictionary()

Returns

IWordDictionary

The spell-checking dictionary as an object of type T.

Implements ISpellChecker.GetDictionary()

GetDictionary(CultureInfo)

Retrieves the spell-checking dictionary for the specified culture.

Declaration

cs-api-definition
public IWordDictionary GetDictionary(CultureInfo culture)

Parameters

culture

CultureInfo

The culture information for which the dictionary is to be retrieved.

Returns

IWordDictionary

A dictionary object containing the spell-checking entries for the specified culture.

Implements ISpellChecker.GetDictionary(CultureInfo)

GetSuggestions(string)

Retrieves a list of spelling suggestions for the specified word.

Declaration

cs-api-definition
public ICollection<string> GetSuggestions(string word)

Parameters

word

string

The word for which to generate spelling suggestions.

Returns

ICollection<string>

A collection of suggested corrections for the specified word.

Implements ISpellChecker.GetSuggestions(string)

GetSuggestions(string, CultureInfo)

Retrieves a list of spelling suggestions for the specified word based on the provided culture information.

Declaration

cs-api-definition
public ICollection<string> GetSuggestions(string word, CultureInfo culture)

Parameters

word

string

The word for which to retrieve spelling suggestions.

culture

CultureInfo

The culture information that influences the spelling suggestions.

Returns

ICollection<string>

A collection of suggestions for the specified word.

Implements ISpellChecker.GetSuggestions(string, CultureInfo)

RemoveCustomDictionary(CultureInfo)

Removes the custom dictionary with the specified culture from the spell checker. This method returns false if no such dictionary is found.

Declaration

cs-api-definition
public bool RemoveCustomDictionary(CultureInfo culture)

Parameters

culture

CultureInfo

Returns

bool

RemoveDictionary(CultureInfo)

Removes the dictionary with the specified culture from the spell checker. This method returns false if no such dictionary is found.

Declaration

cs-api-definition
public bool RemoveDictionary(CultureInfo culture)

Parameters

culture

CultureInfo

Returns

bool

RemoveWord(string)

Removes a specified word from the spell checker dictionary.

Declaration

cs-api-definition
public void RemoveWord(string word)

Parameters

word

string

The word to be removed from the dictionary.

Implements ISpellChecker.RemoveWord(string)

RemoveWord(string, CultureInfo)

Removes a specified word from the spell check dictionary for the current culture.

Declaration

cs-api-definition
public void RemoveWord(string word, CultureInfo culture)

Parameters

word

string

The word to be removed from the dictionary.

culture

CultureInfo

The culture information that specifies the language of the word.

Implements ISpellChecker.RemoveWord(string, CultureInfo)

Events

DataChanged

Declaration

cs-api-definition
public event EventHandler DataChanged

Event Value

EventHandler

Implements ISpellChecker.DataChanged