Levenshtein Edit Distance Algorithm for measure string distance
LevenshteinDistance
00 Remarks
01 Syntax
Microsoft.VisualBasic.ComponentModel.Algorithm.DynamicProgramming.Levenshtein.LevenshteinDistance
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| CreateTable | 1 | 用于泛型的序列相似度比较 |
| ComputeDistance | 2 | 泛型序列的相似度的比较计算方法,这个会返回所有的数据 |
| ComputeDistance | 3 | Implement the Levenshtein Edit Distance algorithm between string. |
| computeRouteImpl | 1 | 计算lev编辑的变化路径 |
| CreateTable | 1 | |
| SaveMatch | 1 | |
| Similarity | 1 |
03 Members
CreateTable``1(
``0(), ``0(), Cost(Of ``0), IEquals)用于泛型的序列相似度比较
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
reference | ``0() | - |
hypotheses | ``0() | - |
cost | Cost(Of ``0) | - |
equals | IEquals | 泛型化的元素等价性的比较方法 |
ComputeDistance``1(
``0(), ``0(), IEquals, Double)泛型序列的相似度的比较计算方法,这个函数返回的是距离
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
reference | ``0() | - |
hypotheses | ``0() | - |
equals | IEquals | - |
cost | Double | - |
泛型序列的相似度的比较计算方法,这个会返回所有的数据
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
reference | ``0() | - |
hypotheses | ``0() | - |
equals | IEquals | - |
asChar | ToChar(Of ``0) | 这个只是用于进行显示输出的 |
cost | Double | - |
ComputeDistance(
Int32(), String, Double, IEquals)Implement the Levenshtein Edit Distance algorithm between string.
Parameters
| Name | Type | Description |
|---|---|---|
reference | Int32() | The reference string ASCII cache. |
hypotheses | String | - |
cost | Double | - |
ComputeDistance(
String, String, Double, IEquals)The edit distance between two strings is defined as the minimum number of edit operations required to transform one string into another.
Remarks
(请注意,这函数是大小写敏感的。如果需要大小写不敏感,在使用前,请先将函数的两个字符串参数都转换为小写形式)
Parameters
| Name | Type | Description |
|---|---|---|
reference | String | - |
hypotheses | String | - |
cost | Double | - |
计算lev编辑的变化路径
Parameters
| Name | Type | Description |
|---|---|---|
hypotheses | String | - |
result | DistResult | - |
i | Int32 | - |
j | Int32 | - |
distTable | Double[0:,0:] | - |
CreateTable(
T(), T(), Cost(Of T), GenericLambda(Of T))ComputeDistance(
T(), T(), GenericLambda(Of T), LevenshteinDistance+ToChar(Of T), Double)SaveMatch(DistResult,
String)Similarity(
T(), T(), Double)