edu.stanford.nlp.trees
Class LabeledConstituent

java.lang.Object
  extended by edu.stanford.nlp.trees.Constituent
      extended by edu.stanford.nlp.trees.SimpleConstituent
          extended by edu.stanford.nlp.trees.LabeledConstituent
All Implemented Interfaces:
Label, Labeled, Scored
Direct Known Subclasses:
LabeledScoredConstituent, WordCatConstituent

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.

Author:
Christopher Manning

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.
LabeledConstituent(int start, int end, String stringValue)
          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 setFromString(String labelStr)
          Make a new label with this String as the "name", perhaps by doing some appropriate decoding of the string.
 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
contains, crosses, crosses, equals, hashCode, labels, score, 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

LabeledConstituent

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

Parameters:
start - Start node of edge
end - End node of edge
stringValue - The name 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
Parameters:
label - The Label value

setFromString

public void setFromString(String labelStr)
Description copied from class: Constituent
Make a new label with this String as the "name", perhaps by doing some appropriate decoding of the string.

Specified by:
setFromString in interface Label
Overrides:
setFromString in class Constituent
Parameters:
labelStr - the String that translates into the content of the label

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