public class Synset extends PointerTarget implements DictionaryElement
Synset, or synonym set, represents a
line of a WordNet pos.data file. A Synset
represents a concept, and contains a set of Words, each of
which has a sense that names that concept (and each of which is therefore
synonymous with the other words in the Synset).
Synset's are linked by Pointers into a network of related
concepts; this is the getTargets
retrieves the targets of these links, and getPointers
retrieves the pointers themselves.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
_cachedToString |
protected java.lang.String |
_gloss
The text (definition, usage examples) associated with the synset.
|
protected boolean |
_isAdjectiveCluster
for use only with WordNet 1.6 and earlier
|
protected long |
_offset
The offset of this synset in the data file.
|
protected Pointer[] |
_pointers |
protected POS |
_pos |
protected java.util.BitSet |
_verbFrameFlags |
protected Word[] |
_words
The words in this synset.
|
protected java.lang.String |
lexFileName
The proper name for the lexicographer file (noun.plant, etc)
|
protected long |
lexFileNum
The lexicographer file name id.
|
(package private) static long |
serialVersionUID |
| Constructor and Description |
|---|
Synset(POS pos,
long offset,
Word[] words,
Pointer[] pointers,
java.lang.String gloss,
java.util.BitSet verbFrames) |
Synset(POS pos,
long offset,
Word[] words,
Pointer[] pointers,
java.lang.String gloss,
java.util.BitSet verbFrames,
boolean isAdjectiveCluster) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsWord(java.lang.String lemma)
Returns true if
lemma is one of the words contained in this synset. |
boolean |
equals(java.lang.Object object)
Two Synsets are equal if their POS's and offsets are equal
|
java.lang.String |
getGloss() |
java.lang.Object |
getKey()
Get a key that can be used to index this element.
|
java.lang.String |
getLexFileName()
Gets the lex file name.
|
long |
getLexFileNum()
Gets the lexicographer file name containing this synset.
|
long |
getOffset() |
Pointer[] |
getPointers()
Return a list of Target's pointers
|
POS |
getPOS()
Return this target's POS
|
java.lang.String |
getSenseKey(java.lang.String lemma)
Gets the sense key of a lemma.
|
DictionaryElementType |
getType()
Get the element's type.
|
java.util.BitSet |
getVerbFrameFlags() |
int[] |
getVerbFrameIndicies() |
java.lang.String[] |
getVerbFrames()
Returns all Verb Frames that are valid for all the words in this synset
|
Word |
getWord(int index) |
Word[] |
getWords() |
int |
getWordsSize() |
int |
hashCode() |
boolean |
isAdjectiveCluster() |
private void |
readObject(java.io.ObjectInputStream in) |
void |
setLexFileNum(long lexFileId)
Sets the lexicographer file name containing this synset.
|
java.lang.String |
toString() |
getPointers, getTargets, getTargetsstatic final long serialVersionUID
protected POS _pos
protected Pointer[] _pointers
protected long _offset
protected Word[] _words
protected java.lang.String _gloss
protected java.util.BitSet _verbFrameFlags
protected boolean _isAdjectiveCluster
protected long lexFileNum
protected java.lang.String lexFileName
private transient java.lang.String _cachedToString
public Synset(POS pos, long offset, Word[] words, Pointer[] pointers, java.lang.String gloss, java.util.BitSet verbFrames)
public DictionaryElementType getType()
DictionaryElementgetType in interface DictionaryElementpublic boolean equals(java.lang.Object object)
equals in class PointerTargetpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class PointerTargetpublic POS getPOS()
PointerTargetgetPOS in class PointerTargetpublic Pointer[] getPointers()
PointerTargetgetPointers in class PointerTargetpublic java.lang.String getGloss()
public Word[] getWords()
public int getWordsSize()
public Word getWord(int index)
public long getOffset()
public java.lang.Object getKey()
DictionaryElementgetKey in interface DictionaryElementpublic boolean isAdjectiveCluster()
public java.lang.String[] getVerbFrames()
public java.util.BitSet getVerbFrameFlags()
public int[] getVerbFrameIndicies()
public boolean containsWord(java.lang.String lemma)
lemma is one of the words contained in this synset.private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic long getLexFileNum()
public void setLexFileNum(long lexFileId)
lexFileId - - the lexicographer file name idpublic java.lang.String getLexFileName()
public java.lang.String getSenseKey(java.lang.String lemma)
lemma - lemma sense to grab