小编use*_*332的帖子

Levenshtein距离c#计数错误类型

我找到了一些代码来计算Levenshtein在答案和猜测之间的距离:

int CheckErrors(string Answer, string Guess)
{
    int[,] d = new int[Answer.Length + 1, Guess.Length + 1];
    for (int i = 0; i <= Answer.Length; i++)
        d[i, 0] = i;
    for (int j = 0; j <= Guess.Length; j++)
        d[0, j] = j;
    for (int j = 1; j <= Guess.Length; j++)
        for (int i = 1; i <= Answer.Length; i++)
            if (Answer[i - 1] == Guess[j - 1])
                d[i, j] = d[i - 1, j …
Run Code Online (Sandbox Code Playgroud)

c# count levenshtein-distance

6
推荐指数
1
解决办法
399
查看次数

标签 统计

c# ×1

count ×1

levenshtein-distance ×1