standup.joke
Class SchemaTemplatePair
java.lang.Object
standup.joke.SchemaTemplatePair
public class SchemaTemplatePair
- extends Object
Defines a combination of suitable schemas and templates for joke generation.
It associates a Schema
label with two sets: a set of Template
labels that represent the templates available for the question text, and a
set of Template
labels that represent the templates available for the
answer text.
- Author:
- Ruli Manurung
schemaLabel
String schemaLabel
qTemplateFunctors
List<String> qTemplateFunctors
aTemplateFunctors
List<String> aTemplateFunctors
SchemaTemplatePair
public SchemaTemplatePair(String _s,
List<String> _q,
List<String> _a)
toString
public String toString()
- Overrides:
toString
in class Object
getSchemaLabel
public String getSchemaLabel()
getQuestionTemplateFunctors
public List<String> getQuestionTemplateFunctors()
getAnswerTemplateFunctors
public List<String> getAnswerTemplateFunctors()
suitable
public boolean suitable(String schema,
String question,
String answer)
getSTPbySchema
public static SchemaTemplatePair getSTPbySchema(List<SchemaTemplatePair> stps,
String schemaLabel)
- Given a List of SchemaTemplatePairs, it returns the SchemaTemplatePair
that uses the Schema with label schemaLabel. Note that the List stps
should only contain *1* SchemaTemplatePair that uses Schema with label
schemaLabel. This is a contract that must be obeyed by all JokeTypes!
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object