I took the liberty of translating part of the C # code that I wrote to calculate the Levenshtein distance to Java code. It uses only two one-dimensional arrays that alternate instead of a large, uneven array:
public static int getDifference(String a, String b) {
This is not strictly verified, but seems to work fine. It was based on the Python implementation that I did for university studies. Hope this helps!
Cecil Has a Name May 25, '09 at 21:50 2009-05-25 21:50
source share