class StringSimilarity {

    public static double jaroWinkler(CharSequence s1, CharSequence s2) {
        double jaro = jaro(s1, s2);
        int commonLength = Math.min(s1.length(), s2.length());
        commonLength = Math.min(MAX_PREFIX_LENGTH_BOOST + 1, commonLength);
        int prefixLength;
        for (prefixLength = 0; prefixLength < commonLength; prefixLength++) {
            char ch1 = s1.charAt(prefixLength);
            char ch2 = s2.charAt(prefixLength);
            if (ch1 != ch2) {
                break;
            }
        }

        double jaroWinkler = jaro + (WINKLER_SCALING * prefixLength * (1.0 - jaro));
        return Math.min(jaroWinkler, MAX_SCORE);
    }

    private  StringSimilarity();

}