|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.lexicon.StructElement standup.lexicon.Keyword standup.lexicon.Lexeme
public class Lexeme
A Lexeme
is a specific sense, or meaning of a word.
Instances of this class are obtained by calling
Dictionary.getLexeme(String)
, which accesses a serialized hashtable,
and thus does not require access to the SQL lexical database.
Lexeme
s are essentially read-only objects, they cannot be altered.
Field Summary | |
---|---|
private int |
ambiguityCount
|
private Concept |
cachedConcept
|
private WordForm |
cachedHeadWordForm
|
private List<String> |
cachedImageFiles
|
private WordForm |
cachedModifierWordForm
|
private SymbolType[] |
cachedSymbolSet
|
private WordForm |
cachedWordForm
|
private String |
conceptID
|
private float |
fScore
|
private String |
headWordFormID
|
private String |
id
|
private boolean |
isNounCompound
|
private String |
modifierWordFormID
|
private POS |
pos
|
private String[] |
realConceptCodes
|
private int |
semcorFreq
|
private static long |
serialVersionUID
|
private String |
wordFormID
|
Constructor Summary | |
---|---|
Lexeme(String id,
int ambiguityCount,
String wordFormID,
String conceptID,
int semcorFreq,
float fScore,
String[] realConceptCodes,
POS pos,
boolean isNounCompound,
String headWordFormID,
String modifierWordFormID)
Constructor that provides all necessary details. |
Method Summary | |
---|---|
int |
compareTo(Object arg0)
This implementation of compareTo is consistent with
equals(Object) . |
boolean |
equals(Object obj)
|
int |
getAmbiguityCount()
Returns the number of Lexeme s that share this Lexeme 's
orthography (count is inclusive of this Lexeme ). |
Concept |
getConcept()
Returns the Concept associated with this Lexeme . |
float |
getFamiliarityScore()
Returns the F-score, or familiarity score, of this Lexeme . |
int |
getFrequency()
Returns the Semcor frequency for this Lexeme . |
WordForm |
getHead()
Returns the head WordForm of this Lexeme , if it is a
compound noun, or null otherwise. |
String |
getID()
Returns the unique ID of this Lexeme . |
List<String> |
getImageFile(SymbolType[] symbolSet)
|
WordForm |
getModifier()
Returns the modifier WordForm of this Lexeme , if it is a
compound noun, or null otherwise. |
POS |
getPartOfSpeech()
Returns the part of speech of this Lexeme . |
WordSequence |
getSpelling()
Returns the spelling of this Lexeme . |
String |
getSQLSelectString()
Returns a String that encodes how this Lexeme would be
used in an SQL query, i.e. |
WordForm |
getWordForm()
Returns the WordForm associated with this Lexeme . |
int |
hashCode()
|
boolean |
isCompoundNoun()
Returns true if this Lexeme is a compound noun, or
false otherwise. |
static Lexeme |
readXML(Element e)
Returns an instance of a Lexeme (as returned by
Dictionary.getLexeme(String) ) whose ID is contained within the
given XML Element . |
String |
shortString()
A short string representation of this Lexeme , with the following
form: ID(ortho,pos) . |
String |
toString()
|
String |
verboseString()
A verbose string representation of this Lexeme , with the
following form: ID(ortho,pos):gloss . |
void |
writeXML(Writer out,
String indent)
Implementation of XMLizable.writeXML(Writer, String) . |
Methods inherited from class standup.lexicon.Keyword |
---|
createKeyword, duplicate, readXMLList |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private final String id
private final int ambiguityCount
private final String wordFormID
private final String conceptID
private final int semcorFreq
private final float fScore
private final String[] realConceptCodes
private final POS pos
private final boolean isNounCompound
private final String headWordFormID
private final String modifierWordFormID
private transient WordForm cachedWordForm
private transient Concept cachedConcept
private transient WordForm cachedHeadWordForm
private transient WordForm cachedModifierWordForm
private transient List<String> cachedImageFiles
private transient SymbolType[] cachedSymbolSet
Constructor Detail |
---|
public Lexeme(String id, int ambiguityCount, String wordFormID, String conceptID, int semcorFreq, float fScore, String[] realConceptCodes, POS pos, boolean isNounCompound, String headWordFormID, String modifierWordFormID)
ProtoLexeme.buildSerializedCache(String)
when building
the serialized hashtable of Lexeme
s to be used by
Dictionary
.
id
- unique ID -- see STANDUP lexical database documentation for
detailsambiguityCount
- the number of Lexeme
s that have the same
WordForm
as this onewordFormID
- the ID of this Lexeme
's WordForm
conceptID
- the ID of this Lexeme
's Concept
semcorFreq
- Semcor frequencyfScore
- F-scorerealConceptCodes
- an array of 'real' conceptcodes, taken from Widgit wordlistspos
- this Lexeme
's part-of-speechisNounCompound
- whether or not this Lexeme
is a compound nounheadWordFormID
- the ID of this Lexeme
's head WordForm
, if it
is a compound, null
otherwisemodifierWordFormID
- the ID of this Lexeme
's modifier WordForm
,
if it is a compound, null
otherwiseMethod Detail |
---|
public static Lexeme readXML(Element e)
Lexeme
(as returned by
Dictionary.getLexeme(String)
) whose ID is contained within the
given XML Element
.
e
-
public String getID()
Lexeme
.
Lexeme
.public int getAmbiguityCount()
Lexeme
s that share this Lexeme
's
orthography (count is inclusive of this Lexeme
).
Lexeme
s that share this Lexeme
's
orthography (count is inclusive of this Lexeme
).public WordForm getWordForm()
WordForm
associated with this Lexeme
.
WordForm
associated with this Lexeme
.public Concept getConcept()
Concept
associated with this Lexeme
.
Concept
associated with this Lexeme
.public float getFamiliarityScore()
Lexeme
.
public int getFrequency()
Lexeme
.
public WordForm getHead()
WordForm
of this Lexeme
, if it is a
compound noun, or null
otherwise.
public List<String> getImageFile(SymbolType[] symbolSet) throws SymbolException
SymbolException
public WordForm getModifier()
WordForm
of this Lexeme
, if it is a
compound noun, or null
otherwise.
public POS getPartOfSpeech()
Lexeme
.
public WordSequence getSpelling()
Lexeme
.
getSpelling
in class StructElement
public String getSQLSelectString()
String
that encodes how this Lexeme
would be
used in an SQL query, i.e. its ID enclosed within single quotes, e.g.
"'lx123456'"
.
getSQLSelectString
in interface SQLSelectElement
public boolean isCompoundNoun()
true
if this Lexeme
is a compound noun, or
false
otherwise.
public String toString()
toString
in class Object
public String shortString()
Lexeme
, with the following
form: ID(ortho,pos)
. For example, lx081537(bank,n)
.
This is also the String
returned by toString()
.
public String verboseString()
Lexeme
, with the
following form: ID(ortho,pos):gloss
. For example,
lx081537(bank,n):a long ridge or pile; "a huge bank of earth"
.
public void writeXML(Writer out, String indent) throws IOException
XMLizable.writeXML(Writer, String)
. Writes out
this Lexeme
's id in an lx
tag, e.g.
<lx>lx123456</lx>
.
writeXML
in interface XMLizable
out
- The output stream for the XML file, which is assumed to be
already opened and writable.indent
- A string to be prepended before every line written by this
method. If passed appropriate white space, e.g.
XMLUtils.xmlIndent
, it can be used to control
indentation.
IOException
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object arg0)
compareTo
is consistent with
equals(Object)
. It checks the Lexeme's getSpelling()
,
and only if it is equal uses getID()
a 'tiebreaker'.
compareTo
in interface Comparable
arg0
- the Lexeme
to be compared to this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |