Package net.didion.jwnl.data
Class IndexWord
java.lang.Object
net.didion.jwnl.data.IndexWord
- All Implemented Interfaces:
Serializable
,DictionaryElement
An
IndexWord
represents a line of the pos.index
file.
An IndexWord
is created or retrieved via lookupIndexWord
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private String
The string representation of this IndexWordprivate POS
This word's part-of-speechprivate long[]
senses are initially stored as offsets, and paged in on demand.private Synset[]
This is null until getSenses has been called.private boolean
True when all synsets have been loaded(package private) static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the lemma and the part of speech both match.getKey()
Gets the lemma of this word.getLemma()
Return the word'slemma .getPOS()
Get the word's part-of-speech.getSense
(int index) Get a particular sense of this word.int
Get the word's sense count.Synset[]
Get an array of all the senses of this word.long[]
getType()
Get the element's type.int
hashCode()
private void
loadSynset
(int i) private void
toString()
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
_pos
This word's part-of-speech -
_lemma
The string representation of this IndexWord -
_synsetOffsets
private long[] _synsetOffsetssenses are initially stored as offsets, and paged in on demand. -
_synsets
This is null until getSenses has been called. -
_synsetsLoaded
private transient boolean _synsetsLoadedTrue when all synsets have been loaded -
_cachedToString
-
-
Constructor Details
-
IndexWord
-
-
Method Details
-
getType
Description copied from interface:DictionaryElement
Get the element's type.- Specified by:
getType
in interfaceDictionaryElement
-
equals
Returns true if the lemma and the part of speech both match. -
hashCode
public int hashCode() -
toString
-
getPOS
Get the word's part-of-speech. -
getLemma
Return the word'slemma . Its lemma is its orthographic representation, for example"dog"
or"get up"
. -
getSynsetOffsets
public long[] getSynsetOffsets() -
getKey
Gets the lemma of this word.- Specified by:
getKey
in interfaceDictionaryElement
- Returns:
- lemma
-
getSenseCount
public int getSenseCount()Get the word's sense count. -
getSenses
Get an array of all the senses of this word.- Throws:
JWNLException
-
getSense
Get a particular sense of this word. Sense indices start at 1.- Throws:
JWNLException
-
loadSynset
- Throws:
JWNLException
-
readObject
- Throws:
IOException
ClassNotFoundException
-