Answers for "javascript find similar strings"

0

javascript find similar strings

function similarity(s1, s2) {
  var longer = s1;
  var shorter = s2;
  if (s1.length < s2.length) {
    longer = s2;
    shorter = s1;
  }
  var longerLength = longer.length;
  if (longerLength == 0) {
    return 1.0;
  }
  return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);
}
Posted by: Guest on January-29-2020

Code answers related to "javascript find similar strings"

Code answers related to "Javascript"

Browse Popular Code Answers by Language