本文整理汇总了Java中org.apache.commons.lang3.StringUtils.getJaroWinklerDistance方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.getJaroWinklerDistance方法的具体用法?Java StringUtils.getJaroWinklerDistance怎么用?Java StringUtils.getJaroWinklerDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.getJaroWinklerDistance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSimilar
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
/**
* Testing if the responses of two requests are similar. This is the not the same as the same, rather there is a
* threshold set in the static parameters of the class.
* @param firstString
* @param secondString
* @return Test if similar
*/
private static boolean testSimilar(String firstString, String secondString) {
// int fuzzyDist = StringUtils.getFuzzyDistance(firstString, secondString, Locale.getDefault());
double jaroDist = StringUtils.getJaroWinklerDistance(firstString, secondString);
int levenDist = StringUtils.getLevenshteinDistance(firstString, secondString);
// BurpExtender.print("============================================");
// BurpExtender.print("Fuzzy Distance:" + fuzzyDist);
// BurpExtender.print(" Jaro Winkler Distance:" + jaroDist);
// BurpExtender.print(" Levenshtein Distance:" + levenDist);
// BurpExtender.print("============================================");
return jaroDist >= JARO_THRESHOLD || levenDist <= LEVENSHTEIN_THRESHOLD;
}
示例2: computeStringDistance
import org.apache.commons.lang3.StringUtils; //导入方法依赖的package包/类
@Override
double computeStringDistance(CharSequence s1, CharSequence s2) {
return StringUtils.getJaroWinklerDistance(s1, s2);
}