no.sesat.search.query.token
Interface TokenEvaluator

All Known Implementing Classes:
JepTokenEvaluator, RegExpTokenEvaluator, SolrTokenEvaluator, VeryFastTokenEvaluator

public interface TokenEvaluator

TokenEvaluator works behind a TokenPredicate doing the actual work to prove the predicate true or false. This work is the evaluating process. Each TokenValuator is constructed and obtained through a corresponding AbstractEvaluatorFactory. evaluateToken(TokenPredicate, String, String) is the primary method in the class, but evaluators may also indicate whether the position of words within the query influences evaluation by the isQueryDependant(TokenPredicate) method. And synonyms may also be provided, extending predicates from true|false to being a richer meta data source.

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

Method Summary
 boolean evaluateToken(TokenPredicate token, String term, String query)
          Evaluate the token with regards to query.
 Set<String> getMatchValues(TokenPredicate token, String term)
          Each true evaluation may also provide a synonym (or "match value").
 boolean isQueryDependant(TokenPredicate predicate)
           
 

Method Detail

evaluateToken

boolean evaluateToken(TokenPredicate token,
                      String term,
                      String query)
Evaluate the token with regards to query. This usually means to check if the token occurs in query, but there are other possibilities such as tokens that always evaluates to true.

Parameters:
token -
term - the token to look for.
query -
Returns:
true if token occurs in query

isQueryDependant

boolean isQueryDependant(TokenPredicate predicate)
Parameters:
predicate -
Returns:

getMatchValues

Set<String> getMatchValues(TokenPredicate token,
                           String term)
Each true evaluation may also provide a synonym (or "match value").

Parameters:
token -
term -
Returns:
a list of Tokens


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