edu.stanford.nlp.movetrees
Class EmptyTreeLeaf<EmptyType>

java.lang.Object
  extended by java.util.AbstractCollection<Tree>
      extended by edu.stanford.nlp.trees.Tree
          extended by edu.stanford.nlp.trees.LabeledScoredTreeNode
              extended by edu.stanford.nlp.movetrees.EmptyTreeLeaf<EmptyType>
Type Parameters:
EmptyType -
All Implemented Interfaces:
Label, Labeled, Scored, java.io.Serializable, java.lang.Iterable<Tree>, java.util.Collection<Tree>

public class EmptyTreeLeaf<EmptyType>
extends LabeledScoredTreeNode

Author:
Roger Levy, Sarah Spikes (sdspikes@cs.stanford.edu) (Templatization)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.nlp.trees.Tree
DISPLAY_SCORES, EMPTY_TREE_ARRAY
 
Constructor Summary
EmptyTreeLeaf(Label label, EmptyType type)
          Create a leaf parse tree with given word.
EmptyTreeLeaf(Label label, EmptyType type, Tree t)
          Create a leaf parse tree with given word.
 
Method Summary
 EmptyType emptyType()
           
 java.util.List<LabeledWord> labeledYield(java.util.List<LabeledWord> y)
          A EmptyTreeLeaf is invisible in the tagged yield
 void setEmptyType(EmptyType o)
           
 void setTraceTo(Tree t)
           
 java.lang.String toString()
          prints the trace, plus the label and the yield of the pointed-to constituent
 Tree traceTo()
           
 TreeFactory treeFactory()
          major yuk here.
<T> java.util.List<T>
yield(java.util.List<T> y)
          A EmptyTreeLeaf is invisible in the yield
 
Methods inherited from class edu.stanford.nlp.trees.LabeledScoredTreeNode
children, factory, factory, label, nodeString, score, setChildren, setLabel, setScore
 
Methods inherited from class edu.stanford.nlp.trees.Tree
addChild, addChild, ancestor, cCommands, constituents, constituents, constituents, deepCopy, deepCopy, deepCopy, dependencies, dependencies, dependencies, dependencies, depth, depth, dominates, dominationPath, equals, firstChild, flatten, flatten, getChild, getChildrenAsList, getLeaves, getLeaves, getNodeNumber, getSpan, hashCode, headPreTerminal, headTerminal, headTerminal, indentedListPrint, indentedListPrint, indentedXMLPrint, indentedXMLPrint, indexLeaves, indexOf, indexSpans, indexSpans, indexSpans, insertDtr, isLeaf, isPhrasal, isPrePreTerminal, isPreTerminal, isUnaryRewrite, iterator, joinNode, labeledYield, labelFactory, labels, lastChild, leftCharEdge, localTree, localTrees, mapDependencies, mapDependencies, nodeNumber, numChildren, parent, parent, pathNodeToNode, pennPrint, pennPrint, pennPrint, pennString, percolateHeads, postOrderNodeList, preOrderNodeList, preTerminalYield, preTerminalYield, printLocalTree, printLocalTree, prune, prune, removeChild, rightCharEdge, setChild, setChildren, setFromString, setLabels, setSpans, setValue, siblings, size, skipRoot, spliceOut, spliceOut, subTreeList, subTrees, subTrees, taggedDependencies, taggedDependencies, taggedDependencies, taggedDependencies, taggedLabeledYield, taggedYield, taggedYield, toStringBuilder, toStringBuilder, toStructureDebugString, transform, transform, treeSkeletonCopy, treeSkeletonCopy, upperMostUnary, value, valueOf, valueOf, yield, yield, yieldHasWord, yieldHasWord, yieldWords, yieldWords
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmptyTreeLeaf

public EmptyTreeLeaf(Label label,
                     EmptyType type,
                     Tree t)
Create a leaf parse tree with given word.

Parameters:
label - the Label representing the word for this new tree leaf.
t - the antecedent returned by traceTo()

EmptyTreeLeaf

public EmptyTreeLeaf(Label label,
                     EmptyType type)
Create a leaf parse tree with given word.

Parameters:
label - the Label representing the word for this new tree leaf.
Method Detail

emptyType

public EmptyType emptyType()

setEmptyType

public void setEmptyType(EmptyType o)

traceTo

public Tree traceTo()

setTraceTo

public void setTraceTo(Tree t)

yield

public <T> java.util.List<T> yield(java.util.List<T> y)
A EmptyTreeLeaf is invisible in the yield

Overrides:
yield in class Tree
Parameters:
y - The list in which the yield of the tree will be placed. Normally, this will be empty when the routine is called, but if not, the new yield is added to the end of the list.
Returns:
a List of the data in the tree's leaves.

labeledYield

public java.util.List<LabeledWord> labeledYield(java.util.List<LabeledWord> y)
A EmptyTreeLeaf is invisible in the tagged yield

Overrides:
labeledYield in class Tree

toString

public java.lang.String toString()
prints the trace, plus the label and the yield of the pointed-to constituent

Specified by:
toString in interface Label
Overrides:
toString in class Tree
Returns:
the tree as a bracketed list on one line

treeFactory

public TreeFactory treeFactory()
major yuk here. Reproduces the emptyType and traceTo from the leaf out of which the treeFactory is vended.

Overrides:
treeFactory in class LabeledScoredTreeNode
Returns:
a factory to produce labeled, scored trees


Stanford NLP Group