Package net.didion.jwnl.data
Class Word
java.lang.Object
net.didion.jwnl.data.PointerTarget
net.didion.jwnl.data.Word
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate intThis word's index within the synset.private StringThe string representation of the word.private SynsetThe Synset to which this word belongs.protected intThe lexicographer id that identifies this lemma.private static final longThe serialization id. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo words are equal if their parent Synsets are equal and they have the same indexintgetIndex()Gets the index of this word.getLemma()Gets the lemma of this word.intgetLexId()Pointer[]returns all the pointers of the synset that contains this word whose source is this wordgetPOS()Gets the part of speech of this word.Gets the synset associated with this word.inthashCode()voidsetLexId(int lexId) toString()Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDThe serialization id.- See Also:
-
_synset
The Synset to which this word belongs. -
_index
private int _indexThis word's index within the synset. -
_lemma
The string representation of the word. -
lexId
protected int lexIdThe lexicographer id that identifies this lemma. -
_cachedToString
-
-
Constructor Details
-
Word
Constructs a word tied to a synset, it's position within the synset, and the lemma.- Parameters:
synset- - the synset this word is contained inindex- - the position of the word in the synset (usage)lemma- - the lemma of this word
-
-
Method Details
-
getLexId
public int getLexId() -
setLexId
public void setLexId(int lexId) -
equals
Two words are equal if their parent Synsets are equal and they have the same index- Overrides:
equalsin classPointerTarget
-
hashCode
public int hashCode() -
toString
- Specified by:
toStringin classPointerTarget
-
getSynset
Gets the synset associated with this word.- Returns:
- synset
-
getPOS
Gets the part of speech of this word.- Specified by:
getPOSin classPointerTarget- Returns:
- part of speech
-
getIndex
public int getIndex()Gets the index of this word.- Returns:
- index
-
getLemma
Gets the lemma of this word.- Returns:
- lemma
-
getPointers
returns all the pointers of the synset that contains this word whose source is this word- Specified by:
getPointersin classPointerTarget
-