Class ComposingAnnotator

java.lang.Object
com.basistech.rosette.dm.util.ComposingAnnotator
All Implemented Interfaces:
Annotator

public class ComposingAnnotator extends Object implements Annotator
An annotator that applies a series of annotators.
  • Constructor Details

    • ComposingAnnotator

      public ComposingAnnotator(List<Annotator> annotators)
      Construct a composing annotator from a list of annotators. Input is passed to the first annotator. The results of the first annotator are passed to the second annotator, etc, and the last annotator's results are returned.
      Parameters:
      annotators - the annotators.
  • Method Details

    • annotate

      public AnnotatedText annotate(CharSequence input)
      Apply the first annotator to the plain character sequence, and then chain the results of that annotator through the remaining annotators.
      Specified by:
      annotate in interface Annotator
      Parameters:
      input - data to process
      Returns:
      the result of the last annotator.
    • annotate

      public AnnotatedText annotate(AnnotatedText input)
      Description copied from interface: Annotator
      Annotates an existing text object with additional attributes. For example, an entity annotator may take the output of a base linguistics annotator (which has token annotations) and add additional entities attributes.
      Specified by:
      annotate in interface Annotator
      Parameters:
      input - data to process
      Returns:
      annotated data