|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.mit.jwi.item.Synset
public class Synset
Default implementation of the ISynset
interface.
Nested Class Summary | |
---|---|
static interface |
Synset.IWordBuilder
A word builder used to construct word objects inside of the synset object constructor. |
static class |
Synset.WordBuilder
Holds information about word objects before they are instantiated. |
Constructor Summary | |
---|---|
Synset(ISynsetID id,
ILexFile lexFile,
boolean isAdjSat,
boolean isAdjHead,
java.lang.String gloss,
java.util.List<Synset.IWordBuilder> wordBuilders,
java.util.Map<IPointer,? extends java.util.List<ISynsetID>> ids)
Constructs a new synset object with the specified parameters. |
Method Summary | |
---|---|
static int |
checkOffset(int offset)
Throws an exception if the specified offset is not in the valid range of [0,99999999]. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getGloss()
Returns the gloss (brief, plain-English description) of this synset. |
ISynsetID |
getID()
Returns the ID object for this item. |
ILexFile |
getLexicalFile()
Returns a description of the lexical file. |
int |
getOffset()
Returns the data file byte offset of this synset. |
POS |
getPOS()
Returns the associated part of speech for this object. |
java.util.Map<IPointer,java.util.List<ISynsetID>> |
getRelatedMap()
Returns an immutable map from semantic pointers to immutable lists of synsets. |
java.util.List<ISynsetID> |
getRelatedSynsets()
Returns an immutable list of synset ids for all synsets that are connected by pointers to this synset. |
java.util.List<ISynsetID> |
getRelatedSynsets(IPointer type)
Returns an immutable list of the ids of all synsets that are related to this synset by the specified pointer type. |
int |
getType()
Returns the type of the synset, encoded as follows: 1=Noun, 2=Verb, 3=Adjective, 4=Adverb, 5=Adjective Satellite. |
IWord |
getWord(int wordNumber)
Returns the word with the specified word number. |
java.util.List<IWord> |
getWords()
Returns an immutable list of the word objects (synset, index word pairs) associated with this synset. |
int |
hashCode()
|
boolean |
isAdjectiveHead()
Returns true if this synset is an adjective head;
false otherwise. |
boolean |
isAdjectiveSatellite()
Returns true if this synset is an adjective satellite;
false otherwise. |
static boolean |
isLegalOffset(int offset)
Returns true an exception if the specified offset is not in the valid range of [0,99999999]. |
java.lang.String |
toString()
|
static java.lang.String |
zeroFillOffset(int offset)
Takes an integer in the closed range [0,99999999] and converts it into an eight decimal digit zero-filled string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Synset(ISynsetID id, ILexFile lexFile, boolean isAdjSat, boolean isAdjHead, java.lang.String gloss, java.util.List<Synset.IWordBuilder> wordBuilders, java.util.Map<IPointer,? extends java.util.List<ISynsetID>> ids)
id
- the synset id; may not be null
lexFile
- the lexical file for this synset; may not be null
isAdjSat
- true
if this object represents an adjective
satellite synset; false
otherwiseisAdjHead
- true
if this object represents an adjective head
synset; false
otherwisegloss
- the gloss for this synset; may not be null
wordBuilders
- the list of word builders for this synset; may not be
null
ids
- a map of related synset lists, indexed by pointer; may be
null
java.lang.NullPointerException
- if any of the id, lexical file, word list, or gloss are
null
, or the word list contains a
null
java.lang.IllegalArgumentException
- if the word list is empty, or both the adjective satellite
and adjective head flags are set
java.lang.IllegalArgumentException
- if either the adjective satellite and adjective head flags
are set, and the lexical file number is not zeroMethod Detail |
---|
public ISynsetID getID()
IItem
null
.
getID
in interface IItem<ISynsetID>
null
ID for this itempublic int getOffset()
ISynset
getOffset
in interface ISynset
public POS getPOS()
IHasPOS
null
.
getPOS
in interface IHasPOS
null
if none.public int getType()
ISynset
getType
in interface ISynset
public java.lang.String getGloss()
ISynset
getGloss
in interface ISynset
null
, non-empty gloss.public java.util.List<IWord> getWords()
ISynset
getWords
in interface ISynset
null
, immutable list of words for this synsetpublic IWord getWord(int wordNumber)
ISynset
getWord
in interface ISynset
wordNumber
- the number of the word to be retrieved
public ILexFile getLexicalFile()
ISynset
getLexicalFile
in interface ISynset
public java.util.Map<IPointer,java.util.List<ISynsetID>> getRelatedMap()
ISynset
IWord.getRelatedMap()
on the appropriate word.
getRelatedMap
in interface ISynset
null
, unmodifiable map from pointers to
synsetspublic java.util.List<ISynsetID> getRelatedSynsets(IPointer type)
ISynset
IWord.getRelatedWords()()
on the
appropriate object.
If there are no such synsets, this method returns the empty list.
getRelatedSynsets
in interface ISynset
type
- the pointer for which related synsets are to be retrieved.
public java.util.List<ISynsetID> getRelatedSynsets()
ISynset
IWord
objects.
getRelatedSynsets
in interface ISynset
public boolean isAdjectiveSatellite()
ISynset
true
if this synset is an adjective satellite;
false
otherwise.
isAdjectiveSatellite
in interface ISynset
true
if this synset represents an adjective satellite;
false
otherwise.public boolean isAdjectiveHead()
ISynset
true
if this synset is an adjective head;
false
otherwise.
isAdjectiveHead
in interface ISynset
true
if this synset represents an adjective head;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String zeroFillOffset(int offset)
offset
- the offset to be converted
java.lang.IllegalArgumentException
- if the specified offset is not in the valid range of
[0,99999999]public static int checkOffset(int offset)
offset
- the offset to be checked
java.lang.IllegalArgumentException
- if the specified offset is not in the valid range of
[0,99999999]public static boolean isLegalOffset(int offset)
offset
- the offset to be checked
true
if the specified offset is in the closed range
[0, 99999999]; false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |