public final class SimplePipeline extends Object
Modifier and Type | Method and Description |
---|---|
static JCasIterable |
iteratePipeline(org.apache.uima.collection.CollectionReaderDescription aReader,
org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines)
Iterate through the
JCases processed by the pipeline, allowing to access each one
after it has been processed. |
static void |
runPipeline(org.apache.uima.cas.CAS cas,
org.apache.uima.analysis_engine.AnalysisEngine... engines)
Run a sequence of
analysis engines over a CAS . |
static void |
runPipeline(org.apache.uima.cas.CAS aCas,
org.apache.uima.analysis_engine.AnalysisEngineDescription... aDescs)
Run a sequence of
analysis engines over a JCas . |
static void |
runPipeline(org.apache.uima.collection.CollectionReader reader,
org.apache.uima.analysis_engine.AnalysisEngine... engines)
Provides a simple way to run a pipeline for a given collection reader and sequence of analysis
engines.
|
static void |
runPipeline(org.apache.uima.collection.CollectionReader reader,
org.apache.uima.analysis_engine.AnalysisEngineDescription... descs)
Run the CollectionReader and AnalysisEngines as a pipeline.
|
static void |
runPipeline(org.apache.uima.collection.CollectionReaderDescription readerDesc,
org.apache.uima.analysis_engine.AnalysisEngineDescription... descs)
Run the CollectionReader and AnalysisEngines as a pipeline.
|
static void |
runPipeline(org.apache.uima.jcas.JCas jCas,
org.apache.uima.analysis_engine.AnalysisEngine... engines)
Run a sequence of
analysis engines over a JCas . |
static void |
runPipeline(org.apache.uima.jcas.JCas jCas,
org.apache.uima.analysis_engine.AnalysisEngineDescription... descs)
Run a sequence of
analysis engines over a JCas . |
public static void runPipeline(org.apache.uima.collection.CollectionReader reader, org.apache.uima.analysis_engine.AnalysisEngineDescription... descs) throws org.apache.uima.UIMAException, IOException
Run the CollectionReader and AnalysisEngines as a pipeline. After processing all CASes provided
by the reader, the method calls collectionProcessComplete()
on the engines and destroy()
on all
engines.
Note that with this method, external resources cannot be shared between the reader and the analysis engines. They can be shared amongst the analysis engines.
reader
- The CollectionReader that loads the documents into the CAS.descs
- Primitive AnalysisEngineDescriptions that process the CAS, in order. If you have a mix
of primitive and aggregate engines, then please create the AnalysisEngines yourself
and call the other runPipeline method.org.apache.uima.UIMAException
- if there is a problem initializing or running the CPE.IOException
- if there is an I/O problem in the readerpublic static void runPipeline(org.apache.uima.collection.CollectionReaderDescription readerDesc, org.apache.uima.analysis_engine.AnalysisEngineDescription... descs) throws org.apache.uima.UIMAException, IOException
Run the CollectionReader and AnalysisEngines as a pipeline. After processing all CASes provided
by the reader, the method calls collectionProcessComplete()
on the engines, close()
on the
reader and destroy()
on the reader and all engines.
External resources can be shared between the reader and the analysis engines.
readerDesc
- The CollectionReader that loads the documents into the CAS.descs
- Primitive AnalysisEngineDescriptions that process the CAS, in order. If you have a mix
of primitive and aggregate engines, then please create the AnalysisEngines yourself
and call the other runPipeline method.org.apache.uima.UIMAException
- if there is a problem initializing or running the CPE.IOException
- if there is an I/O problem in the readerpublic static void runPipeline(org.apache.uima.collection.CollectionReader reader, org.apache.uima.analysis_engine.AnalysisEngine... engines) throws org.apache.uima.UIMAException, IOException
Provides a simple way to run a pipeline for a given collection reader and sequence of analysis
engines. After processing all CASes provided by the reader, the method calls
collectionProcessComplete()
on the engines.
External resources can only be shared between the reader and/or the analysis engines if the reader/engines have been previously instantiated using a shared resource manager.
reader
- a collection readerengines
- a sequence of analysis enginesorg.apache.uima.UIMAException
- if there is a problem initializing or running the CPE.IOException
- if there is an I/O problem in the readerpublic static void runPipeline(org.apache.uima.cas.CAS aCas, org.apache.uima.analysis_engine.AnalysisEngineDescription... aDescs) throws org.apache.uima.resource.ResourceInitializationException, org.apache.uima.analysis_engine.AnalysisEngineProcessException
Run a sequence of analysis engines
over a JCas
. The result of
the analysis can be read from the JCas.
External resources can be shared between the analysis engines.
aCas
- the CAS to processaDescs
- a sequence of analysis engines to run on the jCasorg.apache.uima.resource.ResourceInitializationException
- if there is a problem initializing the componentsorg.apache.uima.analysis_engine.AnalysisEngineProcessException
- if there is a problem during the execution of the componentspublic static void runPipeline(org.apache.uima.jcas.JCas jCas, org.apache.uima.analysis_engine.AnalysisEngineDescription... descs) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException, org.apache.uima.resource.ResourceInitializationException
Run a sequence of analysis engines
over a JCas
. The result of
the analysis can be read from the JCas.
External resources can be shared between the analysis engines.
jCas
- the jCas to processdescs
- a sequence of analysis engines to run on the jCasorg.apache.uima.resource.ResourceInitializationException
- if there is a problem initializing the componentsorg.apache.uima.analysis_engine.AnalysisEngineProcessException
- if there is a problem during the execution of the componentspublic static void runPipeline(org.apache.uima.jcas.JCas jCas, org.apache.uima.analysis_engine.AnalysisEngine... engines) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
Run a sequence of analysis engines
over a JCas
. This method does
not destroy
the engines or send them other events like
AnalysisEngine.collectionProcessComplete()
. This is left to the caller.
External resources can only be shared between the analysis engines if the engines have been previously instantiated using a shared resource manager.
jCas
- the jCas to processengines
- a sequence of analysis engines to run on the jCasorg.apache.uima.analysis_engine.AnalysisEngineProcessException
- if there is a problem during the execution of the componentspublic static void runPipeline(org.apache.uima.cas.CAS cas, org.apache.uima.analysis_engine.AnalysisEngine... engines) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
Run a sequence of analysis engines
over a CAS
. This method does
not destroy
the engines or send them other events like
AnalysisEngine.collectionProcessComplete()
. This is left to the caller.
External resources can only be shared between the analysis engines if the engines have been previously instantiated using a shared resource manager.
cas
- the CAS to processengines
- a sequence of analysis engines to run on the jCasorg.apache.uima.analysis_engine.AnalysisEngineProcessException
- if there is a problem during the execution of the componentspublic static JCasIterable iteratePipeline(org.apache.uima.collection.CollectionReaderDescription aReader, org.apache.uima.analysis_engine.AnalysisEngineDescription... aEngines)
Iterate through the JCases
processed by the pipeline, allowing to access each one
after it has been processed.
External resources can be shared between the reader and the analysis engines.
aReader
- the collection reader.aEngines
- the analysis engines.Iterable
<JCas
> which can be used in an extended for-loop.Copyright © 2012–2014 The Apache Software Foundation. All rights reserved.