Class DoubleMetaphone
Encodes a string into a double metaphone value. This Implementation is based on the algorithm by Lawrence
Philips
.
This class is conditionally thread-safe. The instance field Lucene.
See Original Article
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Phonetic.Language
Assembly: Lucene.Net.Analysis.Phonetic.dll
Syntax
public class DoubleMetaphone : IStringEncoder
Constructors
| Improve this Doc View SourceDoubleMetaphone()
Creates an instance of this Double
Declaration
public DoubleMetaphone()
Properties
| Improve this Doc View SourceMaxCodeLen
Gets or Sets the maxCodeLen.
Declaration
public virtual int MaxCodeLen { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceCharAt(String, Int32)
Gets the character at index index
if available, otherwise
it returns System.
Declaration
protected virtual char CharAt(string value, int index)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | |
System. |
index |
Returns
Type | Description |
---|---|
System. |
Contains(String, Int32, Int32, String[])
Determines whether value
contains any of the criteria starting at index start
and
matching up to length length
.
Declaration
protected static bool Contains(string value, int start, int length, params string[] criteria)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | |
System. |
start | |
System. |
length | |
System. |
criteria |
Returns
Type | Description |
---|---|
System. |
Encode(String)
Encode the value using DoubleMetaphone.
Declaration
public virtual string Encode(string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | String to encode. |
Returns
Type | Description |
---|---|
System. |
An encoded string. |
GetDoubleMetaphone(String)
Encode a value with Double Metaphone.
Declaration
public virtual string GetDoubleMetaphone(string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | String to encode. |
Returns
Type | Description |
---|---|
System. |
An encoded string. |
GetDoubleMetaphone(String, Boolean)
Encode a value with Double Metaphone, optionally using the alternate encoding.
Declaration
public virtual string GetDoubleMetaphone(string value, bool alternate)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | String to encode. |
System. |
alternate | Use alternate encode. |
Returns
Type | Description |
---|---|
System. |
An encoded string. |
IsDoubleMetaphoneEqual(String, String)
Check if the Double Metaphone values of two System.
Declaration
public virtual bool IsDoubleMetaphoneEqual(string value1, string value2)
Parameters
Type | Name | Description |
---|---|---|
System. |
value1 | The left-hand side of the encoded System. |
System. |
value2 | The right-hand side of the encoded System. |
Returns
Type | Description |
---|---|
System. |
|
IsDoubleMetaphoneEqual(String, String, Boolean)
Check if the Double Metaphone values of two System.
Declaration
public virtual bool IsDoubleMetaphoneEqual(string value1, string value2, bool alternate)
Parameters
Type | Name | Description |
---|---|---|
System. |
value1 | The left-hand side of the encoded System. |
System. |
value2 | The right-hand side of the encoded System. |
System. |
alternate | Use the alternate value if |
Returns
Type | Description |
---|---|
System. |
|