net.sf.extjwnl.data
Class Word

java.lang.Object
  extended by net.sf.extjwnl.data.PointerTarget
      extended by net.sf.extjwnl.data.Word
All Implemented Interfaces:
Serializable, Owned
Direct Known Subclasses:
Adjective, Verb

public class Word
extends PointerTarget

A Word represents the lexical information related to a specific sense of an IndexWord. Word's are linked by Pointers into a network of lexically related words. getTargets retrieves the targets of these links, and getPointers retrieves the pointers themselves.

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

Field Summary
 
Fields inherited from class net.sf.extjwnl.data.PointerTarget
dictionary
 
Constructor Summary
Word(Dictionary dictionary, Synset synset, int index, String lemma)
          Constructs a word tied to a synset, it's position within the synset, and the lemma.
 
Method Summary
 boolean equals(Object object)
          Two words are equal if their parent Synsets are equal and they have the same lemma
 int getIndex()
          Returns the index of this word.
 String getLemma()
          Returns the lemma of this word.
 long getLexId()
          Returns the lexicographer id that identifies this lemma
 List<Pointer> getPointers()
          Returns all the pointers of the synset that contains this word whose source is this word.
 POS getPOS()
          Returns the part of speech of this word.
 String getSenseKey()
          Returns the sense key of a lemma.
 String getSenseKeyWithAdjClass()
          Returns the sense key of a lemma, taking into account adjective class (position).
 String getSummary()
          Returns the summary calculated among all senses.
 String getSummary(List<Synset> senses)
          Returns the summary, calculated among given set of senses.
 Synset getSynset()
          Returns the synset associated with this word.
 int getUseCount()
          Returns the number of times each tagged sense occurs in a semantic concordance.
 int hashCode()
           
 void setIndex(int index)
          Sets the index of this word.
 void setLexId(long lexId)
          Sets the lexicographer id that identifies this lemma.
 void setSummary(String summary)
           
 void setUseCount(int useCount)
          Sets the number of times each tagged sense occurs in a semantic concordance.
 String toString()
           
 
Methods inherited from class net.sf.extjwnl.data.PointerTarget
getDictionary, getPointers, getTargets, getTargets, setDictionary
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Word

public Word(Dictionary dictionary,
            Synset synset,
            int index,
            String lemma)
Constructs a word tied to a synset, it's position within the synset, and the lemma.

Parameters:
dictionary - owner
synset - the synset this word is contained in
index - the position of the word in the synset (usage)
lemma - the lemma of this word
Method Detail

equals

public boolean equals(Object object)
Two words are equal if their parent Synsets are equal and they have the same lemma

Overrides:
equals in class PointerTarget

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Specified by:
toString in class PointerTarget

getLexId

public long getLexId()
Returns the lexicographer id that identifies this lemma

Returns:
the lexicographer id that identifies this lemma

setLexId

public void setLexId(long lexId)
Sets the lexicographer id that identifies this lemma.

Parameters:
lexId - the lexicographer id that identifies this lemma

getSynset

public Synset getSynset()
Returns the synset associated with this word.

Specified by:
getSynset in class PointerTarget
Returns:
the synset associated with this word

getPOS

public POS getPOS()
Returns the part of speech of this word.

Specified by:
getPOS in class PointerTarget
Returns:
the part of speech

getIndex

public int getIndex()
Returns the index of this word. NB Word numbers are assigned to the word fields in a synset, from left to right, beginning with 1.

Specified by:
getIndex in class PointerTarget
Returns:
the index of this word

setIndex

public void setIndex(int index)
Sets the index of this word. NB Word numbers are assigned to the word fields in a synset, from left to right, beginning with 1.

Parameters:
index - the index of this word

getLemma

public String getLemma()
Returns the lemma of this word.

Returns:
the lemma of this word

getUseCount

public int getUseCount()
Returns the number of times each tagged sense occurs in a semantic concordance.

Returns:
the number of times each tagged sense occurs in a semantic concordance

setUseCount

public void setUseCount(int useCount)
Sets the number of times each tagged sense occurs in a semantic concordance.

Parameters:
useCount - number of times each tagged sense occurs in a semantic concordance

getPointers

public List<Pointer> getPointers()
Returns all the pointers of the synset that contains this word whose source is this word.

Specified by:
getPointers in class PointerTarget
Returns:
a list of Target's pointers

getSummary

public String getSummary()
                  throws JWNLException
Returns the summary calculated among all senses.

Returns:
summary
Throws:
JWNLException - JWNLException

getSummary

public String getSummary(List<Synset> senses)
                  throws JWNLException
Returns the summary, calculated among given set of senses. Useful during disambiguation when some senses are already pruned.

Parameters:
senses - set of senses
Returns:
summary
Throws:
JWNLException - JWNLException

setSummary

public void setSummary(String summary)

getSenseKey

public String getSenseKey()
Returns the sense key of a lemma.

Returns:
sense key

getSenseKeyWithAdjClass

public String getSenseKeyWithAdjClass()
Returns the sense key of a lemma, taking into account adjective class (position).

Returns:
sense key


Copyright © 2011. All Rights Reserved.