Class EditDistance

java.lang.Object
org.languagetool.rules.spelling.symspell.implementation.EditDistance

public class EditDistance extends Object
  • Constructor Details

    • EditDistance

      public EditDistance(String baseString, EditDistance.DistanceAlgorithm algorithm)
      Create a new EditDistance object. The base string to which other strings will be compared. The desired edit distance algorithm.
  • Method Details

    • compare

      public int compare(String string2, int maxDistance)

      using the previously selected algorithm.

      The string to compare. The maximum distance allowed. The edit distance (or -1 if maxDistance exceeded).
    • DamerauLevenshteinDistance

      public int DamerauLevenshteinDistance(String string2, int maxDistance)
      String being compared for distance. String being compared against other string. The maximum edit distance of interest. int edit distance, >= 0 representing the number of edits required to transform one string to the other, or -1 if the distance is greater than the specified maxDistance.