You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

This page collects differences between Version 2 of UIMA and Version 1.

New Annotator Interfaces

UIMA 2.x has a new set of Annotator interfaces. Annotators should extend CasAnnotator_ImplBase or JCasAnnotator_ImplBase instead of the v1.x TextAnnotator_ImplBase and JTextAnnotator_ImplBase.

NOTE: The v1.x annotator interfaces are unchanged and are still supported for backwards compatibility.

Differences between v2 and v1 annotator interfaces

The following summarizes what has changed between the v2 annotator interfaces (CasAnnotator_ImplBase, JCasAnnotator_ImplBase) and the v1 interfaces (TextAnnotator_ImplBase,JTextAnnotator_ImplBase).

Result Specification

The Result Specification was previously passed in on each process() call as the 2nd parameter. Now it is set when changed and it's up to the annotator to store it in a local field and make it available
when needed.

This approach lets the annotator receive a specific signal (a method call) when the Result Specification changes. Previously, it would need to check on every call to see if it changed.

The default impl base classes provide set/getResultSpecification(...) methods for this.

Annotator Context now UimaContext

The context for the Annotator is the same as the overall UIMA context. The impl base classes provide a getContext() method which returns now the UimaContext object

Process method throws AnalysisEngineProcessException, not AnnotatorProcessException

See #exceptions for discussion.

Exceptions rationalization

In version 1 there were different exceptions for the methods of an AnalysisEngine and for the
corresponding methods of an Annotator; these were merged in version 2.

  • AnnotatorProcessException (v1) → AnalysisEngineProcessException (v2)
  • AnnotatorInitializationException (v1) → ResourceInitializationException (v2)
  • AnnotatorConfigurationException (v1) → ResourceConfigurationException (v2)
  • AnnotatorContextException (v1) &rarr: ResourceAccessException (v2)

Capability sets → One Capability Set

In version one, you can define multiple capability sets. These were not supported well, and for version two, this is now simplified - you should only use one capability set. (For backwards compatibility, if you use more, this won't cause a problem for now).

  • No labels