@Override public void controllerExecutionAborted(Controller c, Throwable t) throws ExecutionException { batch.runControllerExecutionAbortedBlock(actionContext, c, t, ontology); actionContext.setCorpus(null); actionContext.setController(null); actionContext.setPR(null); }
@Override public void controllerExecutionFinished(Controller c) throws ExecutionException { batch.runControllerExecutionFinishedBlock(actionContext, c, ontology); actionContext.setCorpus(null); actionContext.setController(null); actionContext.setPR(null); }
// methods implemeting ControllerAwarePR @Override public void controllerExecutionStarted(Controller c) throws ExecutionException { actionContext.setController(c); actionContext.setCorpus(corpus); actionContext.setPRFeatures(features); actionContext.setPRName(this.getName()); actionContext.setPR(this); actionContext.setDebuggingEnabled(enableDebugging); batch.runControllerExecutionStartedBlock(actionContext, c, ontology); }
/** * Implementation of the run() method from {@link java.lang.Runnable}. This method is responsible * for doing all the processing of the input document. */ @Override public void execute() throws ExecutionException { interrupted = false; if (document == null) throw new ExecutionException("No document provided!"); if (inputASName != null && inputASName.equals("")) inputASName = null; if (outputASName != null && outputASName.equals("")) outputASName = null; // the action context always reflects, for each document executed, // the current PR features and the corpus, if present actionContext.setCorpus(corpus); actionContext.setPRFeatures(features); actionContext.setPR(this); try { batch.transduce( document, inputASName == null ? document.getAnnotations() : document.getAnnotations(inputASName), outputASName == null ? document.getAnnotations() : document.getAnnotations(outputASName)); } catch (JapeException je) { throw new ExecutionException(je); } }