no.sesat.search.query.analyser
Class AnalysisRule
java.lang.Object
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 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnalysisRule
public AnalysisRule()
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.