edu.stanford.nlp.trees
Class GrammaticalFunctionTreeNormalizer

java.lang.Object
  extended by edu.stanford.nlp.trees.TreeNormalizer
      extended by edu.stanford.nlp.trees.GrammaticalFunctionTreeNormalizer
All Implemented Interfaces:
Serializable

public class GrammaticalFunctionTreeNormalizer
extends TreeNormalizer

Tree normalizer for cleaning up labels and preserving the whole node label, the grammatical function and category information from the label, or only the category information. Only normalization occurs on nonterminals.

Author:
Anna Rafferty
See Also:
Serialized Form

Field Summary
protected  TreebankLanguagePack tlp
           
 
Constructor Summary
GrammaticalFunctionTreeNormalizer(TreebankLanguagePack tlp, int nodeCleanup)
           
 
Method Summary
protected  String cleanUpLabel(String label)
          Remove things like hyphened functional tags and equals from the end of a node label.
 String normalizeNonterminal(String category)
          Normalizes a nonterminal contents.
 
Methods inherited from class edu.stanford.nlp.trees.TreeNormalizer
normalizeTerminal, normalizeWholeTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tlp

protected final TreebankLanguagePack tlp
Constructor Detail

GrammaticalFunctionTreeNormalizer

public GrammaticalFunctionTreeNormalizer(TreebankLanguagePack tlp,
                                         int nodeCleanup)
Method Detail

normalizeNonterminal

public String normalizeNonterminal(String category)
Normalizes a nonterminal contents. This implementation strips functional tags, etc. and interns the nonterminal.

Overrides:
normalizeNonterminal in class TreeNormalizer
Parameters:
category - The String that decorates this nonterminal node
Returns:
The normalized form of this nonterminal String

cleanUpLabel

protected String cleanUpLabel(String label)
Remove things like hyphened functional tags and equals from the end of a node label.



Stanford NLP Group