edu.stanford.nlp.trees
Class CompositeTreeTransformer
java.lang.Object
edu.stanford.nlp.trees.CompositeTreeTransformer
- All Implemented Interfaces:
- TreeTransformer
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
CompositeTreeTransformer
public CompositeTreeTransformer()
CompositeTreeTransformer
public CompositeTreeTransformer(List<TreeTransformer> tt)
addTransformer
public void addTransformer(TreeTransformer tt)
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
toString
public String toString()
- Overrides:
toString
in class Object
Stanford NLP Group