de.unidu.is.retrieval.pire.examples
Class PIREExampleUtils

java.lang.Object
  extended byde.unidu.is.retrieval.pire.examples.PIREExampleUtils

public class PIREExampleUtils
extends java.lang.Object

Utility methods for PIRE examples.

Since:
01-Mar-2005
Version:
$Revision: 1.1 $, $Date: 2005/03/01 09:21:33 $
Author:
Henrik Nottelmann

Constructor Summary
PIREExampleUtils()
           
 
Method Summary
static DB createDB()
          Creates and returns a new DB object.
static IR createIR()
          Creates an IR object and sets the examples/ddl.xml schema.
static PIRE createPIRE()
          Creates an PIRE object and sets the attributes "ti" (Text), "au" (Name) and "py" (Year).
static Query getBooleanQuery()
          Returns an example Boolean-style query.
static Query getWSumQuery()
          Returns an example weighted sum query.
static void indexDocuments(PIRE ir)
          Adds example documens to the PIRE index.
static void indexXMLDocuments(IR ir)
          Adds example documens to the IR index.
static void printResult(Retriever retriever, java.util.List result)
          Prints the results to STDOUT.
static void retrieveAndPrint(Retriever retriever, Query query)
          Performs retrieval w.r.t. the specified query, and prints the results to STDOUT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PIREExampleUtils

public PIREExampleUtils()
Method Detail

createDB

public static DB createDB()
Creates and returns a new DB object.

Returns:
DB object

createPIRE

public static PIRE createPIRE()
Creates an PIRE object and sets the attributes "ti" (Text), "au" (Name) and "py" (Year).

Returns:
PIRE object

indexDocuments

public static void indexDocuments(PIRE ir)
Adds example documens to the PIRE index.

Parameters:
ir - PIRE object

createIR

public static IR createIR()
Creates an IR object and sets the examples/ddl.xml schema.

Returns:
IR object

indexXMLDocuments

public static void indexXMLDocuments(IR ir)
                              throws IndexException,
                                     DocumentNotStorableException,
                                     DocumentMismatchException
Adds example documens to the IR index.

Parameters:
ir - IR object
Throws:
IndexException
DocumentNotStorableException
DocumentMismatchException

retrieveAndPrint

public static void retrieveAndPrint(Retriever retriever,
                                    Query query)
                             throws UnsupportedQueryException,
                                    IndexException,
                                    DocumentNotFoundException
Performs retrieval w.r.t. the specified query, and prints the results to STDOUT.

Parameters:
retriever - retrieval object
query - query
Throws:
UnsupportedQueryException
IndexException
DocumentNotFoundException

printResult

public static void printResult(Retriever retriever,
                               java.util.List result)
                        throws DocumentNotFoundException
Prints the results to STDOUT.

Parameters:
retriever - retrieval object
result - result list (items are ProbDoc instances)
Throws:
DocumentNotFoundException

getWSumQuery

public static Query getWSumQuery()
Returns an example weighted sum query.

Returns:
example weighted sum query

getBooleanQuery

public static Query getBooleanQuery()
Returns an example Boolean-style query.

Returns:
example Boolean-style query