AnalysisEngine
can be used for analyzing all kinds of unstructured information.
It is mainly designed to work well with text but it should also work with other kinds of unstructured information like life sciences data.
An analysis engine is a mediator between an application interested in the analysis results for some piece of unstructured input data and the so called annotators that actually produce this analysis result.
All results -intermediate and final- are passed through the Common Analysis Structure (CAS) linking the application and the annotators.
An AnalysisEngine hides the complexities of computing the results and the flow of control between all annotators working on the results from the application.
For text analysis, use uima::TextAnalysisEngine.
Static Info Functions | |
static const char * | getErrorIdAsCString (TyErrorId utErrorId) |
Return a static pointer to a string representation of the specified error id. | |
static void | printErrorIdTable (std::ostream &rclOutStream) |
Prints a table of ERRID = ERRSTRING to rclOutStream . | |
static const char * | getVersionInfo (void) |
Return the engine version information. | |
static const char * | getLevelInfo (void) |
Return the engine level information. | |
Public Member Functions | |
virtual | ~AnalysisEngine () |
virtual CAS * | newCAS () const =0 |
create a new CAS which can be used to process documents and other data with this AnalysisEngine. | |
virtual bool | isPrimitive () const =0 |
Returns true if this is not an aggregate engine. | |
virtual AnnotatorContext & | getAnnotatorContext ()=0 |
Returns the AnnotatorContext for this engine. | |
virtual AnnotatorContext const & | getAnnotatorContext () const =0 |
Returns the AnnotatorContext for this engine const version. | |
virtual AnalysisEngineMetaData const & | getAnalysisEngineMetaData () const |
get an uima::AnalysisEngineMetaData describing all kinds of meta data about this engine, e.g., if it is primitive, which annotators it uses, etc. | |
virtual ResultSpecification const & | getCompleteResultSpecification () const =0 |
Returns the result specification that is specified in the configuration file for this engine. | |
virtual TyErrorId | initialize (AnalysisEngineDescription const &)=0 |
virtual bool | isInitialized () const =0 |
virtual TyErrorId | process (CAS &cas)=0 |
invoke this engine's analysis logic. | |
virtual TyErrorId | process (CAS &cas, ResultSpecification const &resultSpec)=0 |
invoke this engine's analysis logic where resultSpec constrains what kinds on results are needed by the application. | |
virtual TyErrorId | reconfigure ()=0 |
trigger a reconfigure call to all annotators of this engine | |
virtual TyErrorId | destroy ()=0 |
de-initialize the engine. | |
virtual TyErrorId | batchProcessComplete ()=0 |
Completes the processing of a batch. | |
virtual TyErrorId | collectionProcessComplete ()=0 |
Completes the processing of a collection. | |
virtual CASIterator | processAndOutputNewCASes (CAS &)=0 |
Processes a CAS , possibly producing multiple CASes as a result. | |
Protected Member Functions | |
virtual bool | hasNext ()=0 |
Returns whether this engine will return a new CAS. | |
virtual CAS & | next ()=0 |
Returns a new CAS distinct from the input CAS. | |
virtual int | getCasInstancesRequired ()=0 |
Returns the maximum number of CAS instances that this AnalysisComponent expects to use at the same time. |
virtual uima::AnalysisEngine::~AnalysisEngine | ( | ) | [inline, virtual] |
virtual bool uima::AnalysisEngine::hasNext | ( | ) | [protected, pure virtual] |
virtual CAS& uima::AnalysisEngine::next | ( | ) | [protected, pure virtual] |
virtual int uima::AnalysisEngine::getCasInstancesRequired | ( | ) | [protected, pure virtual] |
Returns the maximum number of CAS instances that this AnalysisComponent expects to use at the same time.
This only applies to CasMultipliers. Most CasMultipliers will only need one CAS at a time. Only if there is a clear need should this be overridden to return something greater than 1.
virtual CAS* uima::AnalysisEngine::newCAS | ( | ) | const [pure virtual] |
create a new CAS which can be used to process documents and other data with this AnalysisEngine.
Memory ownership is transferred to the caller. The returned CAS is only valid for the lifetime as the engine it was obtained from.
virtual bool uima::AnalysisEngine::isPrimitive | ( | ) | const [pure virtual] |
Returns true if this is not an aggregate engine.
virtual AnnotatorContext& uima::AnalysisEngine::getAnnotatorContext | ( | ) | [pure virtual] |
Returns the AnnotatorContext for this engine.
virtual AnnotatorContext const& uima::AnalysisEngine::getAnnotatorContext | ( | ) | const [pure virtual] |
Returns the AnnotatorContext for this engine const version.
virtual AnalysisEngineMetaData const& uima::AnalysisEngine::getAnalysisEngineMetaData | ( | ) | const [virtual] |
get an uima::AnalysisEngineMetaData describing all kinds of meta data about this engine, e.g., if it is primitive, which annotators it uses, etc.
virtual ResultSpecification const& uima::AnalysisEngine::getCompleteResultSpecification | ( | ) | const [pure virtual] |
Returns the result specification that is specified in the configuration file for this engine.
An application may copy the result of this function, remove some elements from the copy and pass it back to the process function.
virtual TyErrorId uima::AnalysisEngine::initialize | ( | AnalysisEngineDescription const & | ) | [pure virtual] |
virtual bool uima::AnalysisEngine::isInitialized | ( | ) | const [pure virtual] |
invoke this engine's analysis logic.
virtual TyErrorId uima::AnalysisEngine::process | ( | CAS & | cas, | |
ResultSpecification const & | resultSpec | |||
) | [pure virtual] |
invoke this engine's analysis logic where resultSpec
constrains what kinds on results are needed by the application.
virtual TyErrorId uima::AnalysisEngine::reconfigure | ( | ) | [pure virtual] |
trigger a reconfigure call to all annotators of this engine
virtual TyErrorId uima::AnalysisEngine::destroy | ( | ) | [pure virtual] |
de-initialize the engine.
virtual TyErrorId uima::AnalysisEngine::batchProcessComplete | ( | ) | [pure virtual] |
Completes the processing of a batch.
A collection of artifacts to be analyzed may be divided into one or more batches
virtual TyErrorId uima::AnalysisEngine::collectionProcessComplete | ( | ) | [pure virtual] |
Completes the processing of a collection.
The CollectionProcessingManager or the application invokes this method when after all artifacts in the collection are processed.
virtual CASIterator uima::AnalysisEngine::processAndOutputNewCASes | ( | CAS & | ) | [pure virtual] |
Processes a CAS
, possibly producing multiple CASes as a result.
The application uses the CASIterator interface to step through the output CASes.
If this Analysis Engine does not produce output CASes, then the CASIterator
will return no elements.
Once this method is called, the AnalysisEngine "owns" aCAS
until such time as the CASIterator#hasNext() method returns false. That is, the caller should not attempt to modify or access the input CAS until it has read all of the elements from the CasIterator. If the caller wants to abort the processing before having read all of the output CASes, it may call uima::CASIterator#release(), which will stop further processing from occurring, and ownership of aCAS
will revert to the caller.
static const char* uima::AnalysisEngine::getErrorIdAsCString | ( | TyErrorId | utErrorId | ) | [static] |
Return a static pointer to a string representation of the specified error id.
Can be used to produce more readable error output
static void uima::AnalysisEngine::printErrorIdTable | ( | std::ostream & | rclOutStream | ) | [static] |
Prints a table of ERRID = ERRSTRING to rclOutStream
.
static const char* uima::AnalysisEngine::getVersionInfo | ( | void | ) | [static] |
Return the engine version information.
static const char* uima::AnalysisEngine::getLevelInfo | ( | void | ) | [static] |
Return the engine level information.