|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstandup.lexicon.StructElement
standup.lexicon.Keyword
standup.lexicon.WordForm
public class WordForm
A WordForm
is a word with a unique orthographic and phonetic
spelling.
Instances of this class are obtained through
Dictionary.getWordForm(String)
, which accesses a serialized
hashtable, and thus does not require access to the SQL lexical database.
WordForm
s are essentially read-only objects, they cannot be altered.
Field Summary | |
---|---|
private String |
id
|
private static long |
serialVersionUID
|
private WordSequence |
spelling
|
Constructor Summary | |
---|---|
WordForm(String _id,
WordSequence _sp)
Constructor that provides all necessary details. |
Method Summary | |
---|---|
int |
compareTo(Object arg0)
A definition of compareTo that is consistent with
equals(Object) . |
boolean |
equals(Object obj)
|
String |
getID()
Returns the unique ID of this WordForm . |
WordSequence |
getSpelling()
Returns the linearized surface form of this (possibly hierarchical) StructElement as a WordSequence . |
String |
getSQLSelectString()
Returns a String that encodes how this WordForm would be
used in an SQL query, i.e. |
int |
hashCode()
|
static WordForm |
readXML(Element e)
Returns an instance of a WordForm from an appropriate XML
Element . |
String |
toString()
|
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 WordSequence spelling
Constructor Detail |
---|
public WordForm(String _id, WordSequence _sp)
ProtoWordForm#buildSerializedCache(String)
when
building the serialized hashtable of WordForm
s to be used by
Dictionary
.
_id
- The unique ID_sp
- The orthographic spellingMethod Detail |
---|
public String getID()
WordForm
.
public WordSequence getSpelling()
StructElement
StructElement
as a WordSequence
.
getSpelling
in class StructElement
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int compareTo(Object arg0)
compareTo
that is consistent with
equals(Object)
. It checks the spelling, and only if it is equal
is the id used as a 'tiebreaker'.
compareTo
in interface Comparable
arg0
-
public String getSQLSelectString()
String
that encodes how this WordForm
would be
used in an SQL query, i.e. its ID enclosed within single quotes, e.g.
"'wf123456'"
.
getSQLSelectString
in interface SQLSelectElement
public void writeXML(Writer out, String indent) throws IOException
XMLizable.writeXML(Writer, String)
. Writes out
this WordForm
's id in a wf
tag, e.g.
<wf>wf123456</wf>
.
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 static WordForm readXML(Element e)
WordForm
from an appropriate XML
Element
.
e
- The Element
containing the information regarding the
WordForm
to be instantiated
WordForm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |