Class EditDistance


  • public class EditDistance
    extends java.lang.Object
    Calculates Levenshtein distance and corresponding edit path between two character sequences. Inspired from: http://etorreborre.blogspot.com/2008/06/edit-distance-in-scala_245.html Ideas for improvements: - Favor fewer EditOperationS when calculating distance and/or path - Use algorithm with lower time and/or space complexity
    Author:
    Peter Niederwieser
    • Constructor Detail

      • EditDistance

        public EditDistance​(java.lang.CharSequence seq1,
                            java.lang.CharSequence seq2)
    • Method Detail

      • getMatrix

        public int[][] getMatrix()
      • getDistance

        public int getDistance()
      • getSimilarityInPercent

        public int getSimilarityInPercent()
      • calculatePath

        public java.util.List<EditOperation> calculatePath()