edu.brandeis.cs.steele.wn
Class Synset

java.lang.Object
  extended by edu.brandeis.cs.steele.wn.Synset
All Implemented Interfaces:
PointerTarget

public class Synset
extends java.lang.Object
implements PointerTarget

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. Pointer.getTarget() retrieves the targets of these links, and parsePointer retrieves the pointers themselves.

Author:
Oliver Steele, steele@cs.brandeis.edu
See Also:
Word, Pointer

Field Summary
protected  FileBackedDictionary dictionary
           
protected  java.lang.String gloss
           
protected  boolean isAdjectiveCluster
           
protected  long offset
           
protected  Pointer[] pointers
           
protected  POS pos
           
protected  Word[] words
           
 
Constructor Summary
Synset(FileBackedDictionary dictionary)
           
 
Method Summary
protected static PointerTarget[] collectTargets(Pointer[] pointers)
           
protected static java.util.List<PointerTarget> collectTargetsList(java.util.List<Pointer> pointersIn)
           
 boolean equals(java.lang.Object object)
           
 java.lang.String getDescription()
          Return a description of the target.
 java.lang.String getGloss()
           
 java.lang.String getLongDescription()
          Return the long description of the target.
 Pointer[] getPointers()
          Return the outgoing Pointers from the target -- those Pointers that have this object as their source.
 Pointer[] getPointers(PointerType type)
          Return the outgoing Pointers of type type.
 java.util.List<Pointer> getPointersList()
          Return the outgoing Pointers from the target -- those Pointers that have this object as their source.
 java.util.List<Pointer> getPointersList(PointerType type)
          Return the outgoing Pointers of type type.
 POS getPOS()
           
 PointerTarget[] getTargets()
          Return the targets of the outgoing Pointers.
 PointerTarget[] getTargets(PointerType type)
          Return the targets of the outgoing Pointers that have type type.
 java.util.List<PointerTarget> getTargetsList()
          Return the targets of the outgoing Pointers.
 java.util.List<PointerTarget> getTargetsList(PointerType type)
          Return the targets of the outgoing Pointers that have type type.
 Word getWord(int index)
           
 Word[] getWords()
           
 int hashCode()
           
(package private)  Synset initializeFrom(java.lang.String line)
           
(package private) static Synset parseSynset(FileBackedDictionary dictionary, java.lang.String line)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dictionary

protected FileBackedDictionary dictionary

pos

protected POS pos

offset

protected long offset

isAdjectiveCluster

protected boolean isAdjectiveCluster

words

protected Word[] words

pointers

protected Pointer[] pointers

gloss

protected java.lang.String gloss
Constructor Detail

Synset

Synset(FileBackedDictionary dictionary)
Method Detail

initializeFrom

Synset initializeFrom(java.lang.String line)

parseSynset

static Synset parseSynset(FileBackedDictionary dictionary,
                          java.lang.String line)

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPOS

public POS getPOS()
Specified by:
getPOS in interface PointerTarget

getGloss

public java.lang.String getGloss()

getWords

public Word[] getWords()

getWord

public Word getWord(int index)

getDescription

public java.lang.String getDescription()
Description copied from interface: PointerTarget
Return a description of the target. For a Word, this is it's lemma; for a Synset, it's the concatenated lemma's of its Words.

Specified by:
getDescription in interface PointerTarget

getLongDescription

public java.lang.String getLongDescription()
Description copied from interface: PointerTarget
Return the long description of the target. This is its description, appended by, if it exists, a dash and it's gloss.

Specified by:
getLongDescription in interface PointerTarget

collectTargetsList

protected static java.util.List<PointerTarget> collectTargetsList(java.util.List<Pointer> pointersIn)

getTargetsList

public java.util.List<PointerTarget> getTargetsList()
Description copied from interface: PointerTarget
Return the targets of the outgoing Pointers.

Specified by:
getTargetsList in interface PointerTarget

getTargetsList

public java.util.List<PointerTarget> getTargetsList(PointerType type)
Description copied from interface: PointerTarget
Return the targets of the outgoing Pointers that have type type.

Specified by:
getTargetsList in interface PointerTarget

getPointersList

public java.util.List<Pointer> getPointersList()
Description copied from interface: PointerTarget
Return the outgoing Pointers from the target -- those Pointers that have this object as their source.

Specified by:
getPointersList in interface PointerTarget

getPointersList

public java.util.List<Pointer> getPointersList(PointerType type)
Description copied from interface: PointerTarget
Return the outgoing Pointers of type type.

Specified by:
getPointersList in interface PointerTarget

collectTargets

protected static PointerTarget[] collectTargets(Pointer[] pointers)

getPointers

public Pointer[] getPointers()
Description copied from interface: PointerTarget
Return the outgoing Pointers from the target -- those Pointers that have this object as their source.

Specified by:
getPointers in interface PointerTarget

getPointers

public Pointer[] getPointers(PointerType type)
Description copied from interface: PointerTarget
Return the outgoing Pointers of type type.

Specified by:
getPointers in interface PointerTarget

getTargets

public PointerTarget[] getTargets()
Description copied from interface: PointerTarget
Return the targets of the outgoing Pointers.

Specified by:
getTargets in interface PointerTarget

getTargets

public PointerTarget[] getTargets(PointerType type)
Description copied from interface: PointerTarget
Return the targets of the outgoing Pointers that have type type.

Specified by:
getTargets in interface PointerTarget