org.egothor.query.runner
Class PhraseRunner

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

public class PhraseRunner
extends Runner

The PhraseRunner class is used when a user wishes to make a query involving two terms where the 2nd term must lie within n words of the 1st . For example, a user might wish to view documents where BASS lies within 2 words of GUITAR. This query would be given in the form:

(BASS 2 GUITAR) (the parentheses are required).

Author:
Leo Galambos

Field Summary
 PhraseScan scanner
          Description of the Field
 TermRunner[] set
          Description of the Field
 
Constructor Summary
PhraseRunner(TermRunner[] a)
          Constructor for the PhraseRunner object
 
Method Summary
 int evaluate(long uid)
          Return the similarity of this object to the document with the given unique ID.
 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
 

Field Detail

set

public TermRunner[] set
Description of the Field


scanner

public PhraseScan scanner
Description of the Field

Constructor Detail

PhraseRunner

public PhraseRunner(TermRunner[] a)
Constructor for the PhraseRunner object

Parameters:
a - the Runner array
Method Detail

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 similarity of this object to the document with the given unique ID. When any of formula variables returns non-positive value, then the evaluation is 0.

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