public class SenseKey extends Object implements ISenseKey
ISenseKey interface.| Constructor and Description |
|---|
SenseKey(String lemma,
int lexID,
ISynset synset)
Constructs a new sense key.
|
SenseKey(String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile)
Constructs a new sense key.
|
SenseKey(String lemma,
int lexID,
POS pos,
boolean isAdjSat,
ILexFile lexFile,
String originalKey)
Constructs a new sense key.
|
SenseKey(String lemma,
int lexID,
POS pos,
ILexFile lexFile,
String headLemma,
int headLexID,
String originalKey)
Constructs a new sense key.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkHeadSet()
Throws an exception if the head is not yet set.
|
int |
compareTo(ISenseKey key) |
boolean |
equals(Object obj) |
int |
getHeadID()
Returns the head id for this sense key.
|
String |
getHeadWord()
Returns the head word for this sense key.
|
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()
|
void |
setHead(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.
|
String |
toString() |
static String |
toString(ISenseKey key)
Returns a a string representation of the specified sense key object.
|
public SenseKey(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 keyNullPointerException - if either the lemma or synset is nullpublic SenseKey(String lemma, int lexID, POS pos, boolean isAdjSat, ILexFile lexFile, 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 stringNullPointerException - if the lemma, lexical file, or original key is
nullpublic SenseKey(String lemma, int lexID, POS pos, ILexFile lexFile, String headLemma, int headLexID, 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 nullNullPointerException - if the lemma, lexical file, or original key is
nullpublic SenseKey(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 nullNullPointerException - if the lemma, part of speech, or lexical file is
nullpublic String getLemma()
ISenseKeynull, empty, or all whitespace.public int getLexicalID()
ISenseKeygetLexicalID in interface ISenseKeypublic POS getPOS()
IHasPOSnull.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 ISenseKeypublic void setHead(String headLemma, int headLexID)
ISenseKeypublic 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.public 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 Comparable<ISenseKey>protected void checkHeadSet()
IllegalArgumentException - if the needsHeadSet() method returns
true.public static String toString(ISenseKey key)
key - the sense key to be encoded as a stringNullPointerException - if the specified key is nullCopyright © 2018. All rights reserved.