Lev(George, Georg) = 1 Lev(Prague, Prag ) = 2 Lev(Rome, Rom ) = 1The greater the Levenshtein distance, the more different the strings are.
L | e | v | e | n | s | h | t | e | i | n | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | |
M | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
e | 2 | 2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
i | 3 | 3 | 2 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 8 | 9 |
l | 4 | 4 | 3 | 3 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 9 |
e | 5 | 5 | 4 | 4 | 3 | 4 | 5 | 6 | 7 | 7 | 8 | 9 |
n | 6 | 6 | 5 | 5 | 4 | 3 | 4 | 5 | 6 | 7 | 8 | 8 |
s | 7 | 7 | 6 | 6 | 5 | 4 | 3 | 4 | 5 | 6 | 7 | 8 |
t | 8 | 8 | 7 | 7 | 6 | 5 | 4 | 4 | 4 | 5 | 6 | 7 |
e | 9 | 9 | 8 | 8 | 7 | 6 | 5 | 5 | 5 | 4 | 5 | 6 |
i | 10 | 10 | 9 | 9 | 8 | 7 | 6 | 6 | 6 | 5 | 4 | 5 |
n | 11 | 11 | 10 | 10 | 9 | 8 | 7 | 7 | 7 | 6 | 5 | 4 | Distance: 4