edu.stanford.nlp.trees
Class TreeLeafLabelTransformer

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

public class TreeLeafLabelTransformer
extends java.lang.Object
implements TreeTransformer

Applies a Function to the labels in a tree.

Author:
John Bauer

Constructor Summary
TreeLeafLabelTransformer(Function<java.lang.String,java.lang.String> transform)
           
 
Method Summary
 Tree transformTree(Tree tree)
          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
 

Constructor Detail

TreeLeafLabelTransformer

public TreeLeafLabelTransformer(Function<java.lang.String,java.lang.String> transform)
Method Detail

transformTree

public Tree transformTree(Tree tree)
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:
tree - A tree. Classes implementing this interface can assume that the tree passed in is not null.
Returns:
the transformed Tree


Stanford NLP Group