gov.llnl.ontology.util
Class AnnotationUtil

java.lang.Object
  extended by gov.llnl.ontology.util.AnnotationUtil

public class AnnotationUtil
extends Object

A simple utility class for accessing the most frequent Annotations applied to a Annotation.

Author:
Keith Stevens

Constructor Summary
AnnotationUtil()
           
 
Method Summary
static int dependencyParent(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the index of the governing mode in a dependency parse tree for annot.
static String dependencyRelation(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the relation between annot and the governing mode in a dependency parse tree for annot.
static String pos(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the string form of the part of speech tag for annot.
static void setDependencyParent(edu.stanford.nlp.pipeline.Annotation annot, int index)
          Sets the index of the governing mode in a dependency parse tree for annot.
static void setDependencyRelation(edu.stanford.nlp.pipeline.Annotation annot, String relation)
          Sets the relation between annot and the governing mode in a dependency parse tree for annot.
static void setPos(edu.stanford.nlp.pipeline.Annotation annot, String pos)
          Sets the part of speech tag for annot.
static void setSpan(edu.stanford.nlp.pipeline.Annotation annot, int start, int end)
          Sets the index space for annot.
static void setSpan(edu.stanford.nlp.pipeline.Annotation annot, edu.stanford.nlp.util.IntPair span)
          Sets the index space for annot.
static void setWord(edu.stanford.nlp.pipeline.Annotation annot, String word)
          Sets the token for annot
static void setWordSense(edu.stanford.nlp.pipeline.Annotation annot, String sense)
          Sets the word sense for annot.
static edu.stanford.nlp.util.IntPair span(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the index span for annot
static String word(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the token for annot.
static String wordSense(edu.stanford.nlp.pipeline.Annotation annot)
          Returns the word sense for annot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationUtil

public AnnotationUtil()
Method Detail

pos

public static String pos(edu.stanford.nlp.pipeline.Annotation annot)
Returns the string form of the part of speech tag for annot.


setPos

public static void setPos(edu.stanford.nlp.pipeline.Annotation annot,
                          String pos)
Sets the part of speech tag for annot.


word

public static String word(edu.stanford.nlp.pipeline.Annotation annot)
Returns the token for annot.


setWord

public static void setWord(edu.stanford.nlp.pipeline.Annotation annot,
                           String word)
Sets the token for annot


wordSense

public static String wordSense(edu.stanford.nlp.pipeline.Annotation annot)
Returns the word sense for annot.


setWordSense

public static void setWordSense(edu.stanford.nlp.pipeline.Annotation annot,
                                String sense)
Sets the word sense for annot.


span

public static edu.stanford.nlp.util.IntPair span(edu.stanford.nlp.pipeline.Annotation annot)
Returns the index span for annot


setSpan

public static void setSpan(edu.stanford.nlp.pipeline.Annotation annot,
                           int start,
                           int end)
Sets the index space for annot.


setSpan

public static void setSpan(edu.stanford.nlp.pipeline.Annotation annot,
                           edu.stanford.nlp.util.IntPair span)
Sets the index space for annot.


dependencyParent

public static int dependencyParent(edu.stanford.nlp.pipeline.Annotation annot)
Returns the index of the governing mode in a dependency parse tree for annot.


setDependencyParent

public static void setDependencyParent(edu.stanford.nlp.pipeline.Annotation annot,
                                       int index)
Sets the index of the governing mode in a dependency parse tree for annot.


dependencyRelation

public static String dependencyRelation(edu.stanford.nlp.pipeline.Annotation annot)
Returns the relation between annot and the governing mode in a dependency parse tree for annot.


setDependencyRelation

public static void setDependencyRelation(edu.stanford.nlp.pipeline.Annotation annot,
                                         String relation)
Sets the relation between annot and the governing mode in a dependency parse tree for annot.



Copyright © 2010-2011. All Rights Reserved.