de.unidu.is.evaluation.trec
Class Queries

java.lang.Object
  extended byde.unidu.is.evaluation.trec.Queries

public class Queries
extends java.lang.Object

A class with only static methods for working with TREC queries.

TREC queries are derived from topic descriptions stored on disk (directory topics relative to the directory specified by the config property trec.path). Each topic description is stored in one file with the name [topic number].

Query ids have the form [topic number] or [topic number]_[modifier], for using different queries (e.g., derived from different fields of the topic description).

At the moment, TREC queries for topics 1 - 150 and 451 - 550 are supported with three different types ("modifiers"):

Since:
2002-04-11
Version:
$Revision: 1.8 $, $Date: 2005/02/25 14:33:29 $
Author:
Henrik Nottelmann

Constructor Summary
Queries()
           
 
Method Summary
static int getLength()
          Returns the minumum token length.
static KeywordQuery getQuery(java.lang.String queryID, java.lang.String attName, java.lang.String operator)
          Returns the query for the specified query id.
static KeywordQuery getQuery(java.lang.String queryID, java.lang.String postfix, java.lang.String attName, java.lang.String operator)
          Returns the query for the specified query id with the specified postfix.
static java.lang.String getQueryModifier(java.lang.String queryID)
          Returns the TREC query modifier for the specified query id (without the query topic number).
static java.util.List getQueryTerms(java.lang.String queryID)
          Returns the query terms together with the term frequencies in the specified query.
static int getQueryTopic(java.lang.String queryID)
          Returns the TREC query topic for the specified query id, removing a query modifier.
protected static java.util.List getTF(java.lang.String terms)
          Returns the query terms together with the term frequencies in the specified string.
static XIRQLQuery getXIRQLQuery(java.lang.String queryID, java.lang.String attName, java.lang.String operator)
          Returns the query for the specified query id.
static XIRQLQuery getXIRQLQuery(java.lang.String queryID, java.lang.String postfix, java.lang.String attName, java.lang.String operator)
          Returns the query for the specified query id with the specified postfix.
static void setLength(int length)
          Sets the minumum token length.
static void setTopicDir(java.io.File topicDir)
          Sets the directory with the topic files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queries

public Queries()
Method Detail

setTopicDir

public static void setTopicDir(java.io.File topicDir)
Sets the directory with the topic files.

Parameters:
topicDir - directory with topic files.

getQueryTopic

public static int getQueryTopic(java.lang.String queryID)
Returns the TREC query topic for the specified query id, removing a query modifier.

Parameters:
queryID - query id
Returns:
TREC query topic

getQueryModifier

public static java.lang.String getQueryModifier(java.lang.String queryID)
Returns the TREC query modifier for the specified query id (without the query topic number).

Parameters:
queryID - query id
Returns:
TREC query modifier

getQueryTerms

public static java.util.List getQueryTerms(java.lang.String queryID)
Returns the query terms together with the term frequencies in the specified query.

Parameters:
queryID - query id
Returns:
list of tuples (0: term, 1: tf)

getTF

protected static java.util.List getTF(java.lang.String terms)
Returns the query terms together with the term frequencies in the specified string.

Parameters:
terms - query terms, separated by spaces
Returns:
list of tuples (0: term, 1: tf)

getQuery

public static KeywordQuery getQuery(java.lang.String queryID,
                                    java.lang.String attName,
                                    java.lang.String operator)
Returns the query for the specified query id.

Parameters:
queryID - query id
attName - attribute (schema element or alias) name
operator - operator name
Returns:
query

getQuery

public static KeywordQuery getQuery(java.lang.String queryID,
                                    java.lang.String postfix,
                                    java.lang.String attName,
                                    java.lang.String operator)
Returns the query for the specified query id with the specified postfix.

Parameters:
queryID - query id
postfix - query postfix, may be null
attName - attribute (schema element or alias) name
operator - operator name
Returns:
query

getXIRQLQuery

public static XIRQLQuery getXIRQLQuery(java.lang.String queryID,
                                       java.lang.String postfix,
                                       java.lang.String attName,
                                       java.lang.String operator)
Returns the query for the specified query id with the specified postfix.

Parameters:
queryID - query id
postfix - query postfix, may be null
attName - attribute (schema element or alias) name
operator - operator name
Returns:
query

getXIRQLQuery

public static XIRQLQuery getXIRQLQuery(java.lang.String queryID,
                                       java.lang.String attName,
                                       java.lang.String operator)
Returns the query for the specified query id.

Parameters:
queryID - query id
attName - attribute (schema element or alias) name
operator - operator name
Returns:
query

getLength

public static int getLength()
Returns the minumum token length.

Returns:
minumum token length

setLength

public static void setLength(int length)
Sets the minumum token length.

Parameters:
length - minumum token length