Terrier IR Platform
2.2.1

uk.ac.gla.terrier.matching.tsms
Class RequiredTermModifier

java.lang.Object
  extended by uk.ac.gla.terrier.matching.tsms.RequiredTermModifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, TermScoreModifier

public class RequiredTermModifier
extends java.lang.Object
implements TermScoreModifier, java.io.Serializable

Resets the scores of documents according to whether a term is required or not, and whether it appears in the retrieved documents. This class implements the TermScoreModifier interface.

Version:
$Revision: 1.13 $
Author:
Vassilis Plachouras
See Also:
Serialized Form

Constructor Summary
RequiredTermModifier(boolean r)
          Constructs an instance of a TermInFieldModifier given the requirement that the term should, or should not appear in the query.
 
Method Summary
 java.lang.Object clone()
          Return a clone of this object (deep copy).
 java.lang.String getName()
          Returns the name of the modifier.
 int hashCode()
           
 int modifyScores(double[] scores, int[][] pointers)
          Resets the scores of documents for a particular term, based on the requirement of appearance of the corresponding term.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequiredTermModifier

public RequiredTermModifier(boolean r)
Constructs an instance of a TermInFieldModifier given the requirement that the term should, or should not appear in the query.

Parameters:
r - boolean indicates whether the term is required to appear in the retrieved documents.
Method Detail

modifyScores

public int modifyScores(double[] scores,
                        int[][] pointers)
Resets the scores of documents for a particular term, based on the requirement of appearance of the corresponding term.

Specified by:
modifyScores in interface TermScoreModifier
Parameters:
scores - double[] the scores of the documents.
pointers - int[][] the pointers read from the inverted file for a particular query term.
Returns:
the number of documents for which the scores were modified.

getName

public java.lang.String getName()
Description copied from interface: TermScoreModifier
Returns the name of the modifier.

Specified by:
getName in interface TermScoreModifier
Returns:
String the name of the modifier.

hashCode

public int hashCode()
Specified by:
hashCode in interface TermScoreModifier
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Description copied from interface: TermScoreModifier
Return a clone of this object (deep copy).

Specified by:
clone in interface TermScoreModifier
Overrides:
clone in class java.lang.Object

Terrier IR Platform
2.2.1

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