All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.debatty.java.stringsimilarity.StringSimilarityInterface Maven / Gradle / Ivy

Go to download

Implementation of various string similarity and distance algorithms: Levenshtein, Jaro-winkler, n-Gram, Q-Gram, Jaccard index, Longest Common Subsequence edit distance, cosine similarity...

There is a newer version: 2.0.0
Show newest version

package info.debatty.java.stringsimilarity;

/**
 *
 * @author tibo
 */
public interface StringSimilarityInterface {
    /**
     * 
     * @param s1
     * @param s2
     * @return similarity between 0 (completely different) and 1 (s1 = s2)
     */
    public double similarity(String s1, String s2);
    
    /**
     * Generally, distance = 1 - similarity.
     * Some implementations can also provide a method distanceAbsolute
     * @param s1
     * @param s2
     * @return distance between 0 (s1 = s2) and 1 (completely different)
     */
    public double distance(String s1, String s2);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy