public class Synset extends Object implements ISynset
ISynset interface.| Modifier and Type | Class and Description |
|---|---|
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 and Description |
|---|
Synset(ISynsetID id,
ILexFile lexFile,
boolean isAdjSat,
boolean isAdjHead,
String gloss,
List<Synset.IWordBuilder> wordBuilders,
Map<IPointer,? extends List<ISynsetID>> ids)
Constructs a new synset object with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
checkOffset(int offset)
Throws an exception if the specified offset is not in the valid range of
[0,99999999].
|
boolean |
equals(Object obj) |
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.
|
Map<IPointer,List<ISynsetID>> |
getRelatedMap()
Returns an immutable map from semantic pointers to immutable lists of
synsets.
|
List<ISynsetID> |
getRelatedSynsets()
Returns an immutable list of synset ids for all synsets that are
connected by pointers to this synset.
|
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.
|
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].
|
String |
toString() |
static String |
zeroFillOffset(int offset)
Takes an integer in the closed range [0,99999999] and converts it into an
eight decimal digit zero-filled string.
|
public Synset(ISynsetID id, ILexFile lexFile, boolean isAdjSat, boolean isAdjHead, String gloss, List<Synset.IWordBuilder> wordBuilders, Map<IPointer,? extends List<ISynsetID>> ids)
id - the synset id; may not be nulllexFile - the lexical file for this synset; may not be nullisAdjSat - 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 nullwordBuilders - the list of word builders for this synset; may not be
nullids - a map of related synset lists, indexed by pointer; may be
nullNullPointerException - if any of the id, lexical file, word list, or gloss are
null, or the word list contains a
nullIllegalArgumentException - if the word list is empty, or both the adjective satellite
and adjective head flags are setIllegalArgumentException - if either the adjective satellite and adjective head flags
are set, and the lexical file number is not zeropublic ISynsetID getID()
IItemnull.public int getOffset()
ISynsetpublic POS getPOS()
IHasPOSnull.public int getType()
ISynsetpublic String getGloss()
ISynsetpublic List<IWord> getWords()
ISynsetpublic IWord getWord(int wordNumber)
ISynsetpublic ILexFile getLexicalFile()
ISynsetgetLexicalFile in interface ISynsetpublic Map<IPointer,List<ISynsetID>> getRelatedMap()
ISynsetIWord.getRelatedMap() on the appropriate word.getRelatedMap in interface ISynsetnull, unmodifiable map from pointers to
synsetspublic List<ISynsetID> getRelatedSynsets(IPointer type)
ISynsetIWord.getRelatedWords()() on the
appropriate object.
If there are no such synsets, this method returns the empty list.
getRelatedSynsets in interface ISynsettype - the pointer for which related synsets are to be retrieved.public List<ISynsetID> getRelatedSynsets()
ISynsetIWord objects.getRelatedSynsets in interface ISynsetpublic boolean isAdjectiveSatellite()
ISynsettrue if this synset is an adjective satellite;
false otherwise.isAdjectiveSatellite in interface ISynsettrue if this synset represents an adjective satellite;
false otherwise.public boolean isAdjectiveHead()
ISynsettrue if this synset is an adjective head;
false otherwise.isAdjectiveHead in interface ISynsettrue if this synset represents an adjective head;
false otherwise.public static String zeroFillOffset(int offset)
offset - the offset to be convertedIllegalArgumentException - if the specified offset is not in the valid range of
[0,99999999]public static int checkOffset(int offset)
offset - the offset to be checkedIllegalArgumentException - if the specified offset is not in the valid range of
[0,99999999]public static boolean isLegalOffset(int offset)
offset - the offset to be checkedtrue if the specified offset is in the closed range
[0, 99999999]; false otherwise.Copyright © 2018. All rights reserved.