Package net.didion.jwnl.data
Class Synset
java.lang.Object
net.didion.jwnl.data.PointerTarget
net.didion.jwnl.data.Synset
- All Implemented Interfaces:
Serializable
,DictionaryElement
- Direct Known Subclasses:
SynsetProxy
A
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
protected String
The text (definition, usage examples) associated with the synset.protected boolean
for use only with WordNet 1.6 and earlierprotected long
The offset of this synset in the data file.protected Pointer[]
protected POS
protected BitSet
protected Word[]
The words in this synset.protected String
The proper name for the lexicographer file (noun.plant, etc)protected long
The lexicographer file name id.(package private) static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsWord
(String lemma) Returns true iflemma
is one of the words contained in this synset.boolean
Two Synsets are equal if their POS's and offsets are equalgetGloss()
getKey()
Get a key that can be used to index this element.Gets the lex file name.long
Gets the lexicographer file name containing this synset.long
Pointer[]
Return a list of Target's pointersgetPOS()
Return this target's POSgetSenseKey
(String lemma) Gets the sense key of a lemma.getType()
Get the element's type.int[]
String[]
Returns all Verb Frames that are valid for all the words in this synsetgetWord
(int index) Word[]
getWords()
int
int
hashCode()
boolean
private void
void
setLexFileNum
(long lexFileId) Sets the lexicographer file name containing this synset.toString()
Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
_pos
-
_pointers
-
_offset
protected long _offsetThe offset of this synset in the data file. -
_words
The words in this synset. -
_gloss
The text (definition, usage examples) associated with the synset. -
_verbFrameFlags
-
_isAdjectiveCluster
protected boolean _isAdjectiveClusterfor use only with WordNet 1.6 and earlier -
lexFileNum
protected long lexFileNumThe lexicographer file name id. -
lexFileName
The proper name for the lexicographer file (noun.plant, etc) -
_cachedToString
-
-
Constructor Details
-
Synset
-
Synset
-
-
Method Details
-
getType
Description copied from interface:DictionaryElement
Get the element's type.- Specified by:
getType
in interfaceDictionaryElement
-
equals
Two Synsets are equal if their POS's and offsets are equal- Overrides:
equals
in classPointerTarget
-
hashCode
public int hashCode() -
toString
- Specified by:
toString
in classPointerTarget
-
getPOS
Description copied from class:PointerTarget
Return this target's POS- Specified by:
getPOS
in classPointerTarget
-
getPointers
Description copied from class:PointerTarget
Return a list of Target's pointers- Specified by:
getPointers
in classPointerTarget
-
getGloss
-
getWords
-
getWordsSize
public int getWordsSize() -
getWord
-
getOffset
public long getOffset() -
getKey
Description copied from interface:DictionaryElement
Get a key that can be used to index this element.- Specified by:
getKey
in interfaceDictionaryElement
-
isAdjectiveCluster
public boolean isAdjectiveCluster() -
getVerbFrames
Returns all Verb Frames that are valid for all the words in this synset -
getVerbFrameFlags
-
getVerbFrameIndicies
public int[] getVerbFrameIndicies() -
containsWord
Returns true iflemma
is one of the words contained in this synset. -
readObject
- Throws:
IOException
ClassNotFoundException
-
getLexFileNum
public long getLexFileNum()Gets the lexicographer file name containing this synset.- Returns:
- two digit decimal integer
-
setLexFileNum
public void setLexFileNum(long lexFileId) Sets the lexicographer file name containing this synset.- Parameters:
lexFileId
- - the lexicographer file name id
-
getLexFileName
Gets the lex file name.- Returns:
-
getSenseKey
Gets the sense key of a lemma. This will be refactored in 2.0 with the architecture reworking.- Parameters:
lemma
- lemma sense to grab- Returns:
- sense key for lemma
-