public class IndexWord extends java.lang.Object implements DictionaryElement
IndexWord represents a line of the pos.index file.
An IndexWord is created or retrieved via lookupIndexWord.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
_cachedToString |
private java.lang.String |
_lemma
The string representation of this IndexWord
|
private POS |
_pos
This word's part-of-speech
|
private long[] |
_synsetOffsets
senses are initially stored as offsets, and paged in on demand.
|
private Synset[] |
_synsets
This is null until getSenses has been called.
|
private boolean |
_synsetsLoaded
True when all synsets have been loaded
|
(package private) static long |
serialVersionUID |
| Constructor and Description |
|---|
IndexWord(java.lang.String lemma,
POS pos,
long[] synsetOffsets) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Returns true if the lemma and the part of speech both match.
|
java.lang.Object |
getKey()
Gets the lemma of this word.
|
java.lang.String |
getLemma()
Return the word's
|
POS |
getPOS()
Get the word's part-of-speech.
|
Synset |
getSense(int index)
Get a particular sense of this word.
|
int |
getSenseCount()
Get the word's sense count.
|
Synset[] |
getSenses()
Get an array of all the senses of this word.
|
long[] |
getSynsetOffsets() |
DictionaryElementType |
getType()
Get the element's type.
|
int |
hashCode() |
private void |
loadSynset(int i) |
private void |
readObject(java.io.ObjectInputStream in) |
java.lang.String |
toString() |
static final long serialVersionUID
private POS _pos
private java.lang.String _lemma
private long[] _synsetOffsets
private transient Synset[] _synsets
private transient boolean _synsetsLoaded
private transient java.lang.String _cachedToString
public IndexWord(java.lang.String lemma,
POS pos,
long[] synsetOffsets)
public DictionaryElementType getType()
DictionaryElementgetType in interface DictionaryElementpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic POS getPOS()
public java.lang.String getLemma()
"dog" or "get up".public long[] getSynsetOffsets()
public java.lang.Object getKey()
getKey in interface DictionaryElementpublic int getSenseCount()
public Synset[] getSenses() throws JWNLException
JWNLExceptionpublic Synset getSense(int index) throws JWNLException
JWNLExceptionprivate void loadSynset(int i)
throws JWNLException
JWNLExceptionprivate void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundException