Class Sift4

  • All Implemented Interfaces:
    StringDistance, java.io.Serializable

    public class Sift4
    extends java.lang.Object
    implements StringDistance
    Sift4 - a general purpose string distance algorithm inspired by JaroWinkler and Longest Common Subsequence. Original JavaScript algorithm by siderite, java port by Nathan Fischer 2016. https://siderite.dev/blog/super-fast-and-accurate-string-distance.html https://blackdoor.github.io/blog/sift4-java/
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Sift4()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distance​(java.lang.String s1, java.lang.String s2)
      Sift4 - a general purpose string distance algorithm inspired by JaroWinkler and Longest Common Subsequence.
      void setMaxOffset​(int max_offset)
      Set the maximum distance to search for character transposition.
      • Methods inherited from class java.lang.Object

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

      • max_offset

        private int max_offset
    • Constructor Detail

      • Sift4

        public Sift4()
    • Method Detail

      • setMaxOffset

        public final void setMaxOffset​(int max_offset)
        Set the maximum distance to search for character transposition. Compute cost of algorithm is O(n . max_offset)
        Parameters:
        max_offset -
      • distance

        public final double distance​(java.lang.String s1,
                                     java.lang.String s2)
        Sift4 - a general purpose string distance algorithm inspired by JaroWinkler and Longest Common Subsequence. Original JavaScript algorithm by siderite, java port by Nathan Fischer 2016. https://siderite.dev/blog/super-fast-and-accurate-string-distance.html https://blackdoor.github.io/blog/sift4-java/
        Specified by:
        distance in interface StringDistance
        Parameters:
        s1 -
        s2 -
        Returns: