org.egothor.query.runner
Class VectorRunner

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

public class VectorRunner
extends Runner

A VectorRunner can execute a number of Runners concurrently. The Rider given to the constructor reads the inverted lists of documents and each Runner in the group of Runners given to the constructor is able to calculate a document's similarity to the query.Similarity to the query results in the document being added to the Rider's hit list.

This object represents a binary form of set of formulas (clausulas).

Author:
Leo Galambos

Constructor Summary
VectorRunner(Rider r, Runner[] w)
          Constructor for the VectorRunner object.
 
Method Summary
 int evaluate(long uid)
          Return the calculated similarity between the query and the document with the given unique ID..
 java.lang.String invalidReason()
          Return an explanation as to why the search contained in the Runner is invalid.
 void run()
          For all candidates in a rider calculates a similarity and if the similarity is a positive value, then this method calls Rider.accepted(int).
 int terms()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorRunner

public VectorRunner(Rider r,
                    Runner[] w)
Constructor for the VectorRunner object.

Parameters:
r - the Rider which will open the inverted lists
w - the Runners containing the queries
Method Detail

terms

public int terms()
Description of the Method

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

run

public void run()
For all candidates in a rider calculates a similarity and if the similarity is a positive value, then this method calls Rider.accepted(int). If the Rider.accepted(int) method says that it does not need more hits, this method may end early.

Overrides:
run in class Runner

invalidReason

public java.lang.String invalidReason()
Return an explanation as to why the search contained in the Runner is invalid.

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

evaluate

public int evaluate(long uid)
Return the calculated similarity between the query and the document with the given unique ID..

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