Interface DocumentAnnotator
public interface DocumentAnnotator
A pipeline step that reads layers from a
Document and returns a new document
with its own layers added.
An annotator declares the layers it requires() and provides(), so
a DocumentAnalyzer can validate a pipeline before running it. Annotators are
usually thin adapters over an existing analysis component. Thread safety is
implementation specific.
- Since:
- 3.0.0
-
Method Summary
-
Method Details
-
annotate
Annotates a document.A required layer must be present on the document, but it may be empty: an empty required layer is valid input and yields the annotator's provided layers present but empty, so a pipeline degrades gracefully on documents without content.
- Parameters:
document- The document to annotate. Must not benulland must contain every layer named byrequires().- Returns:
- A new
Documentcarrying the layers named byprovides()in addition to the input layers. Nevernull. - Throws:
IllegalArgumentException- Thrown ifdocumentisnullor lacks a required layer.
-
requires
-
provides
-