Class JaccardDistance

  • All Implemented Interfaces:
    EditDistance<java.lang.Double>, SimilarityScore<java.lang.Double>

    public class JaccardDistance
    extends java.lang.Object
    implements EditDistance<java.lang.Double>
    Measures the Jaccard distance of two sets of character sequence. Jaccard distance is the dissimilarity between two sets. It is the complementary of Jaccard similarity.

    For further explanation about Jaccard Distance, refer https://en.wikipedia.org/wiki/Jaccard_index

    Since:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      JaccardDistance()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Double apply​(java.lang.CharSequence left, java.lang.CharSequence right)
      Calculates Jaccard distance of two set character sequence passed as input.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JaccardDistance

        public JaccardDistance()
    • Method Detail

      • apply

        public java.lang.Double apply​(java.lang.CharSequence left,
                                      java.lang.CharSequence right)
        Calculates Jaccard distance of two set character sequence passed as input. Calculates Jaccard similarity and returns the complement of it.
        Specified by:
        apply in interface EditDistance<java.lang.Double>
        Specified by:
        apply in interface SimilarityScore<java.lang.Double>
        Parameters:
        left - first character sequence
        right - second character sequence
        Returns:
        index
        Throws:
        java.lang.IllegalArgumentException - if either String input null