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 Word
s, 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 Pointer
s 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 |
---|---|
protected 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 BitSet |
_verbFrameFlags |
protected Word[] |
_words
The words in this synset.
|
protected String |
lexFileName
The proper name for the lexicographer file (noun.plant, etc)
|
protected long |
lexFileNum
The lexicographer file name id.
|
Constructor and Description |
---|
Synset(POS pos,
long offset,
Word[] words,
Pointer[] pointers,
String gloss,
BitSet verbFrames) |
Synset(POS pos,
long offset,
Word[] words,
Pointer[] pointers,
String gloss,
BitSet verbFrames,
boolean isAdjectiveCluster) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsWord(String lemma)
Returns true if
lemma is one of the words contained in this synset. |
boolean |
equals(Object object)
Two Synsets are equal if their POS's and offsets are equal
|
String |
getGloss() |
Object |
getKey()
Get a key that can be used to index this element.
|
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
|
String |
getSenseKey(String lemma)
Gets the sense key of a lemma.
|
DictionaryElementType |
getType()
Get the element's type.
|
BitSet |
getVerbFrameFlags() |
int[] |
getVerbFrameIndicies() |
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() |
void |
setLexFileNum(long lexFileId)
Sets the lexicographer file name containing this synset.
|
String |
toString() |
getPointers, getTargets, getTargets
protected POS _pos
protected Pointer[] _pointers
protected long _offset
protected Word[] _words
protected String _gloss
protected BitSet _verbFrameFlags
protected boolean _isAdjectiveCluster
protected long lexFileNum
protected String lexFileName
public Synset(POS pos, long offset, Word[] words, Pointer[] pointers, String gloss, BitSet verbFrames)
public DictionaryElementType getType()
DictionaryElement
getType
in interface DictionaryElement
public boolean equals(Object object)
equals
in class PointerTarget
public String toString()
toString
in class PointerTarget
public POS getPOS()
PointerTarget
getPOS
in class PointerTarget
public Pointer[] getPointers()
PointerTarget
getPointers
in class PointerTarget
public String getGloss()
public Word[] getWords()
public int getWordsSize()
public Word getWord(int index)
public long getOffset()
public Object getKey()
DictionaryElement
getKey
in interface DictionaryElement
public boolean isAdjectiveCluster()
public String[] getVerbFrames()
public BitSet getVerbFrameFlags()
public int[] getVerbFrameIndicies()
public boolean containsWord(String lemma)
lemma
is one of the words contained in this synset.public long getLexFileNum()
public void setLexFileNum(long lexFileId)
lexFileId
- - the lexicographer file name idpublic String getLexFileName()
Copyright © 2023. All rights reserved.