edu.stanford.nlp.trees.TreeTransformer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
package edu.stanford.nlp.trees;
/**
* This is a simple interface for a function that alters a
* local Tree
.
*
* @author Christopher Manning.
*/
public 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
.
*
* @param t A tree. Classes implementing this interface can assume
* that the tree passed in is not null
.
* @return the transformed Tree
*/
public Tree transformTree(Tree t);
}