edu.stanford.nlp.trees
Class DependencyTreeTransformer

java.lang.Object
  extended by edu.stanford.nlp.trees.DependencyTreeTransformer
All Implemented Interfaces:
TreeTransformer

public class DependencyTreeTransformer
extends Object
implements TreeTransformer

Transforms an English structure parse tree in order to get the dependencies right: -- put a ROOT node -- remove NONE nodes -- retain only NP-TMP and NP-ADV tags

Author:
mcdm

Field Summary
protected  TreebankLanguagePack tlp
           
 
Constructor Summary
DependencyTreeTransformer()
           
 
Method Summary
protected  String cleanUpLabel(String label)
           
protected  String cleanUpRoot(String label)
           
protected  Tree stripEmptyNode(Tree t)
           
protected  void stripTag(Tree t, Tree root)
           
 Tree transformTree(Tree t)
          Does whatever one needs to do to a particular tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tlp

protected final TreebankLanguagePack tlp
Constructor Detail

DependencyTreeTransformer

public DependencyTreeTransformer()
Method Detail

transformTree

public Tree transformTree(Tree t)
Description copied from interface: TreeTransformer
Does whatever one needs to do to a particular tree. This routine is passed a whole Tree, and could itself work recursively, but the canonical usage is to invoke this method via the Tree.transform() method, which will apply the transformer in a bottom-up manner to each local Tree, and hence the implementation of TreeTransformer should merely examine and change a local (one-level) Tree.

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

cleanUpRoot

protected String cleanUpRoot(String label)

cleanUpLabel

protected String cleanUpLabel(String label)

stripTag

protected void stripTag(Tree t,
                        Tree root)

stripEmptyNode

protected Tree stripEmptyNode(Tree t)


Stanford NLP Group