New to Telerik UI for WinForms? Start a free 30-day trial

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:

C#
public class DoubleMetaphone

Inheritance: objectDoubleMetaphone

Constructors

Initializes an encoder with the default four-character key limit.

C#
public DoubleMetaphone()

Fields

Gets or sets the maximum number of characters in each phonetic key; defaults to four.

C#
protected int maxCodeLen

Methods

Gets a character at the specified index, returning MinValue when the index is outside the string.

C#
protected char CharAt(string value, int index)
Parameters:valuestring

The string to read.

indexint

The zero-based character index.

Returns:

char

The character at index, or MinValue when it is out of range.

Determines whether the substring at the specified position matches any of the supplied criteria.

C#
protected static bool Contains(string value, int start, int length, string[] criteria)
Parameters:valuestring

The string to inspect.

startint

The zero-based index of the substring.

lengthint

The substring length.

criteriastring[]

The candidate substrings to compare with the selected portion of value.

Returns:

bool

true if the substring matches a criterion; otherwise, false.

Encodes the spelling and returns either its primary or alternate phonetic key.

C#
public string Encode(string value, bool alternate)
Parameters:valuestring

The spelling to encode; leading and trailing whitespace is ignored.

alternatebool

true to return the alternate key; otherwise, returns the primary key.

Returns:

string

The selected key, or null when value is null or empty after trimming.

Encodes the spelling and returns its primary phonetic key.

C#
public string Encode(string value)
Parameters:valuestring

The spelling to encode; leading and trailing whitespace is ignored.

Returns:

string

The primary key, or null when value is null or empty after trimming.