de.unidu.is.retrieval.pire.dt
Class NumberDT

java.lang.Object
  extended byde.unidu.is.retrieval.pire.dt.AbstractDT
      extended byde.unidu.is.retrieval.pire.dt.NumberDT
All Implemented Interfaces:
DT
Direct Known Subclasses:
YearDT

public class NumberDT
extends AbstractDT

A class for the IR datatype "number", containing the deterministic operators "<", "<=", ">", ">=" and the vague operators "~<", "~>" and "~=". The identity mapping function is used for the deterministic operators, a logistic function for the vague ones.

Since:
2004-01-05
Version:
$Revision: 1.12 $, $Date: 2005/03/14 17:33:13 $
Author:
Henrik Nottelmann

Constructor Summary
NumberDT()
           
 
Method Summary
 void addRSVRules(Index index, java.lang.String queryID, java.lang.String subqueryID, java.lang.String operator, double weight, java.lang.Object value, java.util.List addList)
          Adds and evaluates a query condition.
 java.lang.String convertOperator(java.lang.String operator)
          Converts the operator name into an identifier.
protected  Filter getFilter(java.lang.String operator)
          Returns a filter for converting a document value into tokens/token frequency tuples.
 java.util.Iterator getIndexTokens(Index index, java.lang.String operator)
          Returns an iterator over all tokens for whom the indexing weight moments have to be computed.
 java.lang.String getProbsTemplate(Index index, java.lang.String queryID, java.lang.String subqueryID, java.lang.String operator)
          Returns a template for computing probabilities of relevance.
protected  Filter getQueryFilter(java.lang.String operator)
          Returns a filter for converting a condition comparison value into tokens/token frequency tuples.
protected  boolean includesEqual(java.lang.String operator)
          Tests whether the specified operator contains a "equals" component.
protected  boolean includesGreater(java.lang.String operator)
          Tests whether the specified operator contains a "greater than" component.
protected  boolean includesLess(java.lang.String operator)
          Tests whether the specified operator contains a "less than" component.
protected  boolean isVague(java.lang.String operator)
          Tests whether the specified operator is a vague operator.
 boolean storedRSVs(java.lang.String operator)
          Tests whether the RSVs are already stored in the weight table, or if they are computed from outside.
 
Methods inherited from class de.unidu.is.retrieval.pire.dt.AbstractDT
addProbRules, addToIndex, computeIndex, removeIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberDT

public NumberDT()
Method Detail

getFilter

protected Filter getFilter(java.lang.String operator)
Returns a filter for converting a document value into tokens/token frequency tuples.

Specified by:
getFilter in class AbstractDT
Parameters:
operator - operator name
Returns:
filter

getQueryFilter

protected Filter getQueryFilter(java.lang.String operator)
Returns a filter for converting a condition comparison value into tokens/token frequency tuples.

Specified by:
getQueryFilter in class AbstractDT
Parameters:
operator - operator name
Returns:
filter

convertOperator

public java.lang.String convertOperator(java.lang.String operator)
Converts the operator name into an identifier.

This implementation returns the operator name. Subclasses can override this behaviour.

Specified by:
convertOperator in interface DT
Overrides:
convertOperator in class AbstractDT
Parameters:
operator - operator name
Returns:
identifier for operator

getIndexTokens

public java.util.Iterator getIndexTokens(Index index,
                                         java.lang.String operator)
Description copied from class: AbstractDT
Returns an iterator over all tokens for whom the indexing weight moments have to be computed.

The default implementation returns null, specifying that all tokens which stored in the index should be used. Other implementations can override this behaviour. TODO: really useful?

Specified by:
getIndexTokens in interface DT
Overrides:
getIndexTokens in class AbstractDT
Parameters:
index - underlying index
operator - operator name
Returns:
iterator over all tokens

includesLess

protected boolean includesLess(java.lang.String operator)
Tests whether the specified operator contains a "less than" component.

Parameters:
operator - search operator
Returns:
true iff the specified operator contains a "less than" component

includesGreater

protected boolean includesGreater(java.lang.String operator)
Tests whether the specified operator contains a "greater than" component.

Parameters:
operator - search operator
Returns:
true iff the specified operator contains a "greater than" component

includesEqual

protected boolean includesEqual(java.lang.String operator)
Tests whether the specified operator contains a "equals" component.

Parameters:
operator - search operator
Returns:
true iff the specified operator contains a "equals" component

isVague

protected boolean isVague(java.lang.String operator)
Tests whether the specified operator is a vague operator.

Parameters:
operator - search operator
Returns:
true iff the specified operator is a vague operator

storedRSVs

public boolean storedRSVs(java.lang.String operator)
Tests whether the RSVs are already stored in the weight table, or if they are computed from outside.

Specified by:
storedRSVs in interface DT
Overrides:
storedRSVs in class AbstractDT
Parameters:
operator - search operator
Returns:
true, if the RSVs are already stored

addRSVRules

public void addRSVRules(Index index,
                        java.lang.String queryID,
                        java.lang.String subqueryID,
                        java.lang.String operator,
                        double weight,
                        java.lang.Object value,
                        java.util.List addList)
Adds and evaluates a query condition.

Specified by:
addRSVRules in interface DT
Overrides:
addRSVRules in class AbstractDT
Parameters:
index - underlying index
queryID - query id
subqueryID - subquery id
operator - search operator
weight - condition weight
value - comparison value
addList - list to where the condition has to be added

getProbsTemplate

public java.lang.String getProbsTemplate(Index index,
                                         java.lang.String queryID,
                                         java.lang.String subqueryID,
                                         java.lang.String operator)
Returns a template for computing probabilities of relevance.

The template string is an expression which contains the key ${PROB}.

Overrides:
getProbsTemplate in class AbstractDT
Parameters:
index - underlying index
queryID - query id
operator - operator name
subqueryID - subquery id
Returns:
template for computing probabilities of relevance