Slide 15
Slide 15 text
New Features in Texdoc 3.0
Calculating Levenshtein distance
Levenshtein distance can be calculated with DP:
… considering two strings , b; and
… let | |, |b| are lengths of , b respectively.
Calculating the distance in O(| ||b|) time:
lev ,b( , j) =
8
>
>
>
<
>
>
>
:
m x( , j) if min( , j) = 0; otherwise,
min
8
<
:
lev ,b( 1, j) + 1
lev ,b( , j 1) + 1
lev ,b( 1, j 1) + 1( 6=bj)
15 / 26