|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.joke.JokeStructure
public class JokeStructure
A generated joke, with all its underlying data structures. These objects are
either created by Generator
, read in from an XML file using
XMLReaders
, or handcrafted using .
TODO Still need to sort out which textual data structures will be supported: JokeTexts, JokeForms, etc.
Field Summary | |
---|---|
(package private) String |
answerTemplate
|
(package private) WordStruct |
answerWordStruct
|
(package private) float |
cachedMinFScoreA
|
(package private) float |
cachedMinFScoreQ
|
private String |
id
|
(package private) JokeGraph |
jokeGraph
|
(package private) double |
phoneticSimilarityThreshold
This field records the lowest phonetic similarity score used in this JokeStructure, or 1.0 if no homophone relations are used. |
(package private) String |
questionTemplate
|
(package private) WordStruct |
questionWordStruct
|
(package private) String |
schemaLabel
|
Constructor Summary | |
---|---|
JokeStructure(String _id,
String s,
String tq,
String ta,
WordStruct wq,
WordStruct wa,
JokeGraph jg,
double pst)
|
Method Summary | |
---|---|
boolean |
about(Topic t)
|
int |
compareTo(Object arg0)
TODO This definition of compareTo is NOT CONSISTENT WRT EQUALS! |
boolean |
equals(Object obj)
TODO Two JokeStructures are considered equals if they have the same: - schema label, - question template label, - answer template label, - schema instantiations, - clause instantiations. |
String |
getAnswer()
|
WordStruct |
getAnswerStruct()
|
JokeGraph |
getGraph()
|
String |
getID()
|
int |
getMaximumAmbiguity()
|
float |
getMinimumAnswerFScore()
|
float |
getMinimumQuestionFScore()
|
double |
getPhoneticSimilarityThreshold()
|
String |
getQuestion()
|
WordStruct |
getQuestionStruct()
|
String |
getSchemaLabel()
|
int |
hashCode()
|
boolean |
ofType(JokeType t)
|
boolean |
ofType(List<SchemaTemplatePair> stps)
An alternative ofType() method which checks against an arbitrary List |
static JokeStructure |
readXML(Element e)
|
boolean |
satisfies(JokeConstraints constraints)
|
void |
setID(String newID)
|
String |
toString()
|
String |
toVerboseString()
|
boolean |
uses(Lexeme l)
|
boolean |
usesAll(LexemeSet ls)
|
boolean |
usesAllInAnswer(LexemeSet ls)
|
boolean |
usesAllInQuestion(LexemeSet ls)
|
boolean |
usesAny(LexemeSet ls)
|
boolean |
usesAnyInAnswer(LexemeSet ls)
|
boolean |
usesAnyInQuestion(LexemeSet ls)
|
boolean |
usesInAnswer(Lexeme l)
|
boolean |
usesInQuestion(Lexeme l)
|
void |
writeXML(Writer out,
String indent)
This method writes the necessary information contained within an instance to an XML file. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String id
final String schemaLabel
final String questionTemplate
final String answerTemplate
final double phoneticSimilarityThreshold
WordStruct questionWordStruct
WordStruct answerWordStruct
JokeGraph jokeGraph
float cachedMinFScoreQ
float cachedMinFScoreA
Constructor Detail |
---|
public JokeStructure(String _id, String s, String tq, String ta, WordStruct wq, WordStruct wa, JokeGraph jg, double pst)
Method Detail |
---|
public String getID()
public void setID(String newID)
public String getSchemaLabel()
public WordStruct getQuestionStruct()
public WordStruct getAnswerStruct()
public int compareTo(Object arg0)
compareTo
in interface Comparable
arg0
-
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String getQuestion()
public String getAnswer()
public String toString()
toString
in class Object
public String toVerboseString()
public boolean ofType(JokeType t)
public boolean ofType(List<SchemaTemplatePair> stps)
stps
-
public boolean satisfies(JokeConstraints constraints)
public boolean uses(Lexeme l)
public boolean usesInQuestion(Lexeme l)
public boolean usesInAnswer(Lexeme l)
public boolean usesAny(LexemeSet ls)
public boolean usesAnyInQuestion(LexemeSet ls)
public boolean usesAnyInAnswer(LexemeSet ls)
public boolean usesAll(LexemeSet ls)
public boolean usesAllInQuestion(LexemeSet ls)
public boolean usesAllInAnswer(LexemeSet ls)
public boolean about(Topic t)
public double getPhoneticSimilarityThreshold()
public int getMaximumAmbiguity()
public float getMinimumQuestionFScore()
public float getMinimumAnswerFScore()
public void writeXML(Writer out, String indent) throws IOException, XMLException
XMLizable
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
XMLException
public static JokeStructure readXML(Element e) throws XMLException
XMLException
public JokeGraph getGraph()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |