I just noticed that the results of string:levenshteinDistance are sometimes incorrect, probably because the implementation counts an extra character operation, albeit incorrectly. I have collected a number of examples for you in which this discrepancy occurs.
_str1 |
_str2 |
Output |
Expected |
| before |
order |
6 |
5 |
| time |
system |
6 |
5 |
| state |
present |
7 |
6 |
| square |
consider |
8 |
7 |
| after |
carbohydrate |
11 |
10 |
| dictionary |
general |
10 |
9 |
| incomprehensible |
public |
15 |
14 |
| under |
square |
6 |
5 |
| there |
number |
6 |
5 |
| there |
never |
5 |
4 |
| structure |
interest |
9 |
8 |
| possible |
public |
7 |
6 |
As you can see, one extra character operation is counted with the above parameters.
I just noticed that the results of
string:levenshteinDistanceare sometimes incorrect, probably because the implementation counts an extra character operation, albeit incorrectly. I have collected a number of examples for you in which this discrepancy occurs._str1_str2As you can see, one extra character operation is counted with the above parameters.