tokenSetRatio function

int tokenSetRatio(
  1. String s1,
  2. String s2
)

Splits the strings into tokens and computes intersections and remainders between the tokens of the two strings. A comparison string is then built up and is compared using the simple ratio algorithm. Useful for strings where words appear redundantly.

Implementation

int tokenSetRatio(String s1, String s2) {
  return TokenSet().apply(s1, s2, SimpleRatio());
}