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.
Inheritance
Namespace: Telerik.Windows.Documents.Proofing
Assembly: Telerik.Windows.Controls.RichTextBox.dll
Syntax
public class DocumentSpellChecker : Object, ISpellChecker
Constructors
DocumentSpellChecker()
Declaration
public DocumentSpellChecker()
DocumentSpellChecker(ICustomWordDictionary)
Declaration
public DocumentSpellChecker(ICustomWordDictionary customDictionary)
Parameters
ICustomWordDictionary
customDictionary
|
Fields
EditDistanceCoefficient
Declaration
public static readonly int EditDistanceCoefficient
Field Value
System.Int32
|
EditDistanceLimit
Declaration
public static readonly int EditDistanceLimit
Field Value
System.Int32
|
EditDistanceOneBoost
Declaration
public static readonly int EditDistanceOneBoost
Field Value
System.Int32
|
EditDistanceScanLimit
Declaration
public static readonly int EditDistanceScanLimit
Field Value
System.Int32
|
EndsDifferencePenalty
Declaration
public static readonly int EndsDifferencePenalty
Field Value
System.Int32
|
MaxNumberOfSuggestions
Declaration
public static readonly int MaxNumberOfSuggestions
Field Value
System.Int32
|
MetaphoneEqualBoost
Declaration
public static readonly int MetaphoneEqualBoost
Field Value
System.Int32
|
Properties
AutomaticallyLoadDefaultDictionaries
Gets or sets a value indicating whether MEF should be used to load default dictionaries.
Declaration
public bool AutomaticallyLoadDefaultDictionaries { get; set; }
Property Value
System.Boolean
|
DictionaryList
Gets or sets the list of dictionaries used by SpellChecker. Generally this property is not intended to be used directly from your code, rather it is set automatically by MEF.
Declaration
public List<Tuple<IWordDictionary, string>> DictionaryList { get; set; }
Property Value
System.Collections.Generic.List<System.Tuple<IWordDictionary, System.String>>
|
Settings
Represents the settings for the DocumentSpellChecker in the Telerik.Windows.Documents.Proofing namespace.
Declaration
public SpellCheckerSettings Settings { get; set; }
Property Value
SpellCheckerSettings
|
Implements
SpellCheckingCulture
Gets or sets the culture used for spell checking in the document.
Declaration
public CultureInfo SpellCheckingCulture { get; set; }
Property Value
System.Globalization.CultureInfo
The culture information that determines the language for spell checking. |
Implements
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
public void AddCustomDictionary(ICustomWordDictionary customDictionary, CultureInfo culture)
Parameters
ICustomWordDictionary
customDictionary
|
System.Globalization.CultureInfo
culture
|
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
public void AddDictionary(IWordDictionary dictionary, CultureInfo culture)
Parameters
IWordDictionary
dictionary
|
System.Globalization.CultureInfo
culture
|
AddWord(String)
Adds a specified word to the dictionary of the spell checker.
Declaration
public void AddWord(string word)
Parameters
System.String
word
The word to be added to the spell checker dictionary. |
Implements
AddWord(String, CultureInfo)
Adds a custom word to the spell checker's dictionary for the specified culture.
Declaration
public void AddWord(string word, CultureInfo culture)
Parameters
System.String
word
The word to be added to the dictionary. |
System.Globalization.CultureInfo
culture
The culture information for which the word should be recognized. |
Implements
CanAddWord()
Determines whether a word can be added to the spell checker dictionary.
Declaration
public bool CanAddWord()
Returns
System.Boolean
A boolean value indicating if the word can be added. Returns true if the word can be added; otherwise, false. |
Implements
CanAddWord(CultureInfo)
Determines whether a word can be added to the spell checker dictionary for the specified culture.
Declaration
public bool CanAddWord(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
The culture information that specifies the language for the spell checker. |
Returns
System.Boolean
true if the word can be added; otherwise, false. |
Implements
CheckWordIsCorrect(String)
Checks if the specified word is spelled correctly.
Declaration
public bool CheckWordIsCorrect(string word)
Parameters
System.String
word
The word to be checked for spelling accuracy. |
Returns
System.Boolean
A boolean value indicating whether the word is spelled correctly. True if the word is correct; otherwise, false. |
Implements
CheckWordIsCorrect(String, CultureInfo)
Checks if the specified word is spelled correctly according to the current dictionary.
Declaration
public bool CheckWordIsCorrect(string word, CultureInfo culture)
Parameters
System.String
word
The word to be checked for spelling accuracy. |
System.Globalization.CultureInfo
culture
The culture information that specifies the language of the dictionary used for checking. |
Returns
System.Boolean
True if the word is spelled correctly; otherwise, false. |
Implements
GetCustomDictionary()
Retrieves the custom dictionary used by the document spell checker.
Declaration
public ICustomWordDictionary GetCustomDictionary()
Returns
ICustomWordDictionary
A |
Implements
GetCustomDictionary(CultureInfo)
Retrieves a custom dictionary associated with the specified culture information.
Declaration
public ICustomWordDictionary GetCustomDictionary(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
|
Returns
ICustomWordDictionary
A custom dictionary object corresponding to the specified culture, or null if no custom dictionary exists. |
Implements
GetDictionary()
Retrieves the spell-checking dictionary used by the DocumentSpellChecker.
Declaration
public IWordDictionary GetDictionary()
Returns
IWordDictionary
The spell-checking dictionary as an object of type |
Implements
GetDictionary(CultureInfo)
Retrieves the spell-checking dictionary for the specified culture.
Declaration
public IWordDictionary GetDictionary(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
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
GetSuggestions(String)
Retrieves a list of spelling suggestions for the specified word.
Declaration
public ICollection<string> GetSuggestions(string word)
Parameters
System.String
word
The word for which to generate spelling suggestions. |
Returns
System.Collections.Generic.ICollection<System.String>
A collection of suggested corrections for the specified word. |
Implements
GetSuggestions(String, CultureInfo)
Retrieves a list of spelling suggestions for the specified word based on the provided culture information.
Declaration
public ICollection<string> GetSuggestions(string word, CultureInfo culture)
Parameters
System.String
word
The word for which to retrieve spelling suggestions. |
System.Globalization.CultureInfo
culture
The culture information that influences the spelling suggestions. |
Returns
System.Collections.Generic.ICollection<System.String>
A collection of suggestions for the specified word. |
Implements
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
public bool RemoveCustomDictionary(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
|
Returns
System.Boolean
|
RemoveDictionary(CultureInfo)
Removes the dictionary with the specified culture from the spell checker. This method returns false if no such dictionary is found.
Declaration
public bool RemoveDictionary(CultureInfo culture)
Parameters
System.Globalization.CultureInfo
culture
|
Returns
System.Boolean
|
RemoveWord(String)
Removes a specified word from the spell checker dictionary.
Declaration
public void RemoveWord(string word)
Parameters
System.String
word
The word to be removed from the dictionary. |
Implements
RemoveWord(String, CultureInfo)
Removes a specified word from the spell check dictionary for the current culture.
Declaration
public void RemoveWord(string word, CultureInfo culture)
Parameters
System.String
word
The word to be removed from the dictionary. |
System.Globalization.CultureInfo
culture
The culture information that specifies the language of the word. |
Implements
Events
DataChanged
Declaration
public event EventHandler DataChanged
Event Type
System.EventHandler
|