DoubleMetaphone
Encodes spellings as primary and alternate phonetic keys for matching similarly pronounced words.
Definition
Namespace:Telerik.WinForms.Documents.Proofing
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class DoubleMetaphone
Inheritance: objectDoubleMetaphone
Constructors
Initializes an encoder with the default four-character key limit.
public DoubleMetaphone()
Fields
Gets or sets the maximum number of characters in each phonetic key; defaults to four.
protected int maxCodeLen
Methods
Gets a character at the specified index, returning MinValue when the index is outside the string.
Determines whether the substring at the specified position matches any of the supplied criteria.
protected static bool Contains(string value, int start, int length, string[] criteria)
The string to inspect.
startintThe zero-based index of the substring.
lengthintThe substring length.
criteriastring[]The candidate substrings to compare with the selected portion of value.
true if the substring matches a criterion; otherwise, false.
Encodes the spelling and returns either its primary or alternate phonetic key.
public string Encode(string value, bool alternate)
The spelling to encode; leading and trailing whitespace is ignored.
alternatebooltrue to return the alternate key; otherwise, returns the primary key.
Returns:The selected key, or null when value is null or empty after trimming.