|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.jwi.item.WordID
public class WordID
Default implementation of the IWordID interface.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String wordIDPrefix
toString() method.
public static final String unknownLemma
toString() method.
public static final String unknownWordNumber
toString() method.
| Constructor Detail |
|---|
public WordID(int offset,
POS pos,
int num)
offset - the synset offsetpos - the part of speech; may not be nullnum - the word number
IllegalArgumentException - if the offset or number are not legal
public 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
whitespace
public WordID(ISynsetID id,
int num)
id - the synset id; may not be nullnum - the word number
NullPointerException - if the synset id is null
IllegalArgumentException - if the lemma is empty or all whitespace
public WordID(ISynsetID id,
String lemma)
id - the synset id; may not be nulllemma - the lemma; may not be null, empty, or all
whitespace
NullPointerException - if the synset id is null
IllegalArgumentException - if the lemma is empty or all whitespace
public 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
whitespace
NullPointerException - if the synset id is null
IllegalArgumentException - if the lemma is empty or all whitespace, or the word number
is not legal| Method Detail |
|---|
public ISynsetID getSynsetID()
IWordID
getSynsetID in interface IWordIDnullpublic int getWordNumber()
IWordID
getWordNumber in interface IWordIDpublic String getLemma()
IWordID
getLemma in interface IWordIDpublic POS getPOS()
IHasPOSnull.
getPOS in interface IHasPOSnull if none.public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Objectpublic 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 parsed
IllegalArgumentException - if the specified string does not represent a word id
NullPointerException - if the specified string is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||