package io.aif.language.token.comparator;

import org.apache.commons.lang3.StringUtils;

class LevenshteinDistanceComparator implements ITokenComparator {

    @Override
    public Double compare(String left, String right) {
        final int biggestLength = Math.max(left.length(), right.length());
        return (double)StringUtils.getLevenshteinDistance(left, right)
                / (double)biggestLength;
    }

}

@@ -308,16 +308,21 @@
  return 
+1 - (
 (double)
@@ -408,16 +408,17 @@
 stLength
+)
 ;%0A    %7D%0A

fix for LEVENSHTEIN_COMPARATOR