public class Word extends Object implements IWord
IWord interface.| Constructor and Description |
|---|
Word(ISynset synset,
int number,
String lemma,
int lexID,
AdjMarker adjMarker,
List<IVerbFrame> frames,
Map<IPointer,? extends List<IWordID>> pointers)
Constructs a new word object.
|
Word(ISynset synset,
IWordID id,
int lexID,
AdjMarker adjMarker,
List<IVerbFrame> frames,
Map<IPointer,? extends List<IWordID>> pointers)
Constructs a new word object.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkLexicalID(int id)
Checks the specified lexical id, and throws an
IllegalArgumentException if it is not legal. |
static void |
checkWordNumber(int num)
Checks the specified word number, and throws an
IllegalArgumentException if it is not legal. |
boolean |
equals(Object obj) |
AdjMarker |
getAdjectiveMarker()
Returns the adjective marker of this word.
|
IWordID |
getID()
Returns the ID object for this item.
|
String |
getLemma()
Returns the root form of this word, never
null or empty. |
int |
getLexicalID()
A integer in the closed range [0,15] that, when appended onto lemma,
uniquely identifies a sense within a lexicographer file.
|
static String |
getLexicalIDForDataFile(int lexID)
Returns a string form of the lexical id as they are written in data
files, which is a single digit hex number.
|
static String |
getLexicalIDForSenseKey(int lexID)
Returns a string form of the lexical id as they are written in sense
keys, which is as a two-digit decimal number.
|
POS |
getPOS()
Returns the associated part of speech for this object.
|
Map<IPointer,List<IWordID>> |
getRelatedMap()
Returns an immutable map of from pointers to immutable maps.
|
List<IWordID> |
getRelatedWords()
Returns an immutable list of all word ids related to this word by
pointers in the database.
|
List<IWordID> |
getRelatedWords(IPointer type)
Returns an immutable list of all word ids related to this word by the
specified pointer type.
|
ISenseKey |
getSenseKey()
Returns the sense key for this word.
|
ISynset |
getSynset()
Returns the synset uniquely identified by this word.
|
List<IVerbFrame> |
getVerbFrames()
Returns an immutable list of all verb frames associated with this word.
|
int |
hashCode() |
static boolean |
isIllegalLexicalID(int id)
Lexical id's are always an integer in the closed range [0,15].
|
static boolean |
isIllegalWordNumber(int num)
Word numbers are always an integer in the closed range [1,255].
|
String |
toString() |
static String |
zeroFillWordNumber(int num)
Returns a string representation of the specified integer as a two hex
digit zero-filled string.
|
public Word(ISynset synset, int number, String lemma, int lexID, AdjMarker adjMarker, List<IVerbFrame> frames, Map<IPointer,? extends List<IWordID>> pointers)
synset - the synset for the word; may not be nullnumber - the word numberlemma - the word lemma; may not be empty or all whitespacelexID - the lexical idadjMarker - non-null only if this is an adjectiveframes - verb frames if this is a verbpointers - lexical pointersNullPointerException - if the synset is nullIllegalArgumentException - if the adjective marker is non-null and this is
not an adjectivepublic Word(ISynset synset, IWordID id, int lexID, AdjMarker adjMarker, List<IVerbFrame> frames, Map<IPointer,? extends List<IWordID>> pointers)
synset - the synset for the word; may not be null the word
lemma; may not be empty or all whitespaceid - the word id; may not be nulllexID - the lexical idadjMarker - non-null only if this is an adjectiveframes - verb frames if this is a verbpointers - lexical pointersNullPointerException - if the synset or word ID is nullIllegalArgumentException - if the adjective marker is non-null and this is
not an adjectivepublic IWordID getID()
IItemnull.public String getLemma()
IWordnull or empty.public POS getPOS()
IHasPOSnull.public ISynset getSynset()
IWordnull.public int getLexicalID()
IWordgetLexicalID in interface IWordpublic AdjMarker getAdjectiveMarker()
IWordnullgetAdjectiveMarker in interface IWordnull if none.public ISenseKey getSenseKey()
IWordnull;
however, the sense key that is returned may not yet have it's
head lemma and head lexical id set yet, and so may throw an exception on
some calls.getSenseKey in interface IWordnullISenseKey.needsHeadSet(),
ISenseKey.setHead(String, int)public Map<IPointer,List<IWordID>> getRelatedMap()
IWordISynset.getRelatedMap() on the appropriate object.getRelatedMap in interface IWordpublic List<IWordID> getRelatedWords(IPointer type)
IWordISynset.getRelatedSynsets(). If this
word has no targets for the for the specified pointer, this method
returns an empty list. This method never returns null.getRelatedWords in interface IWordtype - the pointer for which related words are requestedpublic List<IWordID> getRelatedWords()
IWordISynset.getRelatedSynsets() on the ISynset for this
word.getRelatedWords in interface IWordpublic List<IVerbFrame> getVerbFrames()
IWordgetVerbFrames in interface IWordpublic static void checkWordNumber(int num)
IllegalArgumentException if it is not legal.num - the number to checkIllegalArgumentException - if the specified lexical id is not in the closed range [0,15]public static void checkLexicalID(int id)
IllegalArgumentException if it is not legal.id - the id to checkIllegalArgumentException - if the specified lexical id is not in the closed range [0,15]public static boolean isIllegalLexicalID(int id)
id - the lexical id to checktrue if the specified integer is an invalid lexical
id; false otherwise.public static boolean isIllegalWordNumber(int num)
num - the number to checktrue if the specified integer is an invalid lexical
id; false otherwise.public static String getLexicalIDForDataFile(int lexID)
lexID - the lexical id to convertIllegalArgumentException - if the specified integer is not a valid lexical id.public static String getLexicalIDForSenseKey(int lexID)
lexID - the lexical id to convertIllegalArgumentException - if the specified integer is not a valid lexical id.public static String zeroFillWordNumber(int num)
num - the number to be convertedIllegalArgumentException - if the specified number is not a legal word numberCopyright © 2018. All rights reserved.