org.terrier.applications
Class InteractiveQuerying

java.lang.Object
  extended by org.terrier.applications.InteractiveQuerying

public class InteractiveQuerying
extends java.lang.Object

This class performs interactive querying at the command line. It asks for a query on Standard Input, and then displays the document IDs that match the given query.

Properties:

Author:
Gianni Amati, Vassilis Plachouras, Ben He, Craig Macdonald

Field Summary
protected  Index index
          The data structures used.
protected static org.apache.log4j.Logger logger
          The logger used
protected static boolean lowercase
          Change to lowercase?
protected  java.lang.String managerName
          The name of the manager object that handles the queries.
protected  int matchingCount
          the number of processed queries.
protected  java.lang.String[] metaKeys
           
protected  java.lang.String mModel
          The matching model used.
protected  Manager queryingManager
          The query manager.
protected  java.io.PrintWriter resultFile
          The file to store the output to.
protected static int RESULTS_LENGTH
          The maximum number of presented results.
protected  boolean verbose
          display user prompts
protected  java.lang.String wModel
          The weighting model used.
 
Constructor Summary
InteractiveQuerying()
          A default constructor initialises the index, and the Manager.
 
Method Summary
 void close()
          Closes the used structures.
protected  void createManager()
          Create a querying manager.
protected  void loadIndex()
          Loads index(s) from disk.
static void main(java.lang.String[] args)
          Starts the interactive query application.
 void printResults(java.io.PrintWriter pw, SearchRequest q)
          Prints the results
 void processQueries(double cParameter)
          Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism.
 void processQuery(java.lang.String queryId, java.lang.String query, double cParameter)
          According to the given parameters, it sets up the correct matching class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
The logger used


lowercase

protected static final boolean lowercase
Change to lowercase?


verbose

protected boolean verbose
display user prompts


matchingCount

protected int matchingCount
the number of processed queries.


resultFile

protected java.io.PrintWriter resultFile
The file to store the output to.


managerName

protected java.lang.String managerName
The name of the manager object that handles the queries. Set by property trec.manager, defaults to Manager.


queryingManager

protected Manager queryingManager
The query manager.


wModel

protected java.lang.String wModel
The weighting model used.


mModel

protected java.lang.String mModel
The matching model used.


index

protected Index index
The data structures used.


RESULTS_LENGTH

protected static int RESULTS_LENGTH
The maximum number of presented results.


metaKeys

protected java.lang.String[] metaKeys
Constructor Detail

InteractiveQuerying

public InteractiveQuerying()
A default constructor initialises the index, and the Manager.

Method Detail

createManager

protected void createManager()
Create a querying manager. This method should be overriden if another matching model is required.


loadIndex

protected void loadIndex()
Loads index(s) from disk.


close

public void close()
Closes the used structures.


processQuery

public void processQuery(java.lang.String queryId,
                         java.lang.String query,
                         double cParameter)
According to the given parameters, it sets up the correct matching class.

Parameters:
queryId - String the query identifier to use.
query - String the query to process.
cParameter - double the value of the parameter to use.

processQueries

public void processQueries(double cParameter)
Performs the matching using the specified weighting model from the setup and possibly a combination of evidence mechanism. It parses the file with the queries (the name of the file is defined in the address_query file), creates the file of results, and for each query, gets the relevant documents, scores them, and outputs the results to the result file.

Parameters:
cParameter - the value of c

printResults

public void printResults(java.io.PrintWriter pw,
                         SearchRequest q)
                  throws java.io.IOException
Prints the results

Parameters:
pw - PrintWriter the file to write the results to.
q - SearchRequest the search request to get results from.
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Starts the interactive query application.

Parameters:
args - the command line arguments.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow