public class Batch extends Object implements JapeConstants, Benchmarkable
ALL_STYLE, APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING
Constructor and Description |
---|
Batch(URL url,
String encoding)
Create a fully initialised instance.
|
Batch(URL url,
String encoding,
StatusListener sListener) |
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(ProgressListener l) |
void |
addStatusListener(StatusListener l) |
void |
finalize() |
protected void |
fireProcessFinished() |
protected void |
fireProgressChanged(int e) |
protected void |
fireStatusChanged(String e) |
String |
getBenchmarkId()
Returns the benchmark ID of this resource.
|
FeatureMap |
getFeatures() |
Transducer |
getTransducer()
Get the transducer.
|
void |
interrupt()
Notifies this PR that it should stop its execution as soon as possible.
|
boolean |
isEnableDebugging() |
protected void |
linkListeners()
Creates inner listeners that forward events from the transducer object to
our own listeners.
|
void |
removeProgressListener(ProgressListener l) |
void |
removeStatusListener(StatusListener l) |
void |
runControllerExecutionAbortedBlock(ActionContext ac,
Controller c,
Throwable t,
Ontology o) |
void |
runControllerExecutionFinishedBlock(ActionContext ac,
Controller c,
Ontology o) |
void |
runControllerExecutionStartedBlock(ActionContext ac,
Controller c,
Ontology o) |
void |
setActionContext(ActionContext ac) |
void |
setBenchmarkId(String benchmarkId)
This method sets the benchmarkID for this resource.
|
void |
setEnableDebugging(boolean enableDebugging) |
void |
setFeatures(FeatureMap newFeatures) |
void |
setOntology(Ontology ontology)
Sets the ontology to be used by the transducers
|
void |
transduce(Corpus coll)
Process the given collection.
|
void |
transduce(Document doc)
Process a single document.
|
void |
transduce(Document doc,
AnnotationSet inputAS,
AnnotationSet outputAS)
Process a single document.
|
public Batch(URL url, String encoding) throws JapeException
japeFileName
: the name of a .jape or .ser transducer file.
This may be an absolute path, or may a .jar that lives somewhere on the
classpath.
JapeException
public Batch(URL url, String encoding, StatusListener sListener) throws JapeException
JapeException
public void setActionContext(ActionContext ac)
protected void linkListeners()
public void interrupt()
public Transducer getTransducer()
public void transduce(Corpus coll) throws JapeException, ExecutionException
JapeException
ExecutionException
public void transduce(Document doc) throws JapeException, ExecutionException
JapeException
ExecutionException
public void transduce(Document doc, AnnotationSet inputAS, AnnotationSet outputAS) throws JapeException, ExecutionException
JapeException
ExecutionException
public void setFeatures(FeatureMap newFeatures)
public FeatureMap getFeatures()
public void removeProgressListener(ProgressListener l)
public void addProgressListener(ProgressListener l)
protected void fireProgressChanged(int e)
protected void fireProcessFinished()
public void removeStatusListener(StatusListener l)
public void addStatusListener(StatusListener l)
protected void fireStatusChanged(String e)
public void setOntology(Ontology ontology)
ontology
- public boolean isEnableDebugging()
public void setEnableDebugging(boolean enableDebugging)
public String getBenchmarkId()
Benchmarkable
getBenchmarkId
in interface Benchmarkable
public void setBenchmarkId(String benchmarkId)
Benchmarkable
setBenchmarkId
in interface Benchmarkable
benchmarkId
- the benchmark ID, which must not contain spaces
as it is already used as a separator in the log, you can use
Benchmark.createBenchmarkId(String, String)
for it.public void runControllerExecutionAbortedBlock(ActionContext ac, Controller c, Throwable t, Ontology o) throws ExecutionException
ExecutionException
public void runControllerExecutionFinishedBlock(ActionContext ac, Controller c, Ontology o) throws ExecutionException
ExecutionException
public void runControllerExecutionStartedBlock(ActionContext ac, Controller c, Ontology o) throws ExecutionException
ExecutionException