DocumentSpellChecker
Checks words against culture-specific and custom dictionaries and ranks spelling suggestions.
Definition
Namespace:Telerik.WinForms.Documents.Proofing
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class DocumentSpellChecker : ISpellChecker
Inheritance: objectDocumentSpellChecker
Implements:
Constructors
Initializes the checker without a custom dictionary. The WinForms build also registers the built-in en-US dictionary.
public DocumentSpellChecker()
Initializes the checker with an optional custom dictionary, which is used as the invariant-culture fallback.
public DocumentSpellChecker(ICustomWordDictionary customDictionary)
The custom dictionary to use as a fallback, or null when none is supplied.
Fields
Multiplier applied to candidate edit distances when computing suggestion rank.
public static readonly int EditDistanceCoefficient
Exclusive upper bound for the Damerau-Levenshtein distance of a returned suggestion.
public static readonly int EditDistanceLimit
Rank reduction applied to candidates with a Damerau-Levenshtein distance of one.
public static readonly int EditDistanceOneBoost
Maximum Sift3 distance accepted during candidate scanning; it also defines the scanned word-length window.
public static readonly int EditDistanceScanLimit
Penalty weight added for a mismatch in the first or last character.
public static readonly int EndsDifferencePenalty
Maximum number of ranked candidates considered before the final edit-distance filter.
public static readonly int MaxNumberOfSuggestions
Rank reduction applied when a candidate's primary Metaphone key matches the queried word.
public static readonly int MetaphoneEqualBoost
Properties
Gets or sets a value indicating whether MEF should be used to load default dictionaries.
public bool AutomaticallyLoadDefaultDictionaries { get; set; }
true if default dictionaries should be loaded automatically; otherwise, false.
Gets or sets the options used by document proofing when deciding which words to check.
public SpellCheckerSettings Settings { get; set; }
Implements:
Gets or sets the culture used by operations that do not specify a culture.
public CultureInfo SpellCheckingCulture { get; set; }
The active culture, or null to use CurrentCulture.
Implements:
Methods
Adds a custom dictionary with the specified culture to the spell checker. If a dictionary with this culture already exists, it is overwritten.
public void AddCustomDictionary(ICustomWordDictionary customDictionary, CultureInfo culture)
Adds a dictionary with the specified culture to the spell checker. If a dictionary with this culture already exists, it is overwritten.
public void AddDictionary(IWordDictionary dictionary, CultureInfo culture)
Adds a lazily initialized dictionary with the specified culture to the spell checker. If a dictionary with this culture already exists, it is overwritten.
public void AddDictionary(Lazy<IWordDictionary> lazyDictionary, CultureInfo culture)
Adds a spelling to the custom dictionary resolved for the specified culture, falling back to the invariant-culture dictionary.
public void AddWord(string word, CultureInfo culture)
The spelling to add.
cultureCultureInfoThe culture whose custom dictionary receives the spelling.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for culture or the invariant culture.
Implements:
Adds a spelling to the custom dictionary resolved for the active culture, falling back to the invariant-culture dictionary.
public void AddWord(string word)
The spelling to add.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for the active culture or the invariant culture.
Implements:
Determines whether a custom dictionary resolves for the specified culture, including the invariant-culture fallback.
public bool CanAddWord(CultureInfo culture)
The culture whose custom dictionary is checked.
Returns:true when a custom dictionary is available; otherwise, false.
Implements:
Determines whether a word is recognized using the specified culture and its available dictionaries.
public bool CheckWordIsCorrect(string word, CultureInfo culture)
The spelling to check.
cultureCultureInfoThe culture whose dictionaries are used.
Returns:Implements:
Gets the custom dictionary for the active culture, falling back to the invariant-culture custom dictionary.
public ICustomWordDictionary GetCustomDictionary()
The matching custom dictionary, or null when none is available.
Implements:
Gets the custom dictionary for the specified culture, falling back to the invariant-culture custom dictionary.
public ICustomWordDictionary GetCustomDictionary(CultureInfo culture)
The culture whose custom dictionary is requested.
Returns:The matching custom dictionary, or null when none is available.
Implements:
Gets the word dictionary for the active culture, falling back to the invariant-culture dictionary.
public IWordDictionary GetDictionary()
The matching dictionary, or null when neither dictionary is available.
Implements:
Gets the word dictionary for the specified culture, falling back to the invariant-culture dictionary.
public IWordDictionary GetDictionary(CultureInfo culture)
The culture whose dictionary is requested.
Returns:The matching dictionary, or null when neither dictionary is available.
Implements:
Gets ranked spelling candidates using the specified culture.
public ICollection<string> GetSuggestions(string word, CultureInfo culture)
The spelling for which to find candidates.
cultureCultureInfoThe culture whose dictionaries are used.
Returns:ICollection<string>
Candidate replacement spellings; the collection can be empty when no candidates are found.
Implements:
Gets ranked spelling candidates using the active culture.
Removes the custom dictionary with the specified culture from the spell checker. This method returns false if no such dictionary is found.
Removes the dictionary with the specified culture from the spell checker. This method returns false if no such dictionary is found.
Removes a spelling from the custom dictionary resolved for the specified culture, falling back to the invariant-culture dictionary.
public void RemoveWord(string word, CultureInfo culture)
The spelling to remove.
cultureCultureInfoThe culture whose custom dictionary is searched.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for culture or the invariant culture.
Implements:
Removes a spelling from the custom dictionary resolved for the active culture, falling back to the invariant-culture dictionary.
public void RemoveWord(string word)
The spelling to remove.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for the active culture or the invariant culture.
Implements:
Events
Occurs when dictionary data or the active spelling culture changes.
public event EventHandler DataChanged
Implements: