standup.joke
Class InstantiationConstraintLexiconSchema
java.lang.Object
standup.joke.InstantiationConstraintLexicon
standup.joke.InstantiationConstraintLexiconSchema
- All Implemented Interfaces:
- InstantiationConstraint, JokeConstraint
public class InstantiationConstraintLexiconSchema
- extends InstantiationConstraintLexicon
An InstantiationConstraint
that constrains a joke to make use of at
least one Lexeme
from a given LexemeSet
in its answer.
- Author:
- Ruli Manurung
InstantiationConstraintLexiconSchema
public InstantiationConstraintLexiconSchema(LexemeSet lexs)
getSQLConstraint
public String getSQLConstraint(Clause c,
List<SQLSelectElement> taqlsses)
- Description copied from interface:
InstantiationConstraint
- Returns an SQL code snippet that is to be appended to the WHERE clause of
the SQL query when instantiating the given
Clause
.
- Specified by:
getSQLConstraint
in interface InstantiationConstraint
- Overrides:
getSQLConstraint
in class InstantiationConstraintLexicon
- Parameters:
c
- the Clause
being instantiated.
- Returns:
- -- the String to be appended to the WHERE clause. As a contract,
we require that it appear between parentheses, e.g. "(...)" for
readability purposes.
validate
public boolean validate(JokeStructure j)
- Description copied from interface:
JokeConstraint
- Returns
true
if the given JokeStructure
satisfies this
constraint, and false
if not.
- Specified by:
validate
in interface JokeConstraint
- Overrides:
validate
in class InstantiationConstraintLexicon
- Parameters:
j
- the JokeStructure
being validated
- Returns:
- --
true
if j
satisfies this constraint,
false
otherwise.
toString
public String toString()
- Overrides:
toString
in class InstantiationConstraintLexicon