no.sesat.search.query.analyser
Class AnalysisRule

java.lang.Object
  extended by no.sesat.search.query.analyser.AnalysisRule

public final class AnalysisRule
extends Object

The AnalysisRule provides scoring of a query based on a set of Predicate instances.

Version:
$Id: AnalysisRule.java 7225 2009-04-09 00:32:20Z ssmiweve $

Nested Class Summary
static interface AnalysisRule.Context
           
 
Constructor Summary
AnalysisRule()
           
 
Method Summary
 void addPredicateScore(org.apache.commons.collections.Predicate predicate, int score)
          Adds a Predicate and an accompanying score.
 int evaluate(Query query, AnalysisRule.Context context)
          Evaluates this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisRule

public AnalysisRule()
Method Detail

addPredicateScore

public void addPredicateScore(org.apache.commons.collections.Predicate predicate,
                              int score)
Adds a Predicate and an accompanying score. The predicate will at evaluation time be evaluated with a TokenEvaluationEngine as input.

Parameters:
predicate - a predicate to evaluate at evaluation time.
score - the score associated with the predicate.

evaluate

public int evaluate(Query query,
                    AnalysisRule.Context context)
Evaluates this rule. All added predicates are evaluated using engine as input. The score of those predicates that are true are added to the final score (output of this method).

Parameters:
query - the query to apply the rule to.
context -
Returns:
the score of this rule when applied to query.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.