¡@

Home 

java Programming Glossary: s_i

Levenshtein to Damerau-Levenshtein

http://stackoverflow.com/questions/6033631/levenshtein-to-damerau-levenshtein

t int i iterates through s int j iterates through t char s_i ith character of s char t_j jth character of t int cost cost.. i 0 i n i d i 0 i for j 0 j m j d 0 j j for i 1 i n i s_i s.charAt i 1 for j 1 j m j t_j t.charAt j 1 if s_i t_j cost.. n i s_i s.charAt i 1 for j 1 j m j t_j t.charAt j 1 if s_i t_j cost 0 else cost 1 d i j Minimum d i 1 j 1 d i j 1..