Class Normalisation

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double averageDocumentLength
      The average document length in the collection.
      protected Idf idf
      The class used for computing the logorithm values.
      protected double Nt
      The document frequency of the term.
      protected double numberOfDocuments
      The number of documents in the whole collection.
      protected double numberOfTokens
      The number of tokens in the whole collection.
      protected double parameter
      The free parameter of the normalisation method.
      protected double termFrequency
      The frequency of the query term in the whole collection.
    • Constructor Summary

      Constructors 
      Constructor Description
      Normalisation()
      The default constructor.
      Normalisation​(double value)
      The constructor that specifies the parameter value.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      Normalisation clone()
      Clone this weighting model
      abstract java.lang.String getInfo()
      This method provides the contract for getting the name of the implemented frequency normalisation method.
      double getParameter()
      Returns the hyper-parameter value.
      abstract double normalise​(double tf, double docLength, double _termFrequency)
      This method provides the contract for implementing the frequency normalisation formula.
      void setAverageDocumentLength​(double value)
      Set the average document length in the collection.
      void setDocumentFrequency​(double nt)  
      void setNumberOfDocuments​(double _numberOfDocuments)  
      void setNumberOfTokens​(double value)
      Set the number of tokens in the collection.
      void setParameter​(double value)
      Specify the free parameter of the implemented frequency normalisation method.
      • Methods inherited from class java.lang.Object

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

      • averageDocumentLength

        protected double averageDocumentLength
        The average document length in the collection.
      • idf

        protected Idf idf
        The class used for computing the logorithm values.
      • termFrequency

        protected double termFrequency
        The frequency of the query term in the whole collection.
      • parameter

        protected double parameter
        The free parameter of the normalisation method.
      • numberOfTokens

        protected double numberOfTokens
        The number of tokens in the whole collection.
      • Nt

        protected double Nt
        The document frequency of the term.
      • numberOfDocuments

        protected double numberOfDocuments
        The number of documents in the whole collection.
    • Constructor Detail

      • Normalisation

        public Normalisation()
        The default constructor.
      • Normalisation

        public Normalisation​(double value)
        The constructor that specifies the parameter value.
        Parameters:
        value - The specified value of the free parameter of the implemented frequency normalisation method.
    • Method Detail

      • clone

        public Normalisation clone()
        Clone this weighting model
        Overrides:
        clone in class java.lang.Object
      • setAverageDocumentLength

        public void setAverageDocumentLength​(double value)
        Set the average document length in the collection.
        Parameters:
        value - The average document length in the collection.
      • setNumberOfTokens

        public void setNumberOfTokens​(double value)
        Set the number of tokens in the collection.
        Parameters:
        value - The number of tokens in the collection.
      • setParameter

        public void setParameter​(double value)
        Specify the free parameter of the implemented frequency normalisation method.
        Parameters:
        value - The specified value of the frequency normalisation parameter.
      • getParameter

        public double getParameter()
        Returns the hyper-parameter value.
        Returns:
        The hyper-parameter value.
      • getInfo

        public abstract java.lang.String getInfo()
        This method provides the contract for getting the name of the implemented frequency normalisation method.
        Returns:
        The name of the implemented frequency normalisation method.
      • normalise

        public abstract double normalise​(double tf,
                                         double docLength,
                                         double _termFrequency)
        This method provides the contract for implementing the frequency normalisation formula.
        Parameters:
        tf - The frequency of the query term in the document.
        docLength - The number of tokens in the document.
        _termFrequency - The frequency of the query term in the collection.
        Returns:
        The normalised term frequency.
      • setDocumentFrequency

        public void setDocumentFrequency​(double nt)
        Parameters:
        nt - the document frequency to set
      • setNumberOfDocuments

        public void setNumberOfDocuments​(double _numberOfDocuments)
        Parameters:
        _numberOfDocuments - the numberOfDocuments to set