Java Code Examples for org.apache.commons.lang3.StringUtils.getJaroWinklerDistance()

The following are Jave code examples for showing how to use getJaroWinklerDistance() of the org.apache.commons.lang3.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Airachnid-Burp-Extension   File: RequestSender.java   View Source Code Vote up 5 votes
/**
     * 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;
    }
 
Example 2
Project: Stargraph   File: JarowinklerRanker.java   View Source Code Vote up 4 votes
@Override
double computeStringDistance(CharSequence s1, CharSequence s2) {
    return StringUtils.getJaroWinklerDistance(s1, s2);
}