org.apache.commons.text.similarity

## Class JaccardDistance

- java.lang.Object
- - org.apache.commons.text.similarity.JaccardDistance

- All Implemented Interfaces:
    EditDistance<Double>, SimilarityScore<Double>

      public class JaccardDistance
      extends Object
      implements EditDistance<Double>

  Measures the Jaccard distance of two sets of character sequence. Jaccard distance is the dissimilarity between two sets. Its 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 and Description
    `JaccardDistance()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Double` | `apply(CharSequence left, CharSequence right)` Calculates Jaccard distance of two set character sequence passed as input.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JaccardDistance

          public JaccardDistance()

  - ### Method Detail

    - #### apply

          public Double apply(CharSequence left,
                              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<Double>`
      Specified by:
        `apply` in interface `SimilarityScore<Double>`
      Parameters:
        `left` - first character sequence
        `right` - second character sequence
      Returns:
        index
      Throws:
        `IllegalArgumentException` - if either String input `null`

Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.