Struct Levenshtein<T>
Levenshtein distance.
Namespace: ISynergy.Framework.Mathematics.Distances
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public struct Levenshtein<T> : IMetric<T[]>, IDistance<T[]>, IDistance<T[], T[]>
Type Parameters
Name | Description |
---|---|
T | The type of elements in the string. Default is char. |
Remarks
In information theory and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. Informally, the Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other. It is named after Vladimir Levenshtein, who considered this distance in 1965.
Levenshtein distance may also be referred to as edit distance, although that may also denote a larger family of distance metrics. It is closely related to pairwise string alignments.
References:
Methods
View SourceClone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
Distance(T[], T[])
Computes the distance d(x,y)
between points
x
and y
.
Declaration
public double Distance(T[] x, T[] y)
Parameters
Type | Name | Description |
---|---|---|
T[] | x | The first point |
T[] | y | The second point |
Returns
Type | Description |
---|---|
System.Double | A double-precision value representing the distance |