Terrier IR Platform
2.2.1

uk.ac.gla.terrier.matching.models.normalisation
Class Normalisation

java.lang.Object
  extended by uk.ac.gla.terrier.matching.models.normalisation.Normalisation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Normalisation0, Normalisation2, Normalisation2exp, Normalisation3, NormalisationB, NormalisationStatic

public abstract class Normalisation
extends java.lang.Object
implements java.io.Serializable

This class provides a contract for implementing frequency normalisation methods. Properties

Version:
$Revision: 1.11 $
Author:
Ben He
See Also:
Serialized Form

Constructor Summary
Normalisation()
          The default constructor.
Normalisation(double value)
          The constructor that specifies the parameter value.
 
Method Summary
 void disableFieldRetrieval()
           
 void enableFieldRetrieval()
           
 double getFieldWeight()
          Returns the weight of the field for field retrieval.
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 setFieldWeight(double value)
          This method sets the weight of a field.
 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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.

setFieldWeight

public void setFieldWeight(double value)
This method sets the weight of a field. The final normalised frequency is the product of the normalised frequency with the weight.

Parameters:
value - The weight of the field.

enableFieldRetrieval

public void enableFieldRetrieval()

disableFieldRetrieval

public void disableFieldRetrieval()

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.

getFieldWeight

public double getFieldWeight()
Returns the weight of the field for field retrieval.

Returns:
The weight of the field.

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

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow