First, the Levenshtein distance is defined as the minimum number of changes needed to convert line A to line B, where editing is the insertion or deletion of one character or the replacement of a character by another character. So this is a very “difference between the two lines”, for a certain definition of distance. =)
, F (A, B), A B N, N . Needleman-Wunsch. , , . , QWERTY-, . .
k , , , O (k ^ 2). , O (len (A) * len (B)). , , , - . , :
- , , , , F (A, B) F (B, A).
- abs (len (A) - len (B)) A B. , , .
, , , "1st St." " ", , , , . - , , , . , , , "1-" "" .. , , .
php, , php . PHP levenshtein(), 255 . , . , Python difflib.