Terrier IR Platform
2.2.1

uk.ac.gla.terrier.matching.dsms
Class BooleanScoreModifier

java.lang.Object
  extended by uk.ac.gla.terrier.matching.dsms.BooleanScoreModifier
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, DocumentScoreModifier

public class BooleanScoreModifier
extends java.lang.Object
implements DocumentScoreModifier, java.io.Serializable

If not all the query terms appear in a document, then this modifier zeros the document's score.

Version:
$Revision: 1.17 $
Author:
Vassilis Plachouras and Craig Macdonald
See Also:
Serialized Form

Constructor Summary
BooleanScoreModifier()
          An empty default constructor.
BooleanScoreModifier(java.util.ArrayList ts)
          A constructor where we specify which of the query terms should exist in the documents.
 
Method Summary
 java.lang.Object clone()
          Clone this DSM.
 java.lang.String getName()
          Returns the name of the document score modifier.
 boolean modifyScores(Index index, MatchingQueryTerms query, ResultSet resultSet)
          Zeros the scores of documents in which only some of the query terms appear.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanScoreModifier

public BooleanScoreModifier()
An empty default constructor.


BooleanScoreModifier

public BooleanScoreModifier(java.util.ArrayList ts)
A constructor where we specify which of the query terms should exist in the documents.

Parameters:
ts - ArrayList the query terms that should appear in the retrieved documents after applying this modifier.
Method Detail

getName

public java.lang.String getName()
Returns the name of the document score modifier.

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

modifyScores

public boolean modifyScores(Index index,
                            MatchingQueryTerms query,
                            ResultSet resultSet)
Zeros the scores of documents in which only some of the query terms appear.

Specified by:
modifyScores in interface DocumentScoreModifier
Parameters:
index - Index the data structures used for retrieval.
query - TermTreeNode[] the array of the query terms.
resultSet - ResultSet the set of retrieved documents.
Returns:
true if any scores have been altered

clone

public java.lang.Object clone()
Clone this DSM. Note that terms is shall copied.

Specified by:
clone in interface DocumentScoreModifier
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