public class QueryTool extends Object
Modifier and Type | Field and Description |
---|---|
PrintWriter |
err
Our error writer (if null, output errors to out as well)
|
PrintWriter |
out
Our output writer.
|
Constructor and Description |
---|
QueryTool(BlackLabIndex index,
BufferedReader in,
PrintWriter out,
PrintWriter err)
Construct the query tool object.
|
QueryTool(File indexDir,
BufferedReader in,
PrintWriter out,
PrintWriter err)
Construct the query tool object.
|
QueryTool(File indexDir,
PrintWriter out,
PrintWriter err)
Construct the query tool object.
|
Modifier and Type | Method and Description |
---|---|
void |
commandProcessor()
Parse and execute commands and queries.
|
String |
describeAnnotation(Annotation annotation) |
void |
errprintln(String str) |
static void |
main(String[] args)
The main program.
|
void |
outprint(String str) |
void |
outprintf(String str,
Object... args) |
void |
outprintln(String str) |
void |
processCommand(String fullCmd) |
static void |
runBatch(File indexDir,
File commandFile)
Run the QueryTool in batch mode
|
static void |
runBatch(File indexDir,
File commandFile,
String encoding)
Run the QueryTool in batch mode
|
static void |
runInteractive(File indexDir)
Run the QueryTool in interactive mode
|
static void |
runInteractive(File indexDir,
String encoding)
Run the QueryTool in interactive mode
|
void |
setIndex(BlackLabIndex index)
Switch to a different index.
|
void |
statprintln(String str) |
public PrintWriter out
public PrintWriter err
public QueryTool(BlackLabIndex index, BufferedReader in, PrintWriter out, PrintWriter err) throws org.apache.lucene.index.CorruptIndexException
index
- the index object (our index)in
- where to read commands fromout
- where to write output toerr
- where to write errors toorg.apache.lucene.index.CorruptIndexException
public QueryTool(File indexDir, BufferedReader in, PrintWriter out, PrintWriter err) throws ErrorOpeningIndex
indexDir
- directory our index is inin
- where to read commands fromout
- where to write output toerr
- where to write errors toErrorOpeningIndex
- if we couldn't open the indexpublic QueryTool(File indexDir, PrintWriter out, PrintWriter err) throws ErrorOpeningIndex
indexDir
- directory our index is inout
- the output writer to useerr
- where to write errors toErrorOpeningIndex
- if index could not be openedpublic static void main(String[] args) throws ErrorOpeningIndex
args
- commandline argumentsErrorOpeningIndex
- if index could not be openedpublic static void runBatch(File indexDir, File commandFile, String encoding) throws ErrorOpeningIndex
indexDir
- the index to searchcommandFile
- the command file to executeencoding
- the output encodingErrorOpeningIndex
- if index could not be openedpublic static void runBatch(File indexDir, File commandFile) throws ErrorOpeningIndex
indexDir
- the index to searchcommandFile
- the command file to executeErrorOpeningIndex
public static void runInteractive(File indexDir, String encoding) throws ErrorOpeningIndex
indexDir
- the index to searchencoding
- the output encodingErrorOpeningIndex
- if index could not be openedpublic static void runInteractive(File indexDir) throws ErrorOpeningIndex
indexDir
- the index to searchErrorOpeningIndex
- if index could not be openedpublic void setIndex(BlackLabIndex index)
index
- the new BlackLabIndex to usepublic void commandProcessor()
public void processCommand(String fullCmd)
public String describeAnnotation(Annotation annotation)
public void outprintln(String str)
public void outprint(String str)
public void errprintln(String str)
public void statprintln(String str)
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.