de.uni_tuebingen.sfb.lichtenstein.binarytrees
Class Query

java.lang.Object
  extended by de.uni_tuebingen.sfb.lichtenstein.binarytrees.Query

public class Query
extends Object

A query contains the information to query a tree bank. It receives a formula and a tree bank and evaluates that formula on the tree bank.

Author:
Stephan Kepser, Hendrik Maryns

Constructor Summary
Query(Formula formula, String treeBank, File corporaDirectory, File monaFileDirectory)
          Initialize a Query in the given tree bank with the given formula.
 
Method Summary
 Formula getFormula()
          Get the formula being queried.
 List<Sentence> query()
          Perform the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Query

public Query(Formula formula,
             String treeBank,
             File corporaDirectory,
             File monaFileDirectory)
Initialize a Query in the given tree bank with the given formula.

Parameters:
formula - The formula to look for in the tree bank.
treeBank - The tree bank to query. Must not contain a file extension.
corporaDirectory - The directory where preprocessed corpora can be found.
monaFileDirectory - The directory where mona files and automata should be stored.
Method Detail

getFormula

public Formula getFormula()
Get the formula being queried.

Returns:
The formula.

query

public List<Sentence> query()
                     throws IOException,
                            ClassNotFoundException
Perform the query.

Returns:
A list of IDs of trees satisfying the query.
Throws:
IOException - [CAN] If the binary tree object file cannot be found, or the usual I/O trouble.
ClassNotFoundException - [CAN] If the class BinaryTree cannot be found.
InterruptedException - [CAN] If something goes wrong with the interprocess communication.
ClassNotFoundException - [CAN] If the class BinaryTree cannot be found.


© Copyright 2008 Hendrik Maryns   Creative Commons License