edu.stanford.nlp.trees
Class WeightedFollowedTaggedWord

java.lang.Object
  |
  +--edu.stanford.nlp.trees.AbstractLabel
        |
        +--edu.stanford.nlp.trees.StringLabel
              |
              +--edu.stanford.nlp.trees.Word
                    |
                    +--edu.stanford.nlp.trees.TaggedWord
                          |
                          +--edu.stanford.nlp.trees.WeightedFollowedTaggedWord
All Implemented Interfaces:
Comparable, HasFollow, HasTag, HasWord, Label, Weighted

public class WeightedFollowedTaggedWord
extends TaggedWord
implements HasFollow, Weighted

A WeightedFollowedTaggedWord object contains a word and its tag, but it also records what text follows the token. This can be used to reconstruct the original source text. It also stores a weight for the token, so that one can do token feature weighting. The value() of a TaggedWord is the Word. The tag and other attributes are secondary.


Field Summary
 
Fields inherited from class edu.stanford.nlp.trees.Word
EMPTY, EMPTYSTRING
 
Constructor Summary
WeightedFollowedTaggedWord()
           
WeightedFollowedTaggedWord(Label oldLabel)
           
WeightedFollowedTaggedWord(Label word, Label tag)
           
WeightedFollowedTaggedWord(String word)
           
WeightedFollowedTaggedWord(String word, String tag)
           
WeightedFollowedTaggedWord(String word, String tag, String follow, double weight)
           
 
Method Summary
 String follow()
          Return the follow value of the label (or null if none).
 LabelFactory labelFactory()
          Returns a factory that makes WeightedFollowedTaggedWords
 void setFollow(String follow)
          Set the follow value for the label (if one is stored).
 void setWeight(double weight)
          Set the weight of this thing
 String toString()
          Return a string representation of the label.
 double weight()
          Return the weight of this thing
 
Methods inherited from class edu.stanford.nlp.trees.TaggedWord
factory, setFromString, setTag, tag
 
Methods inherited from class edu.stanford.nlp.trees.Word
setWord, word
 
Methods inherited from class edu.stanford.nlp.trees.StringLabel
setValue, value
 
Methods inherited from class edu.stanford.nlp.trees.AbstractLabel
compareTo, equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord()

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord(String word)

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord(String word,
                                  String tag)

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord(String word,
                                  String tag,
                                  String follow,
                                  double weight)

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord(Label oldLabel)

WeightedFollowedTaggedWord

public WeightedFollowedTaggedWord(Label word,
                                  Label tag)
Method Detail

follow

public String follow()
Description copied from interface: HasFollow
Return the follow value of the label (or null if none).

Specified by:
follow in interface HasFollow
Returns:
String the follow value for the label

setFollow

public void setFollow(String follow)
Description copied from interface: HasFollow
Set the follow value for the label (if one is stored).

Specified by:
setFollow in interface HasFollow
Parameters:
follow - The follow value for the label

weight

public double weight()
Description copied from interface: Weighted
Return the weight of this thing

Specified by:
weight in interface Weighted
Returns:
the weight

setWeight

public void setWeight(double weight)
Description copied from interface: Weighted
Set the weight of this thing

Specified by:
setWeight in interface Weighted
Parameters:
weight - the weight

toString

public String toString()
Description copied from class: AbstractLabel
Return a string representation of the label. This will just be the value() if it is non-null, and the empty string otherwise.

Specified by:
toString in interface Label
Overrides:
toString in class TaggedWord
Returns:
the string representation

labelFactory

public LabelFactory labelFactory()
Returns a factory that makes WeightedFollowedTaggedWords

Specified by:
labelFactory in interface Label
Overrides:
labelFactory in class TaggedWord
Returns:
the LabelFactory for WeightedFollowedTaggedWords


Stanford NLP Group