Helper class for computing edit distance