Package edu.stanford.nlp.trees
Class CompositeTreeTransformer
- java.lang.Object
-
- edu.stanford.nlp.trees.CompositeTreeTransformer
-
- All Implemented Interfaces:
TreeTransformer,Function<Tree,Tree>
public class CompositeTreeTransformer extends Object implements TreeTransformer
A TreeTransformer that applies component TreeTransformers in order. The order in which they are applied is the order in which they are added or the order in which they appear in the List passed to the constructor.- Author:
- Galen Andrew
-
-
Constructor Summary
Constructors Constructor Description CompositeTreeTransformer()CompositeTreeTransformer(TreeTransformer... tt)CompositeTreeTransformer(List<TreeTransformer> tt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransformer(TreeTransformer tt)StringtoString()TreetransformTree(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, wait, wait, wait
-
Methods inherited from interface edu.stanford.nlp.trees.TreeTransformer
apply
-
-
-
-
Constructor Detail
-
CompositeTreeTransformer
public CompositeTreeTransformer()
-
CompositeTreeTransformer
public CompositeTreeTransformer(List<TreeTransformer> tt)
-
CompositeTreeTransformer
public CompositeTreeTransformer(TreeTransformer... tt)
-
-
Method Detail
-
addTransformer
public void addTransformer(TreeTransformer tt)
-
transformTree
public Tree transformTree(Tree t)
Description copied from interface:TreeTransformerDoes whatever one needs to do to a particular tree. This routine is passed a wholeTree, and could itself work recursively, but the canonical usage is to invoke this method via theTree.transform()method, which will apply the transformer in a bottom-up manner to each localTree, and hence the implementation ofTreeTransformershould merely examine and change a local (one-level)Tree.- Specified by:
transformTreein interfaceTreeTransformer- Parameters:
t- A tree. Classes implementing this interface can assume that the tree passed in is notnull.- Returns:
- The transformed
Tree
-
-