net.sf.extjwnl.data
Class Synset

java.lang.Object
  extended by net.sf.extjwnl.data.PointerTarget
      extended by net.sf.extjwnl.data.Synset
All Implemented Interfaces:
Serializable, DictionaryElement, Owned

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.

Author:
John Didion , Aliaksandr Autayeu
See Also:
Serialized Form

Field Summary
protected  net.sf.extjwnl.data.Synset.PointerList pointers
           
protected  POS pos
           
 
Fields inherited from class net.sf.extjwnl.data.PointerTarget
dictionary
 
Constructor Summary
Synset(Dictionary dictionary, POS pos)
           
Synset(Dictionary dictionary, POS pos, long offset)
           
 
Method Summary
 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()
           
 int getIndex()
           
 Object getKey()
          Returns a key that can be used to index this element.
 String getLexFileName()
          Returns the lexicographer file name.
 long getLexFileNum()
          Returns the lexicographer file name containing this synset.
 long getOffset()
           
 List<Pointer> getPointers()
          Returns a list of Target's pointers.
 POS getPOS()
          Returns element's part of speech.
 Synset getSynset()
           
 DictionaryElementType getType()
          Returns the element's type.
 BitSet getVerbFrameFlags()
           
 int[] getVerbFrameIndices()
           
 String[] getVerbFrames()
          Returns all Verb Frames that are valid for all the words in this synset.
 List<Word> getWords()
           
 int hashCode()
           
 int indexOfWord(String lemma)
          Returns the index of the word which has the lemma or -1 if not found.
 boolean isAdjectiveCluster()
           
 void setDictionary(Dictionary dictionary)
          Sets the dictionary this object belongs to.
 void setGloss(String gloss)
           
 void setIsAdjectiveCluster(boolean isAdjectiveCluster)
           
 void setLexFileNum(long lexFileNum)
          Sets the lexicographer file name containing this synset.
 void setOffset(long offset)
           
 void setVerbFrameFlags(BitSet verbFrameFlags)
           
 String toString()
           
 
Methods inherited from class net.sf.extjwnl.data.PointerTarget
getDictionary, getPointers, getTargets, getTargets
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.extjwnl.util.factory.Owned
getDictionary
 

Field Detail

pos

protected POS pos

pointers

protected net.sf.extjwnl.data.Synset.PointerList pointers
Constructor Detail

Synset

public Synset(Dictionary dictionary,
              POS pos)
       throws JWNLException
Throws:
JWNLException

Synset

public Synset(Dictionary dictionary,
              POS pos,
              long offset)
       throws JWNLException
Throws:
JWNLException
Method Detail

getType

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

Specified by:
getType in interface DictionaryElement
Returns:
the element's type

getKey

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

Specified by:
getKey in interface DictionaryElement
Returns:
a key that can be used to index this element

getPOS

public POS getPOS()
Description copied from interface: DictionaryElement
Returns element's part of speech.

Specified by:
getPOS in interface DictionaryElement
Specified by:
getPOS in class PointerTarget
Returns:
element's part of speech

equals

public boolean equals(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 Object

toString

public String toString()
Specified by:
toString in class PointerTarget

getSynset

public Synset getSynset()
Specified by:
getSynset in class PointerTarget

getIndex

public int getIndex()
Specified by:
getIndex in class PointerTarget

getPointers

public List<Pointer> getPointers()
Description copied from class: PointerTarget
Returns a list of Target's pointers.

Specified by:
getPointers in class PointerTarget
Returns:
a list of Target's pointers

getGloss

public String getGloss()

setGloss

public void setGloss(String gloss)

getWords

public List<Word> getWords()

getOffset

public long getOffset()

setOffset

public void setOffset(long offset)

isAdjectiveCluster

public boolean isAdjectiveCluster()

setIsAdjectiveCluster

public void setIsAdjectiveCluster(boolean isAdjectiveCluster)

getVerbFrames

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

Returns:
all Verb Frames that are valid for all the words in this synset

getVerbFrameFlags

public BitSet getVerbFrameFlags()

setVerbFrameFlags

public void setVerbFrameFlags(BitSet verbFrameFlags)

getVerbFrameIndices

public int[] getVerbFrameIndices()

containsWord

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

Parameters:
lemma - lemma to check
Returns:
true if lemma is one of the words contained in this synset

indexOfWord

public int indexOfWord(String lemma)
Returns the index of the word which has the lemma or -1 if not found.

Parameters:
lemma - lemma to check
Returns:
true if lemma is one of the words contained in this synset

getLexFileNum

public long getLexFileNum()
Returns the lexicographer file name containing this synset.

Returns:
two digit decimal integer

setLexFileNum

public void setLexFileNum(long lexFileNum)
Sets the lexicographer file name containing this synset.

Parameters:
lexFileNum - - the lexicographer file name number

getLexFileName

public String getLexFileName()
Returns the lexicographer file name.

Returns:
lexicographer file name

setDictionary

public void setDictionary(Dictionary dictionary)
                   throws JWNLException
Description copied from interface: Owned
Sets the dictionary this object belongs to.

Specified by:
setDictionary in interface Owned
Overrides:
setDictionary in class PointerTarget
Parameters:
dictionary - the dictionary this object belongs to
Throws:
JWNLException - JWNLException


Copyright © 2011. All Rights Reserved.