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

water.util.comparison.string.StringComparatorFactory Maven / Gradle / Ivy

There is a newer version: 3.46.0.5
Show newest version
package water.util.comparison.string;

public class StringComparatorFactory {
    public static StringComparator makeComparator(String measure) {
        switch (measure) {
            case "jaccard":
            case "JaccardIndex":
                return new JaccardIndexComparator();
            case "jw":
            case "JaroWinkler":
                return new H2OJaroWinklerComparator();
            case "lv":
            case "Levenshtein":
                return new LevenshteinDistanceComparator();
            case "lcs":
            case "LongestCommonSubstring":
                return new LongestCommonSubstring();
            case "qgram":
            case "QGram":
                return new QGramComparator();
            case "soundex":
            case "Soundex":
                return new SoundexComparator();
            default:
                throw new IllegalArgumentException("Unknown comparator: " + measure);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy