public class WordID extends Object implements IWordID
IWordID interface.| Modifier and Type | Field and Description |
|---|---|
static String |
unknownLemma
Represents an unknown lemma for the
toString() method. |
static String |
unknownWordNumber
Represents an unknown word number for the
toString() method. |
static String |
wordIDPrefix
String prefix for the
toString() method. |
| Constructor and Description |
|---|
WordID(int offset,
POS pos,
int num)
Constructs a word id from the specified arguments.
|
WordID(int offset,
POS pos,
String lemma)
Constructs a word id from the specified arguments.
|
WordID(ISynsetID id,
int num)
Constructs a word id from the specified arguments.
|
WordID(ISynsetID id,
int num,
String lemma)
Constructs a fully specified word id
|
WordID(ISynsetID id,
String lemma)
Constructs a word id from the specified arguments.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getLemma()
Returns the lemma (word root) associated with this word.
|
POS |
getPOS()
Returns the associated part of speech for this object.
|
ISynsetID |
getSynsetID()
Returns the synset id object associated with this word.
|
int |
getWordNumber()
Returns the word number, which is a number from 1 to 255 that indicates
the order this word is listed in the Wordnet data files.
|
int |
hashCode() |
static IWordID |
parseWordID(String value)
Parses the result of the
toString() method back into an
WordID. |
String |
toString() |
public static final String wordIDPrefix
toString() method.public static final String unknownLemma
toString() method.public static final String unknownWordNumber
toString() method.public WordID(int offset,
POS pos,
int num)
offset - the synset offsetpos - the part of speech; may not be nullnum - the word numberIllegalArgumentException - if the offset or number are not legalpublic WordID(int offset,
POS pos,
String lemma)
offset - the synset offsetpos - the part of speech; may not be nulllemma - the lemma; may not be null, empty, or all
whitespacepublic WordID(ISynsetID id, int num)
id - the synset id; may not be nullnum - the word numberNullPointerException - if the synset id is nullIllegalArgumentException - if the lemma is empty or all whitespacepublic WordID(ISynsetID id, String lemma)
id - the synset id; may not be nulllemma - the lemma; may not be null, empty, or all
whitespaceNullPointerException - if the synset id is nullIllegalArgumentException - if the lemma is empty or all whitespacepublic WordID(ISynsetID id, int num, String lemma)
id - the synset id; may not be nullnum - the word numberlemma - the lemma; may not be null, empty, or all
whitespaceNullPointerException - if the synset id is nullIllegalArgumentException - if the lemma is empty or all whitespace, or the word number
is not legalpublic ISynsetID getSynsetID()
IWordIDgetSynsetID in interface IWordIDnullpublic int getWordNumber()
IWordIDIWordID.getLemma() method will return a non-null,
non-empty string, non-whitespace string.getWordNumber in interface IWordIDpublic String getLemma()
IWordIDnull. If this method returns null,
the IWordID.getWordNumber() method will return a positive number.public POS getPOS()
IHasPOSnull.public static IWordID parseWordID(String value)
toString() method back into an
WordID. Word id's are always of the following format:
WID-########-P-##-lemma where ######## is the eight decimal digit
zero-filled offset of the associated synset, P is the upper case
character representing the part of speech, ## is the two hexidecimal
digit zero-filled word number (or ?? if unknown), and lemma is the lemma.value - the string to be parsedIllegalArgumentException - if the specified string does not represent a word idNullPointerException - if the specified string is nullCopyright © 2018. All rights reserved.