@Override public CAS next() throws AnalysisEngineProcessException { return it_inner.next(); } @Override
public JCas next() throws AnalysisEngineProcessException { try { return mCasIterator.next().getJCas(); } catch (CASException e) { throw new AnalysisEngineProcessException(e); } }
/** * Run a sequence of {@link AnalysisEngine analysis engines} over a {@link CAS}. This method * does not {@link AnalysisEngine#destroy() destroy} the engines or send them other events like * {@link AnalysisEngine#collectionProcessComplete()}. This is left to the caller. * * @param cas * the CAS to process * @param engines * a sequence of analysis engines to run on the jCas * @throws UIMAException * @throws IOException */ public static void runPipeline(final CAS cas, final AnalysisEngine... engines) throws UIMAException, IOException { if (engines.length == 0) { return; } CasIterator casIter = engines[0].processAndOutputNewCASes(cas); AnalysisEngine[] enginesRemains = Arrays.copyOfRange(engines, 1, engines.length); while (casIter.hasNext()) { CAS nextCas = casIter.next(); runPipeline(nextCas, enginesRemains); nextCas.release(); } }
void runPipeline(final CAS cas, final AnalysisEngine engine, CasProcessedCallback callback) throws UIMAException, IOException { CasIterator it = engine.processAndOutputNewCASes(cas); while (it.hasNext()) { CAS output = it.next(); callback.entityProcessComplete(output); output.release(); } callback.collectionProcessComplete(); } }
public ProcessTrace process(CAS aCAS) throws AnalysisEngineProcessException { CasIterator iter = processAndOutputNewCASes(aCAS); // step through all output CASes which lets the AE finish all processing while (iter.hasNext()) { CAS cas = iter.next(); cas.release(); } // https://issues.apache.org/jira/browse/UIMA-4151 return isProcessTraceEnabled() ? buildProcessTraceFromMBeanStats() : ProcessTrace_impl.disabledProcessTrace; // return buildProcessTraceFromMBeanStats(); }
CAS casProduced = casIterator.next(); if ( stackDumpTimer != null ) { stackDumpTimer.cancel();