Class Levenshtein


  • public final class Levenshtein
    extends Object
    Simple implementation of the Levenshtein distance algorithm for calculating Levenshtein distance or a Levenshtein-based string similarity.

    This class provides three overloaded methods for String, CharSequence and char[].
    A constant Similator function object as well as static convenience methods are provided as well.

    • Constructor Detail

      • Levenshtein

        public Levenshtein()
    • Method Detail

      • similiarity

        public static final double similiarity​(String a,
                                               String b)
      • upperCaseSimiliarity

        public static final double upperCaseSimiliarity​(String a,
                                                        String b)
      • charDistance

        public static final float charDistance​(char a,
                                               char b)
      • substringSimilarity

        public static final double substringSimilarity​(String s1,
                                                       String s2)
      • distance

        public static final float distance​(char[] a,
                                           char[] b,
                                           _charDistance costFunction)
      • similarity

        public static final float similarity​(char[] a,
                                             char[] b,
                                             _charDistance costFunction)
      • similarity

        public static final float similarity​(String a,
                                             String b)
      • similarity

        public static final float similarity​(char[] a,
                                             char[] b)