edu.stanford.nlp.parser.lexparser
Class TreeCollinizer
java.lang.Object
edu.stanford.nlp.parser.lexparser.TreeCollinizer
- All Implemented Interfaces:
- TreeTransformer
public class TreeCollinizer
- extends Object
- implements TreeTransformer
Does detransformations to a parsed sentence to map it back to the
standard treebank form for output or evaluation.
This version has Penn-Treebank-English-specific details, but can probably
be used without harm on other treebanks.
Returns labels to their basic category, removes punctuation (should be with
respect to a gold tree, but currently isn't), deletes the boundary symbol,
changes PRT labels to ADVP.
- Author:
- Dan Klein, Christopher Manning
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tf
protected TreeFactory tf
TreeCollinizer
public TreeCollinizer(TreebankLanguagePack tlp)
TreeCollinizer
public TreeCollinizer(TreebankLanguagePack tlp,
boolean deletePunct,
boolean fixCollinsBaseNP)
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