Package net.didion.jwnl.data
Class Word
- java.lang.Object
-
- net.didion.jwnl.data.PointerTarget
-
- net.didion.jwnl.data.Word
-
- All Implemented Interfaces:
java.io.Serializable
public class Word extends PointerTarget
AWord
represents the lexical information related to a specific sense of anIndexWord
.Word
's are linked byPointer
s into a network of lexically related words.getTargets
retrieves the targets of these links, andgetPointers
retrieves the pointers themselves.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_cachedToString
private int
_index
This word's index within the synset.private java.lang.String
_lemma
The string representation of the word.private Synset
_synset
The Synset to which this word belongs.protected int
lexId
The lexicographer id that identifies this lemma.private static long
serialVersionUID
The serialization id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Two words are equal if their parent Synsets are equal and they have the same indexint
getIndex()
Gets the index of this word.java.lang.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 wordPOS
getPOS()
Gets the part of speech of this word.Synset
getSynset()
Gets the synset associated with this word.int
hashCode()
void
setLexId(int lexId)
java.lang.String
toString()
-
Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialization id.- See Also:
- Constant Field Values
-
_synset
private Synset _synset
The Synset to which this word belongs.
-
_index
private int _index
This word's index within the synset.
-
_lemma
private java.lang.String _lemma
The string representation of the word.
-
lexId
protected int lexId
The lexicographer id that identifies this lemma.
-
_cachedToString
private transient java.lang.String _cachedToString
-
-
Constructor Detail
-
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 inindex
- - 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(java.lang.Object object)
Two words are equal if their parent Synsets are equal and they have the same index- Overrides:
equals
in classPointerTarget
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toString
in classPointerTarget
-
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 classPointerTarget
- 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
-
getPointers
public Pointer[] getPointers()
returns all the pointers of the synset that contains this word whose source is this word- Specified by:
getPointers
in classPointerTarget
-
-