edu.stanford.nlp.trees
Class LabeledConstituent

java.lang.Object
  |
  +--edu.stanford.nlp.trees.Constituent
        |
        +--edu.stanford.nlp.trees.SimpleConstituent
              |
              +--edu.stanford.nlp.trees.LabeledConstituent
All Implemented Interfaces:
Comparable, Label, Labeled, Scored
Direct Known Subclasses:
LabeledScoredConstituent

public class LabeledConstituent
extends SimpleConstituent

A LabeledConstituent object represents a single bracketing in a derivation, including start and end points and Label information, but excluding probabilistic information. It is used to represent the basic information that is accumulated in exploring parses.


Constructor Summary
LabeledConstituent()
          Create an empty LabeledConstituent object.
LabeledConstituent(int start, int end)
          Create a LabeledConstituent object with given values.
LabeledConstituent(int start, int end, Label label)
          Create a LabeledConstituent object with given values.
 
Method Summary
 ConstituentFactory constituentFactory()
          Return a factory for this kind of constituent.
static ConstituentFactory factory()
          Return a factory for this kind of constituent.
 Label label()
          access label
 LabelFactory labelFactory()
          Return a factory for this kind of label.
 void setLabel(Label label)
          Sets the label associated with the current Constituent, if there is one.
 
Methods inherited from class edu.stanford.nlp.trees.SimpleConstituent
end, setEnd, setStart, start
 
Methods inherited from class edu.stanford.nlp.trees.Constituent
compareTo, equals, hashCode, labels, score, setFromString, setLabels, setScore, setValue, size, toSentenceString, toString, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabeledConstituent

public LabeledConstituent()
Create an empty LabeledConstituent object.


LabeledConstituent

public LabeledConstituent(int start,
                          int end)
Create a LabeledConstituent object with given values.

Parameters:
start - Start node of edge
end - End node of edge

LabeledConstituent

public LabeledConstituent(int start,
                          int end,
                          Label label)
Create a LabeledConstituent object with given values.

Parameters:
start - Start node of edge
end - End node of edge
label - The label of the Constituent
Method Detail

label

public Label label()
Description copied from class: Constituent
access label

Specified by:
label in interface Labeled
Overrides:
label in class Constituent
Returns:
One of the labels of the object (if there are multiple labels, preferably the primary label, if it exists). Returns null if there is no label.

setLabel

public void setLabel(Label label)
Description copied from class: Constituent
Sets the label associated with the current Constituent, if there is one.

Specified by:
setLabel in interface Labeled
Overrides:
setLabel in class Constituent

labelFactory

public LabelFactory labelFactory()
Return a factory for this kind of label. The factory returned is always the same one (a singleton)

Specified by:
labelFactory in interface Label
Overrides:
labelFactory in class SimpleConstituent
Returns:
the label factory

constituentFactory

public ConstituentFactory constituentFactory()
Return a factory for this kind of constituent. The factory returned is always the same one (a singleton).

Overrides:
constituentFactory in class SimpleConstituent
Returns:
The constituent factory

factory

public static ConstituentFactory factory()
Return a factory for this kind of constituent. The factory returned is always the same one (a singleton).

Returns:
The constituent factory


Stanford NLP Group