Class IndexWord

java.lang.Object
net.didion.jwnl.data.IndexWord
All Implemented Interfaces:
Serializable, DictionaryElement

public class IndexWord extends Object implements DictionaryElement
An IndexWord represents a line of the pos.index file. An IndexWord is created or retrieved via lookupIndexWord.
See Also:
  • Constructor Details

    • IndexWord

      public IndexWord(String lemma, POS pos, long[] synsetOffsets)
  • Method Details

    • getType

      public DictionaryElementType getType()
      Description copied from interface: DictionaryElement
      Get the element's type.
      Specified by:
      getType in interface DictionaryElement
    • equals

      public boolean equals(Object object)
      Returns true if the lemma and the part of speech both match.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPOS

      public POS getPOS()
      Get the word's part-of-speech.
    • getLemma

      public String getLemma()
      Return the word's lemma. Its lemma is its orthographic representation, for example "dog" or "get up".
    • getSynsetOffsets

      public long[] getSynsetOffsets()
    • getKey

      public Object getKey()
      Gets the lemma of this word.
      Specified by:
      getKey in interface DictionaryElement
      Returns:
      lemma
    • getSenseCount

      public int getSenseCount()
      Get the word's sense count.
    • getSenses

      public Synset[] getSenses() throws JWNLException
      Get an array of all the senses of this word.
      Throws:
      JWNLException
    • getSense

      public Synset getSense(int index) throws JWNLException
      Get a particular sense of this word. Sense indices start at 1.
      Throws:
      JWNLException