WordDictionary
Stores dictionary spellings and indexes them by primary and alternate Metaphone keys.
Definition
Namespace:Telerik.WinControls.SpellChecker.Proofing
Assembly:Telerik.WinControls.SpellChecker.dll
Syntax:
public class WordDictionary : IWordDictionary
Inheritance: objectWordDictionary
Derived Classes:
Implements:
Constructors
Creates an empty dictionary using the default initial capacities.
public WordDictionary()
Creates an empty dictionary with capacity sized for the expected number of words.
public WordDictionary(int expectedSize)
The anticipated number of dictionary entries.
Fields
Stores loaded spellings in the order their entries are processed.
protected List<string> allWords
Shared empty result returned when a phonetic lookup has no matches.
protected static readonly string[] emptyStringArray
Maps each spelling to its primary and alternate Metaphone keys.
protected Dictionary<string, Tuple<string, string>> metaphoneByWord
Maps primary Metaphone keys to their dictionary spellings.
protected Dictionary<string, List<string>> wordsByMetaphone
Maps alternate Metaphone keys to their dictionary spellings.
protected Dictionary<string, List<string>> wordsByMetaphoneAlternate
Properties
Indicates whether the dictionary's lazy-load hook has completed.
protected bool DictionaryLoaded { get; }
Methods
Adds a spelling to both phonetic indexes and records its keys in the word map.
Loads the dictionary once, invoking the subclass hook while holding a synchronization lock.
protected void EnsureDictionaryLoaded()
Loads entries for a concrete dictionary type. Override this method to populate the indexes on first lookup.
protected virtual void EnsureDictionaryLoadedOverride()
Gets dictionary spellings indexed by the specified primary Metaphone key.
Initializes the word storage and phonetic indexes.
protected void Init(int expectedSize)
The anticipated number of dictionary entries.
Loads colon-delimited entries containing a spelling, its primary Metaphone key, and its alternate key.
protected void Load(IEnumerable<string> entries)
The dictionary records to index.
Loads colon-delimited dictionary records from a stream and indexes their spelling and Metaphone keys.
public void Load(Stream stream)
A text stream containing one dictionary record per line.
The stream is closed when this method finishes reading it.
Raises DataChanged for changes made by a dictionary implementation.
protected virtual void OnDataChanged()
Removes a spelling from both phonetic indexes and the word-to-key map.
protected void RemoveWordFromMetaphoneDictionaries(string word, string metaphone, string metaphoneAlternate)
The spelling to remove.
metaphonestringThe primary Metaphone key associated with the spelling.
metaphoneAlternatestringThe alternate Metaphone key associated with the spelling.
Events
Occurs when a dictionary implementation signals that its contents have changed.
public event EventHandler DataChanged