public class Literal
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
arg1 |
java.lang.String |
arg2 |
boolean |
bound |
boolean |
negated |
java.lang.String |
pred |
boolean |
preserve |
Constructor and Description |
---|
Literal() |
Modifier and Type | Method and Description |
---|---|
Literal |
applyBindings(java.util.HashMap<java.lang.String,java.lang.String> bindings) |
void |
applyBindingSelf(java.util.HashMap<java.lang.String,java.lang.String> bindings)
Apply variable substitutions to a literal
|
Literal |
deepCopy() |
boolean |
equals(java.lang.Object o) |
boolean |
isGround() |
static void |
main(java.lang.String[] args)
A test method
|
java.util.HashMap<java.lang.String,java.lang.String> |
mguTermList(Literal l2)
Unify all terms in term1 with the corresponding terms in term2 with a
common substitution.
|
static Literal |
parse(Lexer lex,
int startLine) |
void |
preProcessQuestionWords(java.util.List<java.lang.String> qwords)
If the tokens in the literal are derived from words parsed
from the Stanford dependency parser, and therefore in the form
word-xx, where xx are digits, prepend a '?' to signify that
it's a variable.
|
static void |
testParse()
A test method for parsing a Literal
|
static void |
testRegexUnify()
A test method for wildcard unification
|
static void |
testUnify()
A test method for unification
|
java.lang.String |
toString() |
public boolean negated
public boolean preserve
public boolean bound
public java.lang.String pred
public java.lang.String arg1
public java.lang.String arg2
public java.lang.String toString()
toString
in class java.lang.Object
public Literal deepCopy()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean isGround()
public void preProcessQuestionWords(java.util.List<java.lang.String> qwords)
public void applyBindingSelf(java.util.HashMap<java.lang.String,java.lang.String> bindings)
public Literal applyBindings(java.util.HashMap<java.lang.String,java.lang.String> bindings)
public java.util.HashMap<java.lang.String,java.lang.String> mguTermList(Literal l2)
public static Literal parse(Lexer lex, int startLine)
lex
- is a Lexer which has been initialized with the
textual version of the LiteralstartLine
- is the line in the text file at which the
literal appears. If it is in a large rule the start line
could be different than the actual line of text for the literal.
If the literal is just from a string rather than directly from
a text file then the startLine will be 0.public static void testUnify()
public static void testRegexUnify()
public static void testParse()
public static void main(java.lang.String[] args)