tml.annotators
Class PennTreeAnnotator

java.lang.Object
  extended by tml.annotators.AbstractAnnotator
      extended by tml.annotators.PennTreeAnnotator
All Implemented Interfaces:
Annotator

public class PennTreeAnnotator
extends AbstractAnnotator
implements Annotator

Annotator that implements the PennTree bank from the Stanford parser. It obtains the PennTree string and stores it for further processing.

Author:
Jorge Villalon

Field Summary
static java.lang.String FIELD_NAME
           
 
Constructor Summary
PennTreeAnnotator()
           
 
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.
static edu.stanford.nlp.trees.GrammaticalStructureFactory getGrammaticalStructureFactory()
           
static edu.stanford.nlp.parser.lexparser.LexicalizedParser getParser()
           
 java.lang.Object getSchema()
          The schema by which these annotations can be verified.
static edu.stanford.nlp.trees.TreebankLanguagePack getTreeBankLanguagePack()
           
 void init()
          This method initialises any static attributes required for the annotator to run
 boolean isLexicalized()
           
 void setLexicalized(boolean lexicalized)
           
 
Methods inherited from class tml.annotators.AbstractAnnotator
getFieldName, getTypes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tml.annotators.Annotator
getFieldName, getTypes
 

Field Detail

FIELD_NAME

public static java.lang.String FIELD_NAME
Constructor Detail

PennTreeAnnotator

public PennTreeAnnotator()
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getGrammaticalStructureFactory

public static edu.stanford.nlp.trees.GrammaticalStructureFactory getGrammaticalStructureFactory()
                                                                                         throws java.io.IOException
Returns:
the grammaticalStructureFactory
Throws:
java.io.IOException

getParser

public static edu.stanford.nlp.parser.lexparser.LexicalizedParser getParser()
                                                                     throws java.io.IOException
Returns:
the lexicalizedParser
Throws:
java.io.IOException

getTreeBankLanguagePack

public static edu.stanford.nlp.trees.TreebankLanguagePack getTreeBankLanguagePack()
                                                                           throws java.io.IOException
Returns:
the treeBankLanguagePack
Throws:
java.io.IOException

getAnnotatedText

public java.lang.String[] getAnnotatedText(java.lang.String annotationLabel)
Description copied from interface: Annotator
Returns the pieces of text (words or phrases) in the text that are annotated with a particular label.

Specified by:
getAnnotatedText in interface Annotator
Parameters:
annotationLabel - the label to search
Returns:
a list of text. Null if no text is found.

getAnnotations

public java.lang.String getAnnotations(java.lang.String text)
Description copied from interface: Annotator
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

Specified by:
getAnnotations in interface Annotator
Parameters:
text - the text to be annotated
Returns:
the XML

getSchema

public java.lang.Object getSchema()
Description copied from interface: Annotator
The schema by which these annotations can be verified.

Specified by:
getSchema in interface Annotator
Returns:
null if no schema is attached

init

public void init()
Description copied from interface: Annotator
This method initialises any static attributes required for the annotator to run

Specified by:
init in interface Annotator

isLexicalized

public boolean isLexicalized()
Returns:
the lexicalized

setLexicalized

public void setLexicalized(boolean lexicalized)
Parameters:
lexicalized - the lexicalized to set