Class StringDistance

java.lang.Object
org.getalp.dbnary.tools.StringDistance

public class StringDistance extends Object
  • Constructor Details

    • StringDistance

      public StringDistance()
  • Method Details

    • suffixChange

      public static String suffixChange(String s, String t)
      return the suffixal change from s to t
      Parameters:
      s - the source String to be changed
      t - the target String result of the change
      Returns:
      the change as a String of form -xxx+yyy where t = s where suffix xxx is stripped out and suffix yyy is appended to the resulting base
    • distanceMatrix

      public static int[][] distanceMatrix(String s, String t, BiFunction<Character, Character, Integer> cost)
    • levenstein

      public static int[][] levenstein(String s, String t)
    • changeSimple

      public static String changeSimple(String form, String operation, int c)
      Parameters:
      form - the form
      operation - the operation to apply
      c - the char
      Returns:
      the resulting form