net.sf.extjwnl.data
Class IndexWord

java.lang.Object
  extended by net.sf.extjwnl.data.BaseDictionaryElement
      extended by net.sf.extjwnl.data.IndexWord
All Implemented Interfaces:
Serializable, DictionaryElement, Owned

public class IndexWord
extends BaseDictionaryElement

An IndexWord represents a line of the pos.index file. An IndexWord is created or retrieved via lookupIndexWord.

Author:
John Didion , Aliaksandr Autayeu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.extjwnl.data.BaseDictionaryElement
dictionary
 
Constructor Summary
protected IndexWord(Dictionary dictionary, String lemma, POS pos)
           
  IndexWord(Dictionary dictionary, String lemma, POS pos, long[] synsetOffsets)
           
  IndexWord(Dictionary dictionary, String lemma, POS pos, Synset synset)
           
 
Method Summary
 boolean equals(Object object)
          Returns true if the lemma and the part of speech both match.
 Object getKey()
          Returns the lemma of this word.
 String getLemma()
          Return the word's lemma.
 POS getPOS()
          Returns the word's part-of-speech.
 List<Synset> getSenses()
          Returns the senses of this word.
 long[] getSynsetOffsets()
           
 DictionaryElementType getType()
          Returns the element's type.
 int hashCode()
           
 int sortSenses()
          Sorts senses according to their use count.
 String toString()
           
 
Methods inherited from class net.sf.extjwnl.data.BaseDictionaryElement
getDictionary, setDictionary
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexWord

protected IndexWord(Dictionary dictionary,
                    String lemma,
                    POS pos)
             throws JWNLException
Throws:
JWNLException

IndexWord

public IndexWord(Dictionary dictionary,
                 String lemma,
                 POS pos,
                 Synset synset)
          throws JWNLException
Throws:
JWNLException

IndexWord

public IndexWord(Dictionary dictionary,
                 String lemma,
                 POS pos,
                 long[] synsetOffsets)
          throws JWNLException
Throws:
JWNLException
Method Detail

getType

public DictionaryElementType getType()
Description copied from interface: DictionaryElement
Returns the element's type.

Returns:
the element's type

getKey

public Object getKey()
Returns the lemma of this word.

Returns:
lemma

getPOS

public POS getPOS()
Returns the word's part-of-speech.

Returns:
the word's part-of-speech

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

getLemma

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

Returns:
the word's lemma

getSynsetOffsets

public long[] getSynsetOffsets()

getSenses

public List<Synset> getSenses()
Returns the senses of this word.

Returns:
all the senses of this word

sortSenses

public int sortSenses()
Sorts senses according to their use count.

Returns:
number of tagged senses (senses with non-zero use count)


Copyright © 2011. All Rights Reserved.