Class DamerauLevenshteinDistance

java.lang.Object
rs.baselib.util.DamerauLevenshteinDistance
All Implemented Interfaces:
DistanceCalculation

public class DamerauLevenshteinDistance
extends java.lang.Object
implements DistanceCalculation
Since:
1.2.9
Author:
ralph
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static DistanceCalculation INSTANCE
    static instance
  • Constructor Summary

    Constructors 
    Constructor Description
    DamerauLevenshteinDistance()  
  • Method Summary

    Modifier and Type Method Description
    int getDistance​(java.lang.String s1, java.lang.String s2)
    Return the distance according to the algorithm used.
    int[][] getMatrix​(java.lang.String s1, java.lang.String s2)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getDistance

      public int getDistance​(java.lang.String s1, java.lang.String s2)
      Return the distance according to the algorithm used.

      Important! Both strings must not be null.

      Specified by:
      getDistance in interface DistanceCalculation
      Parameters:
      s1 - first string
      s2 - second string
      Returns:
      the distance between two strings
    • getMatrix

      public int[][] getMatrix​(java.lang.String s1, java.lang.String s2)