use of gate.creole.ExecutionException in project gate-core by GateNLP.
the class CorpusBenchmarkTool method processDocument.
// evaluateMarkedClean
protected void processDocument(Document doc) {
try {
if (application instanceof CorpusController) {
Corpus tempCorpus = Factory.newCorpus("temp");
tempCorpus.add(doc);
((CorpusController) application).setCorpus(tempCorpus);
application.execute();
Factory.deleteResource(tempCorpus);
tempCorpus = null;
} else {
Iterator<ProcessingResource> iter = application.getPRs().iterator();
while (iter.hasNext()) iter.next().setParameterValue("document", doc);
application.execute();
}
} catch (ResourceInstantiationException ex) {
throw (RuntimeException) new RuntimeException("Error executing application: " + ex.getMessage()).initCause(ex);
} catch (ExecutionException ex) {
throw (RuntimeException) new RuntimeException("Error executing application: " + ex.getMessage()).initCause(ex);
}
}
Aggregations