## edu.stanford.nlp.trees.international.negra
Class NegraPennTreeNormalizer

    java.lang.Object
      edu.stanford.nlp.trees.TreeNormalizer
          edu.stanford.nlp.trees.international.negra.NegraPennTreeNormalizer

All Implemented Interfaces:
  Serializable

    public class NegraPennTreeNormalizer

extends TreeNormalizer

Tree normalizer for Negra Penn Treebank format.

Author:
  Roger Levy
See Also:
  Serialized Form

Field Summary
`protected TreebankLanguagePack` `tlp`

Constructor Summary
`NegraPennTreeNormalizer()`
`NegraPennTreeNormalizer(TreebankLanguagePack tlp)`
`NegraPennTreeNormalizer(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.
`boolean` `getInsertNPinPP()`
`String` `nonUnaryRootSymbol()`
`String` `normalizeNonterminal(String category)` Normalizes a nonterminal contents.
`String` `normalizeTerminal(String leaf)` Normalizes a leaf contents.
`Tree` `normalizeWholeTree(Tree tree, TreeFactory tf)` Normalize a whole tree -- one can assume that this is the root.
`String` `rootSymbol()`
`void` `setInsertNPinPP(boolean b)`

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

### NegraPennTreeNormalizer

    public NegraPennTreeNormalizer()

### NegraPennTreeNormalizer

    public NegraPennTreeNormalizer(TreebankLanguagePack tlp)

### NegraPennTreeNormalizer

    public NegraPennTreeNormalizer(TreebankLanguagePack tlp,
                                   int nodeCleanup)

Method Detail

### rootSymbol

    public String rootSymbol()

### nonUnaryRootSymbol

    public String nonUnaryRootSymbol()

### setInsertNPinPP

    public void setInsertNPinPP(boolean b)

### getInsertNPinPP

    public boolean getInsertNPinPP()

### normalizeTerminal

    public String normalizeTerminal(String leaf)

  Normalizes a leaf contents. This implementation interns the leaf.

  Overrides:
    `normalizeTerminal` in class `TreeNormalizer`
  Parameters:
    `leaf` - The String that decorates the leaf
  Returns:
    The normalized form of this leaf String

### 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

### normalizeWholeTree

    public Tree normalizeWholeTree(Tree tree,
                                   TreeFactory tf)

  Normalize a whole tree -- one can assume that this is the root. This implementation deletes empty elements (ones with nonterminal tag label starting with '*T') from the tree. It does work for a null tree.

  Overrides:
    `normalizeWholeTree` in class `TreeNormalizer`
  Parameters:
    `tree` - The tree to be normalized
    `tf` - the TreeFactory to create new nodes (if needed)
  Returns:
    Tree the normalized tree

### cleanUpLabel

    protected String cleanUpLabel(String label)

  Remove things like hyphened functional tags and equals from the end of a node label.

Stanford NLP Group