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 Stringprivate StringThe string representation of this IndexWordprivate POSThis 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 booleanTrue when all synsets have been loaded(package private) static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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.intGet the word's sense count.Synset[]Get an array of all the senses of this word.long[]getType()Get the element's type.inthashCode()private voidloadSynset(int i) private voidtoString()
-
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:DictionaryElementGet the element's type.- Specified by:
getTypein 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:
getKeyin 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:
IOExceptionClassNotFoundException
-