edu.stanford.nlp.parser.lexparser
Class IntTaggedWord

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.IntTaggedWord
All Implemented Interfaces:
Serializable, Comparable<IntTaggedWord>

public class IntTaggedWord
extends Object
implements Serializable, Comparable<IntTaggedWord>

Represents a WordTag (in the sense that equality is defined on both components), where each half is represented by an int indexed by a Index. In this representation, -1 is used to represent the wildcard ANY value, and -2 is used to represent a STOP value (i.e., no more dependents). TODO: does that cause any problems regarding unseen words also being -1? TODO: any way to not have links to the Index in each object?

Author:
Dan Klein, Christopher Manning
See Also:
Serialized Form

Field Summary
static String ANY
           
static int ANY_TAG_INT
           
static int ANY_WORD_INT
           
static String STOP
           
static int STOP_TAG_INT
           
static int STOP_WORD_INT
           
 short tag
           
 int word
           
 
Constructor Summary
IntTaggedWord(int word, int tag)
           
IntTaggedWord(String s, char splitChar, Index<String> wordIndex, Index<String> tagIndex)
          Creates an IntTaggedWord given by the String representation of the form <word>|<tag*gt;
IntTaggedWord(String wordString, String tagString, Index<String> wordIndex, Index<String> tagIndex)
          Creates an IntTaggedWord given by the tagString and wordString
 
Method Summary
 int compareTo(IntTaggedWord that)
           
 boolean equals(Object o)
           
 int hashCode()
           
 int tag()
           
 String tagString(Index<String> tagIndex)
           
 String toLexicalEntry(Index<String> wordIndex, Index<String> tagIndex)
           
 String toString()
           
 String toString(Index<String> wordIndex, Index<String> tagIndex)
           
 String toString(String arg, Index<String> wordIndex, Index<String> tagIndex)
           
 TaggedWord toTaggedWord(Index<String> wordIndex, Index<String> tagIndex)
           
 int word()
           
 String wordString(Index<String> wordIndex)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_WORD_INT

public static final int ANY_WORD_INT
See Also:
Constant Field Values

ANY_TAG_INT

public static final int ANY_TAG_INT
See Also:
Constant Field Values

STOP_WORD_INT

public static final int STOP_WORD_INT
See Also:
Constant Field Values

STOP_TAG_INT

public static final int STOP_TAG_INT
See Also:
Constant Field Values

ANY

public static final String ANY
See Also:
Constant Field Values

STOP

public static final String STOP
See Also:
Constant Field Values

word

public final int word

tag

public final short tag
Constructor Detail

IntTaggedWord

public IntTaggedWord(int word,
                     int tag)

IntTaggedWord

public IntTaggedWord(String s,
                     char splitChar,
                     Index<String> wordIndex,
                     Index<String> tagIndex)
Creates an IntTaggedWord given by the String representation of the form <word>|<tag*gt;


IntTaggedWord

public IntTaggedWord(String wordString,
                     String tagString,
                     Index<String> wordIndex,
                     Index<String> tagIndex)
Creates an IntTaggedWord given by the tagString and wordString

Method Detail

tag

public int tag()

word

public int word()

wordString

public String wordString(Index<String> wordIndex)

tagString

public String tagString(Index<String> tagIndex)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

compareTo

public int compareTo(IntTaggedWord that)
Specified by:
compareTo in interface Comparable<IntTaggedWord>

toLexicalEntry

public String toLexicalEntry(Index<String> wordIndex,
                             Index<String> tagIndex)

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(Index<String> wordIndex,
                       Index<String> tagIndex)

toString

public String toString(String arg,
                       Index<String> wordIndex,
                       Index<String> tagIndex)

toTaggedWord

public TaggedWord toTaggedWord(Index<String> wordIndex,
                               Index<String> tagIndex)


Stanford NLP Group