Terrier IR Platform
2.2.1

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

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

public class TermInFieldModifier
extends java.lang.Object
implements TermScoreModifier

Resets the scores of documents according to whether a term appears in a given set of fields. This class implements the TermScoreModifier interface.

Version:
$Revision: 1.11 $
Author:
Vassilis Plachouras

Constructor Summary
TermInFieldModifier(java.lang.String field)
          Constructs an instance of a TermInFieldModifier given a field that the corresponding query term should appear in.
TermInFieldModifier(java.lang.String field, boolean req)
          Constructs an instance of a TermInFieldModifier given a field that the corresponding query term should appear in.
 
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 modifyScores(double[] scores, int[][] pointers)
          Resets the scores of documents for a particular term, based on the fields a term appears in documents.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.gla.terrier.matching.tsms.TermScoreModifier
hashCode
 

Constructor Detail

TermInFieldModifier

public TermInFieldModifier(java.lang.String field)
Constructs an instance of a TermInFieldModifier given a field that the corresponding query term should appear in.

Parameters:
field - String a field

TermInFieldModifier

public TermInFieldModifier(java.lang.String field,
                           boolean req)
Constructs an instance of a TermInFieldModifier given a field that the corresponding query term should appear in.

Parameters:
field - String a field
req - boolean the requirement for this field. If req is true, then the term is required to appear in the field (this is the default behaviour), otherwise the term should not appear in the field.
Method Detail

modifyScores

public int modifyScores(double[] scores,
                        int[][] pointers)
Resets the scores of documents for a particular term, based on the fields a term appears in documents.

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.

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