public class Word extends PointerTarget
Word
represents the lexical information related to a specific sense of an IndexWord
.
Word
's are linked by Pointer
s into a network of lexically related words.
getTargets
retrieves the targets of these links, and
getPointers
retrieves the pointers themselves.dictionary
Constructor and Description |
---|
Word(Dictionary dictionary,
Synset synset,
java.lang.String lemma)
Constructs a word tied to a synset, it's position within the synset, and the lemma.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Two words are equal if their parent Synsets are equal and they have the same lemma
|
int |
getIndex()
Returns the number of this word (1-based) or 0 if not found.
|
java.lang.String |
getLemma()
Returns the lemma of this word.
|
int |
getLexId()
Returns the lexicographer id that identifies this lemma
|
java.util.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.
|
java.lang.String |
getSenseKey()
Returns the sense key of a lemma.
|
java.lang.String |
getSenseKeyWithAdjClass()
Returns the sense key of a lemma, taking into account adjective class (position).
|
int |
getSenseNumber()
Returns sense number of this word (1-based) or 0 if not found.
|
Synset |
getSynset()
Returns the synset associated with this word.
|
protected int |
getSynsetType() |
int |
getUseCount()
Returns the number of times each tagged sense occurs in a semantic concordance.
|
int |
hashCode() |
void |
setLexId(int lexId)
Sets the lexicographer id that identifies this lemma.
|
void |
setUseCount(int useCount)
Sets the number of times each tagged sense occurs in a semantic concordance.
|
protected java.lang.StringBuilder |
startBuildingSenseKey(int ss_type) |
java.lang.String |
toString() |
getDictionary, getPointers, getTargets, getTargets, setDictionary
public Word(Dictionary dictionary, Synset synset, java.lang.String lemma)
dictionary
- ownersynset
- the synset this word is contained inlemma
- the lemma of this wordpublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class PointerTarget
public int getLexId()
public void setLexId(int lexId)
lexId
- the lexicographer id that identifies this lemmapublic Synset getSynset()
getSynset
in class PointerTarget
public POS getPOS()
getPOS
in class PointerTarget
public int getIndex()
getIndex
in class PointerTarget
public java.lang.String getLemma()
public int getUseCount()
public void setUseCount(int useCount)
useCount
- number of times each tagged sense occurs in a semantic concordancepublic java.util.List<Pointer> getPointers()
getPointers
in class PointerTarget
public java.lang.String getSenseKey() throws JWNLException
JWNLException
- JWNLExceptionpublic java.lang.String getSenseKeyWithAdjClass() throws JWNLException
JWNLException
- JWNLExceptionpublic int getSenseNumber() throws JWNLException
JWNLException
- JWNLExceptionprotected int getSynsetType()
protected java.lang.StringBuilder startBuildingSenseKey(int ss_type)