Terrier IR Platform
1.1.1

uk.ac.gla.terrier.structures
Class SingleLineTRECQuery

java.lang.Object
  extended by uk.ac.gla.terrier.structures.TRECQuery
      extended by uk.ac.gla.terrier.structures.SingleLineTRECQuery

public class SingleLineTRECQuery
extends TRECQuery

This class can be used to extract batch queries from a simpler format than the TREC format. In particular, this class reads queries, one per line, verbatim from the specified file(s). Empty lines and lines starting with # are ignored. Moreover, it assumes that the first token on each line is the query Id. This can be controlled by the properties SingleLineTRECQuery.queryid.exists (default true). Use this class by specifying trec.topics.parser=SingleLineTRECQuery and running TRECQuerying or TrecTerrier as normal.


Constructor Summary
SingleLineTRECQuery()
          Constructor - default
SingleLineTRECQuery(java.io.File queryfile)
          Reads queries from the specified file
SingleLineTRECQuery(java.lang.String queryfilename)
          Reads querries from the specified filename
 
Method Summary
 boolean extractQuery(java.lang.String queryfilename, java.util.Vector vecStringQueries, java.util.Vector vecStringIds)
          Extracts queries from the specified filename, adding their contents to vecStringQueries and the corresponding query ids to vecStringIds.
 
Methods inherited from class uk.ac.gla.terrier.structures.TRECQuery
getIndexOfCurrentQuery, getNumberOfQueries, getQuery, getQueryId, getTopicFilenames, hasMoreQueries, nextQuery, reset, toArray
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleLineTRECQuery

public SingleLineTRECQuery()
Constructor - default


SingleLineTRECQuery

public SingleLineTRECQuery(java.io.File queryfile)
Reads queries from the specified file


SingleLineTRECQuery

public SingleLineTRECQuery(java.lang.String queryfilename)
Reads querries from the specified filename

Method Detail

extractQuery

public boolean extractQuery(java.lang.String queryfilename,
                            java.util.Vector vecStringQueries,
                            java.util.Vector vecStringIds)
Extracts queries from the specified filename, adding their contents to vecStringQueries and the corresponding query ids to vecStringIds.

Overrides:
extractQuery in class TRECQuery
Parameters:
queryfilename - String the name of a file containing topics.
vecStringQueries - Vector a vector containing the queries as strings.
vecStringIds - Vector a vector containing the query identifiers as strings.
Returns:
true if some queries were successfully read

Terrier IR Platform
1.1.1

Terrier Information Retrieval Platform 1.1.1. Copyright 2004-2007 University of Glasgow