|
||||||||||
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
public abstract class Keyword
A Keyword
is an object appearing in a WordStruct
that is not
'canned' or 'filler' text. Although defined in the
standup.lexicon
package, its significance relates primarily to the
joke generation functionality in the standup.joke
package, where
Keyword
s are obtained through Schema
or Clause
instantiation and thus must be handled separately from canned text.
Field Summary | |
---|---|
private static String |
LEXEME_SQL_PREFIX
|
private static String |
WORDFORM_SQL_PREFIX
|
Constructor Summary | |
---|---|
Keyword()
|
Method Summary | |
---|---|
static Keyword |
createKeyword(String sqlResult)
Returns an appropriate Keyword given a String returned by
an SQL query for Schema or Clause instantiations. |
Unifiable |
duplicate()
An implementation of Unifiable.duplicate() . |
private static boolean |
isSQLLexemeID(String id)
Returns true if the given String , returned by an SQL
query, represents a Lexeme ID, and false otherwise. |
private static boolean |
isSQLWordFormID(String id)
Returns true if the given String , returned by an SQL
query, represents a WordForm ID, and false otherwise. |
static Keyword |
readXML(Element keywordParentElement)
Looks for a single XML tag representing a Keyword under the given
XML Element and returns an appropriate instance. |
static List<Keyword> |
readXMLList(Element keywordListElement)
Looks for all XML tags representing a keyword under the given XML Element and returns an appropriate list of instantiated
Keyword s. |
Methods inherited from class standup.lexicon.StructElement |
---|
getSpelling |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface standup.sql.SQLSelectElement |
---|
getSQLSelectString |
Methods inherited from interface standup.xml.XMLizable |
---|
writeXML |
Field Detail |
---|
private static String WORDFORM_SQL_PREFIX
private static String LEXEME_SQL_PREFIX
Constructor Detail |
---|
public Keyword()
Method Detail |
---|
private static boolean isSQLWordFormID(String id)
true
if the given String
, returned by an SQL
query, represents a WordForm
ID, and false otherwise.
id
-
private static boolean isSQLLexemeID(String id)
true
if the given String
, returned by an SQL
query, represents a Lexeme
ID, and false otherwise.
id
-
public static Keyword createKeyword(String sqlResult)
Keyword
given a String
returned by
an SQL query for Schema
or Clause
instantiations.
sqlResult
-
sqlResult
represents a lexeme ID, it returns the
referenced Lexeme
. If sqlResult
represents a
wordform ID, it returns the referenced WordForm
.
Otherwise, it returns a WordString
.public Unifiable duplicate()
Unifiable.duplicate()
.
duplicate
in interface Unifiable
public static Keyword readXML(Element keywordParentElement) throws XMLException
Keyword
under the given
XML Element
and returns an appropriate instance.
keywordParentElement
-
keywordElement
contains an Dictionary.getLexeme("lx123456")
. If
keywordElement
contains a Dictionary.getWordForm("wf123456")
. If
keywordElement
contains a new WordString("xyz")
.
XMLException
public static List<Keyword> readXMLList(Element keywordListElement) throws XMLException
Element
and returns an appropriate list of instantiated
Keyword
s.
keywordListElement
-
keywordListElement
contains an Dictionary.getLexeme("lx123456")
to the
returned list. If it contains a Dictionary.getWordForm("wf123456")
. Finally, if it
contains a new WordString("xyz")
.
XMLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |