net.didion.jwnl.data
Class Word

java.lang.Object
  extended by net.didion.jwnl.data.PointerTarget
      extended by net.didion.jwnl.data.Word
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Adjective, Verb

public class Word
extends PointerTarget

A Word represents the lexical information related to a specific sense of an IndexWord. Word's are linked by Pointers into a network of lexically related words. getTargets retrieves the targets of these links, and getPointers retrieves the pointers themselves.

See Also:
Serialized Form

Constructor Summary
Word(java.lang.String lemma, java.lang.String senseKey, int usageCnt)
          Proxy constructor for an unitialized word.
Word(Synset synset, int index, java.lang.String lemma)
          Constructs a word tied to a synset, it's position within the synset, and the lemma.
Word(Synset synset, int index, java.lang.String lemma, java.lang.String senseKey, int usageCnt)
          Creates a word with the synset, index, lemma, and senseKey.
 
Method Summary
 boolean equals(java.lang.Object object)
          Two words are equal if their parent Synsets are equal and they have the same index
 int getIndex()
          Gets the index of this word.
 java.lang.String getLemma()
          Gets the lemma of this word.
 Pointer[] getPointers()
          returns all the pointers of the synset that contains this word whose source is this word
 POS getPOS()
          Gets the part of speech of this word.
 java.lang.String getSenseKey()
          Gets the sense key for this Word.
 Synset getSynset()
          Gets the synset associated with this word.
 int getUsageCount()
          Gets the usage if this word has been tagged within WordNet.
 int hashCode()
           
 void setSenseKey(java.lang.String sk)
          Sets the sense key to this word.
 void setUsageCount(int usageTag)
          Sets the usage tag for this word.
 java.lang.String toString()
           
 
Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Word

public Word(java.lang.String lemma,
            java.lang.String senseKey,
            int usageCnt)
Proxy constructor for an unitialized word.

Parameters:
lemma -
senseKey -
usageCnt -

Word

public Word(Synset synset,
            int index,
            java.lang.String lemma)
Constructs a word tied to a synset, it's position within the synset, and the lemma.

Parameters:
synset - - the synset this word is contained in
index - - the position of the word in the synset (usage)
lemma - - the lemma of this word

Word

public Word(Synset synset,
            int index,
            java.lang.String lemma,
            java.lang.String senseKey,
            int usageCnt)
Creates a word with the synset, index, lemma, and senseKey.

Parameters:
synset - the synset
index - the index
lemma - the lemma
senseKey -
usageCnt -
Method Detail

equals

public boolean equals(java.lang.Object object)
Two words are equal if their parent Synsets are equal and they have the same index

Overrides:
equals in class PointerTarget

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in class PointerTarget

getSynset

public Synset getSynset()
Gets the synset associated with this word.

Returns:
synset

getPOS

public POS getPOS()
Gets the part of speech of this word.

Specified by:
getPOS in class PointerTarget
Returns:
part of speech

getIndex

public int getIndex()
Gets the index of this word.

Returns:
index

getLemma

public java.lang.String getLemma()
Gets the lemma of this word.

Returns:
lemma

setSenseKey

public void setSenseKey(java.lang.String sk)
Sets the sense key to this word.

Parameters:
sk - the sense key

getSenseKey

public java.lang.String getSenseKey()
Gets the sense key for this Word. For more information, see SenseIdX(5WN) in WordNet documentation.

Returns:
WordNet sense key

getPointers

public Pointer[] getPointers()
returns all the pointers of the synset that contains this word whose source is this word

Specified by:
getPointers in class PointerTarget

getUsageCount

public int getUsageCount()
Gets the usage if this word has been tagged within WordNet.

Returns:
- the usage number.

setUsageCount

public void setUsageCount(int usageTag)
Sets the usage tag for this word.

Parameters:
usageTag - - usage number in tagged texts.