DocumentSpellChecker
Checks words against culture-specific dictionaries and custom words, and ranks spelling suggestions.
Definition
Namespace:Telerik.WinControls.SpellChecker.Proofing
Assembly:Telerik.WinControls.SpellChecker.dll
Syntax:
public class DocumentSpellChecker : ISpellChecker, IDisposable
Inheritance: objectDocumentSpellChecker
Implements:
Constructors
Creates a checker with the built-in English dictionary and no custom dictionary.
public DocumentSpellChecker()
Creates a checker with an optional custom dictionary and registers the built-in English dictionary. The supplied custom dictionary is used as the invariant-culture fallback.
public DocumentSpellChecker(ICustomWordDictionary customDictionary)
The custom dictionary used when no culture-specific custom dictionary is registered.
Fields
Multiplier applied to candidate edit distances when computing suggestion rank.
public static readonly int EditDistanceCoeficient
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 used by the suggestion comparator for first- or last-character differences.
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 the culture used by operations without an explicit culture. A null value uses CurrentCulture; changing this property raises DataChanged.
public CultureInfo SpellCheckingCulture { get; set; }
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 for the specified culture or its invariant fallback.
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 the specified culture or its invariant fallback.
Implements:
Adds a spelling to the custom dictionary for SpellCheckingCulture or the current culture.
public void AddWord(string word)
The spelling to add.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for the active culture or its invariant fallback.
Implements:
Determines whether a custom dictionary is available for SpellCheckingCulture or the current culture.
Determines whether a custom dictionary is available for the specified culture or its invariant fallback.
public bool CanAddWord(CultureInfo culture)
The culture whose custom dictionary is checked.
Returns:true when a custom dictionary is available; otherwise, false.
Implements:
Checks whether all word parts are recognized by dictionaries for the specified culture. Language-specific proofing may split a compound spelling before dictionary lookup.
public bool CheckWordIsCorrect(string word, CultureInfo culture)
The spelling to check.
cultureCultureInfoThe culture used for word splitting and dictionary lookup.
Returns:Implements:
Checks whether a spelling is recognized using SpellCheckingCulture or the current culture.
Clears the checker's dictionary registries and metadata references without disposing the dictionary instances.
public void Dispose()
Implements:
Gets the custom dictionary for a 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 registered.
Gets the dictionary for a culture, falling back to the invariant-culture dictionary and instantiating it if needed.
public IWordDictionary GetDictionary(CultureInfo culture)
The culture whose dictionary is requested.
Returns:The matching dictionary, or null when neither that culture nor the invariant culture is registered.
Gets ranked spelling suggestions from the dictionaries for the specified culture.
public ICollection<string> GetSuggestions(string word, CultureInfo culture)
The spelling for which to find suggestions.
cultureCultureInfoThe culture whose word and custom dictionaries are used.
Returns:ICollection<string>
Up to MaxNumberOfSuggestions candidates; an empty collection for a null or empty input.
Implements:
Gets ranked spelling suggestions using SpellCheckingCulture or the current culture.
public ICollection<string> GetSuggestions(string word)
The spelling for which to find suggestions.
Returns:ICollection<string>
Up to MaxNumberOfSuggestions candidates; an empty collection for a null or empty input.
Implements:
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 for the specified culture or its invariant fallback.
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 the specified culture or its invariant fallback.
Implements:
Removes a spelling from the custom dictionary for SpellCheckingCulture or the current culture.
public void RemoveWord(string word)
The spelling to remove.
Exceptions: InvalidOperationExceptionNo custom dictionary is registered for the active culture or its invariant fallback.
Implements:
Events
Occurs when the checker culture, registered dictionaries, or observed custom-dictionary data changes.
public event EventHandler DataChanged
Implements: