getRatio static method

double getRatio(
  1. String s1,
  2. String s2
)

Implementation

static double getRatio(String s1, String s2) {
  var len1 = s1.length;
  var len2 = s2.length;

  var lensum = len1 + len2;

  var editDistance = levEditDistance(s1, s2, 1);

  return (lensum - editDistance) / lensum.toDouble();
}