edu.stanford.nlp.pipeline
Class ParserAnnotatorUtils

java.lang.Object
  extended by edu.stanford.nlp.pipeline.ParserAnnotatorUtils

public class ParserAnnotatorUtils
extends java.lang.Object

Author:
David McClosky

Method Summary
static void convertToCoreLabels(Tree tree)
          Converts the tree labels to CoreLabels.
static void fillInParseAnnotations(boolean verbose, boolean buildGraphs, GrammaticalStructureFactory gsf, CoreMap sentence, Tree tree)
          Thread safety note: nothing special is done to ensure the thread safety of the GrammaticalStructureFactory.
static void setMissingTags(CoreMap sentence, Tree tree)
          Set the tags of the original tokens and the leaves if they aren't already set
static Tree xTree(java.util.List<? extends HasWord> words)
          Construct a fall through tree in case we can't parse this sentence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fillInParseAnnotations

public static void fillInParseAnnotations(boolean verbose,
                                          boolean buildGraphs,
                                          GrammaticalStructureFactory gsf,
                                          CoreMap sentence,
                                          Tree tree)
Thread safety note: nothing special is done to ensure the thread safety of the GrammaticalStructureFactory. However, both the EnglishGrammaticalStructureFactory and the ChineseGrammaticalStructureFactory are thread safe.


setMissingTags

public static void setMissingTags(CoreMap sentence,
                                  Tree tree)
Set the tags of the original tokens and the leaves if they aren't already set


convertToCoreLabels

public static void convertToCoreLabels(Tree tree)
Converts the tree labels to CoreLabels. We need this because we store additional info in the CoreLabel, like token span.

Parameters:
tree -

xTree

public static Tree xTree(java.util.List<? extends HasWord> words)
Construct a fall through tree in case we can't parse this sentence

Parameters:
words -
Returns:
a tree with X for all the internal nodes


Stanford NLP Group