edu.stanford.nlp.parser.lexparser
Class TreeAnnotatorAndBinarizer

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.TreeAnnotatorAndBinarizer
All Implemented Interfaces:
TreeTransformer

public class TreeAnnotatorAndBinarizer
extends Object
implements TreeTransformer


Constructor Summary
TreeAnnotatorAndBinarizer(HeadFinder annotationHF, HeadFinder binarizationHF, TreebankLangParserParams tlpParams, boolean forceCNF, boolean insideFactor, boolean doSubcategorization, Options op)
           
TreeAnnotatorAndBinarizer(TreebankLangParserParams tlpParams, boolean forceCNF, boolean insideFactor, boolean doSubcategorization, Options op)
           
 
Method Summary
 void addRoot(Tree t)
          Changes the ROOT label, and adds a Lexicon.BOUNDARY daughter to it.
 void dumpStats()
           
static void main(String[] args)
          Let's you test out the TreeAnnotatorAndBinarizer on the command line.
 void printRuleCounts()
           
 void printStateCounts()
           
 void setDoSelectiveSplit(boolean doSelectiveSplit)
           
 Tree transformTree(Tree t)
          The tree t is normally expected to be a Penn-Treebank-style tree in which the top node is an extra node that rewrites unarily.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeAnnotatorAndBinarizer

public TreeAnnotatorAndBinarizer(TreebankLangParserParams tlpParams,
                                 boolean forceCNF,
                                 boolean insideFactor,
                                 boolean doSubcategorization,
                                 Options op)

TreeAnnotatorAndBinarizer

public TreeAnnotatorAndBinarizer(HeadFinder annotationHF,
                                 HeadFinder binarizationHF,
                                 TreebankLangParserParams tlpParams,
                                 boolean forceCNF,
                                 boolean insideFactor,
                                 boolean doSubcategorization,
                                 Options op)
Method Detail

dumpStats

public void dumpStats()

setDoSelectiveSplit

public void setDoSelectiveSplit(boolean doSelectiveSplit)

addRoot

public void addRoot(Tree t)
Changes the ROOT label, and adds a Lexicon.BOUNDARY daughter to it. This is needed for the dependency parser. Note: This is a destructive operation on the tree passed in!!

Parameters:
t - The current tree into which a boundary is inserted

transformTree

public Tree transformTree(Tree t)
The tree t is normally expected to be a Penn-Treebank-style tree in which the top node is an extra node that rewrites unarily. If this isn't the case, an extra node is added and the user is warned.

Specified by:
transformTree in interface TreeTransformer
Parameters:
t - A tree. Classes implementing this interface can assume that the tree passed in is not null.
Returns:
the transformed Tree

printRuleCounts

public void printRuleCounts()

printStateCounts

public void printStateCounts()

main

public static void main(String[] args)
Let's you test out the TreeAnnotatorAndBinarizer on the command line.

Parameters:
args - Command line arguments: All flags accepted by FactoredParser.setOptionFlag and -train treebankPath [fileRanges]


Stanford NLP Group