|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.mit.jwi.item.WordID
public class WordID
Default implementation of the IWordID
interface.
Field Summary | |
---|---|
static java.lang.String |
unknownLemma
Represents an unknown lemma for the toString() method. |
static java.lang.String |
unknownWordNumber
Represents an unknown word number for the toString() method. |
static java.lang.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,
java.lang.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,
java.lang.String lemma)
Constructs a fully specified word id |
|
WordID(ISynsetID id,
java.lang.String lemma)
Constructs a word id from the specified arguments. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.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(java.lang.String value)
Parses the result of the toString() method back into an
WordID . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String wordIDPrefix
toString()
method.
public static final java.lang.String unknownLemma
toString()
method.
public static final java.lang.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 null
num
- the word number
java.lang.IllegalArgumentException
- if the offset or number are not legalpublic WordID(int offset, POS pos, java.lang.String lemma)
offset
- the synset offsetpos
- the part of speech; may not be null
lemma
- the lemma; may not be null
, empty, or all
whitespacepublic WordID(ISynsetID id, int num)
id
- the synset id; may not be null
num
- the word number
java.lang.NullPointerException
- if the synset id is null
java.lang.IllegalArgumentException
- if the lemma is empty or all whitespacepublic WordID(ISynsetID id, java.lang.String lemma)
id
- the synset id; may not be null
lemma
- the lemma; may not be null
, empty, or all
whitespace
java.lang.NullPointerException
- if the synset id is null
java.lang.IllegalArgumentException
- if the lemma is empty or all whitespacepublic WordID(ISynsetID id, int num, java.lang.String lemma)
id
- the synset id; may not be null
num
- the word numberlemma
- the lemma; may not be null
, empty, or all
whitespace
java.lang.NullPointerException
- if the synset id is null
java.lang.IllegalArgumentException
- if the lemma is empty or all whitespace, or the word number
is not legalMethod Detail |
---|
public ISynsetID getSynsetID()
IWordID
getSynsetID
in interface IWordID
null
public int getWordNumber()
IWordID
IWordID.getLemma()
method will return a non-null
,
non-empty string, non-whitespace string.
getWordNumber
in interface IWordID
public java.lang.String getLemma()
IWordID
null
. If this method returns null
,
the IWordID.getWordNumber()
method will return a positive number.
getLemma
in interface IWordID
null
if the lemma has not been specified.public POS getPOS()
IHasPOS
null
.
getPOS
in interface IHasPOS
null
if none.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 IWordID parseWordID(java.lang.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
java.lang.IllegalArgumentException
- if the specified string does not represent a word id
java.lang.NullPointerException
- if the specified string is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |