|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.jwi.item.SenseKey
public class SenseKey
Concrete, default implementation of the ISenseKey interface.
| Constructor Summary | |
|---|---|
SenseKey(java.lang.String lemma,
int lexID,
ISynset synset)
Constructs a new sense key. |
|
SenseKey(java.lang.String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile)
Constructs a new sense key. |
|
SenseKey(java.lang.String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile,
java.lang.String originalKey)
Constructs a new sense key. |
|
SenseKey(java.lang.String lemma,
int lexID,
POS pos,
ILexFile lexFile,
java.lang.String headLemma,
int headLexID,
java.lang.String originalKey)
Constructs a new sense key. |
|
| Method Summary | |
|---|---|
protected void |
checkHeadSet()
Throws an exception if the head is not yet set. |
int |
compareTo(ISenseKey key)
|
boolean |
equals(java.lang.Object obj)
|
int |
getHeadID()
Returns the head id for this sense key. |
java.lang.String |
getHeadWord()
Returns the head word for this sense key. |
java.lang.String |
getLemma()
The lemma (root form) of the word indicated by this key. |
ILexFile |
getLexicalFile()
Returns the lexical file associated with this sense key. |
int |
getLexicalID()
Returns the lexical id for this sense key, which is a non-negative integer. |
POS |
getPOS()
Returns the associated part of speech for this object. |
int |
getSynsetType()
Returns the synset type for the key. |
int |
hashCode()
|
boolean |
isAdjectiveSatellite()
Returns true if this sense key points to an adjective
satellite; false otherwise. |
boolean |
needsHeadSet()
This method will always return false if the
ISenseKey.isAdjectiveSatellite() returns false. |
void |
setHead(java.lang.String headLemma,
int headLexID)
This method is used to set the head for sense keys for adjective satellites, and it can only be called once, directly after the relevant word is created. |
java.lang.String |
toString()
|
static java.lang.String |
toString(ISenseKey key)
Returns a a string representation of the specified sense key object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SenseKey(java.lang.String lemma,
int lexID,
ISynset synset)
lemma - the lemma for the sense keylexID - the lexical id of the sense keysynset - the synset for the sense key
java.lang.NullPointerException - if either the lemma or synset is null
public SenseKey(java.lang.String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile,
java.lang.String originalKey)
lemma - the lemma; may not be nulllexID - the lexical idpos - the part of speech; may not be nullisAdjSat - true if this represents an adjective satellite;
false otherwiselexFile - the lexical file; may not be nulloriginalKey - the original key string
java.lang.NullPointerException - if the lemma, lexical file, or original key is
null
public SenseKey(java.lang.String lemma,
int lexID,
POS pos,
ILexFile lexFile,
java.lang.String headLemma,
int headLexID,
java.lang.String originalKey)
lemma - the lemma; may not be nulllexID - the lexical idpos - the part of speech; may not be nulllexFile - the lexical file; may not be nulloriginalKey - the original key stringheadLemma - the head lemmaheadLexID - the head lexical id; ignored if head lemma is null
java.lang.NullPointerException - if the lemma, lexical file, or original key is
null
public SenseKey(java.lang.String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile)
lemma - the lemma; may not be nulllexID - the lexical idpos - the part of speech; may not be nullisAdjSat - true if this is an adjective satellite sense key;
false otherwiselexFile - the lexical file; may not be null
java.lang.NullPointerException - if the lemma, part of speech, or lexical file is
null| Method Detail |
|---|
public java.lang.String getLemma()
ISenseKeynull, empty, or all whitespace.
getLemma in interface ISenseKeypublic int getLexicalID()
ISenseKey
getLexicalID in interface ISenseKeypublic POS getPOS()
IHasPOSnull.
getPOS in interface IHasPOSnull if none.public int getSynsetType()
ISenseKey1=NOUN 2=VERB 3=ADJECTIVE 4=ADVERB 5=ADJECTIVE SATELLITE
getSynsetType in interface ISenseKeypublic boolean isAdjectiveSatellite()
ISenseKeytrue if this sense key points to an adjective
satellite; false otherwise.
isAdjectiveSatellite in interface ISenseKeytrue if this sense key points to an adjective
satellite; false otherwisepublic ILexFile getLexicalFile()
ISenseKeynull. If the lexical file is unknown, an
appropriate object to return is an UnknownLexFile object obtained
via the LexFile.getLexicalFile(int) method.
getLexicalFile in interface ISenseKey
public void setHead(java.lang.String headLemma,
int headLexID)
ISenseKey
setHead in interface ISenseKeyheadLemma - the head lemma to be setpublic java.lang.String getHeadWord()
ISenseKeynull. If non-
null, the head word will be neither empty or nor all
whitespace.
getHeadWord in interface ISenseKeynull if the indicated sense is not an adjective
satellitepublic int getHeadID()
ISenseKey-1.
getHeadID in interface ISenseKey-1 if the indicated sense is not an adjective
satellitepublic boolean needsHeadSet()
ISenseKeyfalse if the
ISenseKey.isAdjectiveSatellite() returns false. If that
method returns true, this method will only return
true if ISenseKey.setHead(String, int) has not yet been
called.
needsHeadSet in interface ISenseKeytrue if the head lemma and lexical id need to be
set; false otherwise.public int compareTo(ISenseKey key)
compareTo in interface java.lang.Comparable<ISenseKey>public java.lang.String toString()
toString in class java.lang.Objectprotected void checkHeadSet()
java.lang.IllegalArgumentException - if the needsHeadSet() method returns
true.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static java.lang.String toString(ISenseKey key)
key - the sense key to be encoded as a string
java.lang.NullPointerException - if the specified key is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||