diff --git a/src/option_processing.cc b/src/option_processing.cc index a671b23a..fe9810de 100644 --- a/src/option_processing.cc +++ b/src/option_processing.cc @@ -103,10 +103,10 @@ int levenshtein(const char* a, const char* b, int swapcost, int subcost, int blen = strlen(b); std::vector> dp(3, std::vector(blen + 1)); for (int i = 0; i <= blen; ++i) { - dp[1][i] = i; + dp[1][i] = i * addcost; } for (int i = 1; i <= alen; ++i) { - dp[0][0] = i; + dp[0][0] = i * delcost; for (int j = 1; j <= blen; ++j) { dp[0][j] = dp[1][j - 1] + (a[i - 1] == b[j - 1] ? 0 : subcost); if (i >= 2 && j >= 2 && a[i - 1] != b[j - 1] && a[i - 2] == b[j - 1] &&