tml.annotators
Interface Annotator

All Known Implementing Classes:
PennTreeAnnotator

public interface Annotator

Common interface for all annotators. Each annotator will be called from the Repository to analyze each sentence and then store the annotated text in a Lucene field while indexing.

Author:
Jorge Villalon

Method Summary
 java.lang.String[] getAnnotatedText(java.lang.String annotationLabel)
          Returns the pieces of text (words or phrases) in the text that are annotated with a particular label.
 java.lang.String getAnnotations(java.lang.String text)
          This method returns the XML annotated version of a text.
 java.lang.String getFieldName()
          The Lucene field name where this annotations are going to be stored.
 java.lang.Object getSchema()
          The schema by which these annotations can be verified.
 java.util.ArrayList<java.lang.String> getTypes()
           
 void init()
          This method initialises any static attributes required for the annotator to run
 

Method Detail

getAnnotations

java.lang.String getAnnotations(java.lang.String text)
This method returns the XML annotated version of a text. E.g if we have "Rafa is in the US" the annotated version would be "RafaUS". TODO: Analyze if UIMA provides a better annotation schema

Parameters:
text - the text to be annotated
Returns:
the XML

getFieldName

java.lang.String getFieldName()
The Lucene field name where this annotations are going to be stored.

Returns:
the Lucene field name

getSchema

java.lang.Object getSchema()
The schema by which these annotations can be verified.

Returns:
null if no schema is attached

getAnnotatedText

java.lang.String[] getAnnotatedText(java.lang.String annotationLabel)
Returns the pieces of text (words or phrases) in the text that are annotated with a particular label.

Parameters:
annotationLabel - the label to search
Returns:
a list of text. Null if no text is found.

init

void init()
This method initialises any static attributes required for the annotator to run


getTypes

java.util.ArrayList<java.lang.String> getTypes()