发现commons-lang 中有实现:

StringUtils.class

public static double getJaroWinklerDistance(final CharSequence first, final CharSequence second) {
final double DEFAULT_SCALING_FACTOR = 0.1;

if (first == null || second == null) {
throw new IllegalArgumentException("Strings must not be null");
}

final double jaro = score(first,second);
final int cl = commonPrefixLength(first, second);
final double matchScore = Math.round((jaro + (DEFAULT_SCALING_FACTOR * cl * (1.0 - jaro))) *100.0)/100.0;

return matchScore;
}

相关文章:

  • 2021-10-22
  • 2021-05-16
  • 2021-11-02
  • 2022-02-08
  • 2021-09-24
  • 2021-12-06
  • 2021-12-30
猜你喜欢
  • 2021-08-17
  • 2021-07-19
  • 2021-07-20
  • 2021-11-11
  • 2021-04-05
  • 2021-05-24
  • 2021-08-14
相关资源
相似解决方案