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:
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

Field Summary
protected  int lexId
          The lexicographer id that identifies this lemma.
 
Constructor Summary
Word(Synset synset, int index, String lemma)
          Constructs a word tied to a synset, it's position within the synset, and the lemma.
 
Method Summary
 boolean equals(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.
 String getLemma()
          Gets the lemma of this word.
 int getLexId()
           
 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.
 Synset getSynset()
          Gets the synset associated with this word.
 int hashCode()
           
 void setLexId(int lexId)
           
 String toString()
           
 
Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

lexId

protected int lexId
The lexicographer id that identifies this lemma.

Constructor Detail

Word

public Word(Synset synset,
            int index,
            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
Method Detail

getLexId

public int getLexId()

setLexId

public void setLexId(int lexId)

equals

public boolean equals(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 Object

toString

public 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 String getLemma()
Gets the lemma of this word.

Returns:
lemma

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


Copyright © 2011. All Rights Reserved.