Class GND

All Implemented Interfaces:
NamedWriteable, Writeable, ToXContent, ToXContentFragment

public class GND
extends NXYSignificanceHeuristic
  • Field Details

  • Constructor Details

    • GND

      public GND​(boolean backgroundIsSuperset)
    • GND

      public GND​(StreamInput in) throws java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details

    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class NXYSignificanceHeuristic
      Throws:
      java.io.IOException
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class NXYSignificanceHeuristic
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class NXYSignificanceHeuristic
    • getScore

      public double getScore​(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize)
      Calculates Google Normalized Distance, as described in "The Google Similarity Distance", Cilibrasi and Vitanyi, 2007 link: http://arxiv.org/pdf/cs/0412098v3.pdf
      Specified by:
      getScore in class SignificanceHeuristic
      Parameters:
      subsetFreq - The frequency of the term in the selected sample
      subsetSize - The size of the selected sample (typically number of docs)
      supersetFreq - The frequency of the term in the superset from which the sample was taken
      supersetSize - The size of the superset from which the sample was taken (typically number of docs)
      Returns:
      a "significance" score
    • getWriteableName

      public java.lang.String getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
    • toXContent

      public XContentBuilder toXContent​(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
      Throws:
      java.io.IOException