org.egothor.query.runner
Class TermRunner

java.lang.Object
  extended by org.egothor.core.query.Runner
      extended by org.egothor.query.runner.TermRunner
Direct Known Subclasses:
TermRunner

public class TermRunner
extends Runner

The TermRunner object represents a binary form of a query that consists of one term.

Author:
Leo Galambos

Constructor Summary
TermRunner(double idf, Rider r, java.lang.String field, Token token, int boost, boolean req, boolean proh)
          Constructor for the TermRunner object
TermRunner(IListWasher washer, double idf, Rider r, java.lang.String field, Token token, int boost, boolean req, boolean proh)
          Constructor for the TermRunner object.
 
Method Summary
 int evaluate(long uid)
          Return the calculated similarity.
 Proximities getProx()
          Return a Proximities object which gives access to the proximities inverted list for the head item in the list.
 java.lang.String invalidReason()
          Return an explanation as to why this search is invalid.
 int terms()
          Description of the Method
 
Methods inherited from class org.egothor.core.query.Runner
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermRunner

public TermRunner(IListWasher washer,
                  double idf,
                  Rider r,
                  java.lang.String field,
                  Token token,
                  int boost,
                  boolean req,
                  boolean proh)
Constructor for the TermRunner object. This object is constructed for a rider r, and a term that is in the given field , its token type is name , and its text is text .

Parameters:
washer - Description of the Parameter
idf - the inverse document frequency
r - the Rider used by this Runner
field - Description of the Parameter
token - the token describing the search term
boost - Description of the Parameter
req - Description of the Parameter
proh - Description of the Parameter

TermRunner

public TermRunner(double idf,
                  Rider r,
                  java.lang.String field,
                  Token token,
                  int boost,
                  boolean req,
                  boolean proh)
Constructor for the TermRunner object

Parameters:
idf - Description of the Parameter
r - Description of the Parameter
field - Description of the Parameter
token - Description of the Parameter
boost - Description of the Parameter
req - Description of the Parameter
proh - Description of the Parameter
Method Detail

getProx

public Proximities getProx()
Return a Proximities object which gives access to the proximities inverted list for the head item in the list.

Returns:
null if the list is already fully read or its idf is 0, otherwise it opens the Proximity list for the head item of the list.

terms

public int terms()
Description of the Method

Specified by:
terms in class Runner
Returns:
Description of the Return Value

invalidReason

public java.lang.String invalidReason()
Return an explanation as to why this search is invalid.

Specified by:
invalidReason in class Runner
Returns:
a String containing an explanation

evaluate

public int evaluate(long uid)
Return the calculated similarity. When the current document is not uid , then it returns 0. Otherwise is calculates the similarity as 1+w*idf . More details can be found in the Runner class entry.

Specified by:
evaluate in class Runner
Parameters:
uid - the unique ID of the document
Returns:
the similarity