net.didion.jwnl.data
Class Synset

java.lang.Object
  extended by net.didion.jwnl.data.PointerTarget
      extended by net.didion.jwnl.data.Synset
All Implemented Interfaces:
java.io.Serializable, DictionaryElement
Direct Known Subclasses:
SynsetProxy

public class Synset
extends PointerTarget
implements DictionaryElement

A 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 Net in WordNet. getTargets retrieves the targets of these links, and getPointers retrieves the pointers themselves.

See Also:
Serialized Form

Constructor Summary
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)
          Deprecated.  
 
Method Summary
 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.
 long getLexFileId()
          Gets the lexicographer file name containing this synset.
 java.lang.String getLexFileName()
          Gets the lex file name.
 long getOffset()
           
 Pointer[] getPointers()
          Return a list of Target's pointers
 POS getPOS()
          Return this target's POS
 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()
           
 void setLexFileId(long lexFileId)
          Sets the lexicographer file name containing this synset.
 java.lang.String toString()
           
 
Methods inherited from class net.didion.jwnl.data.PointerTarget
getPointers, getTargets, getTargets
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Synset

public Synset(POS pos,
              long offset,
              Word[] words,
              Pointer[] pointers,
              java.lang.String gloss,
              java.util.BitSet verbFrames)

Synset

public Synset(POS pos,
              long offset,
              Word[] words,
              Pointer[] pointers,
              java.lang.String gloss,
              java.util.BitSet verbFrames,
              boolean isAdjectiveCluster)
Deprecated. 

Method Detail

getType

public DictionaryElementType getType()
Description copied from interface: DictionaryElement
Get the element's type.

Specified by:
getType in interface DictionaryElement

equals

public boolean equals(java.lang.Object object)
Two Synsets are equal if their POS's and offsets are equal

Overrides:
equals in class PointerTarget

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Specified by:
toString in class PointerTarget

getPOS

public POS getPOS()
Description copied from class: PointerTarget
Return this target's POS

Specified by:
getPOS in class PointerTarget

getPointers

public Pointer[] getPointers()
Description copied from class: PointerTarget
Return a list of Target's pointers

Specified by:
getPointers in class PointerTarget

getGloss

public java.lang.String getGloss()

getWords

public Word[] getWords()

getWordsSize

public int getWordsSize()

getWord

public Word getWord(int index)

getOffset

public long getOffset()

getKey

public java.lang.Object getKey()
Description copied from interface: DictionaryElement
Get a key that can be used to index this element.

Specified by:
getKey in interface DictionaryElement

isAdjectiveCluster

public boolean isAdjectiveCluster()

getVerbFrames

public java.lang.String[] getVerbFrames()
Returns all Verb Frames that are valid for all the words in this synset


getVerbFrameFlags

public java.util.BitSet getVerbFrameFlags()

getVerbFrameIndicies

public int[] getVerbFrameIndicies()

containsWord

public boolean containsWord(java.lang.String lemma)
Returns true if lemma is one of the words contained in this synset.


getLexFileId

public long getLexFileId()
Gets the lexicographer file name containing this synset.

Returns:
two digit decimal integer

setLexFileId

public void setLexFileId(long lexFileId)
Sets the lexicographer file name containing this synset.

Parameters:
lexFileId - - the lexicographer file name id

getLexFileName

public java.lang.String getLexFileName()
Gets the lex file name.

Returns: