use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class locativePair method makeConstraint.
public FirstOrderConstraint makeConstraint(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'locativePair(CommaSRLSentence)' defined on line 229 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence s = (CommaSRLSentence) __example;
FirstOrderConstraint __result = new FirstOrderConstant(true);
{
FirstOrderConstraint LBJava$constraint$result$0 = null;
{
FirstOrderConstraint LBJava$constraint$result$1 = null;
LBJava$constraint$result$1 = __locativePairFirstComma.makeConstraint(s);
FirstOrderConstraint LBJava$constraint$result$2 = null;
LBJava$constraint$result$2 = __locativePairMiddleCommas.makeConstraint(s);
LBJava$constraint$result$0 = new FirstOrderConjunction(LBJava$constraint$result$1, LBJava$constraint$result$2);
}
__result = new FirstOrderConjunction(__result, LBJava$constraint$result$0);
}
return __result;
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class locativePairFirstComma method makeConstraint.
public FirstOrderConstraint makeConstraint(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'locativePairFirstComma(CommaSRLSentence)' defined on line 214 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence s = (CommaSRLSentence) __example;
FirstOrderConstraint __result = new FirstOrderConstant(true);
{
Object[] LBJ$constraint$context = new Object[1];
LBJ$constraint$context[0] = s;
FirstOrderConstraint LBJava$constraint$result$0 = null;
{
FirstOrderConstraint LBJava$constraint$result$1 = null;
{
FirstOrderConstraint LBJava$constraint$result$2 = null;
{
EqualityArgumentReplacer LBJ$EAR = new EqualityArgumentReplacer(LBJ$constraint$context, true) {
public Object getLeftObject() {
Comma c = (Comma) quantificationVariables.get(0);
return c;
}
};
LBJava$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__LocalCommaClassifier, null), "" + ("Locative"), LBJ$EAR);
}
FirstOrderConstraint LBJava$constraint$result$3 = null;
{
EqualityArgumentReplacer LBJ$EAR = new EqualityArgumentReplacer(LBJ$constraint$context, true) {
public Object getLeftObject() {
CommaSRLSentence s = (CommaSRLSentence) context[0];
Comma c = (Comma) quantificationVariables.get(0);
return s.getNextSiblingComma(c);
}
};
LBJava$constraint$result$3 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__LocalCommaClassifier, null), "" + ("Locative"), LBJ$EAR);
}
LBJava$constraint$result$1 = new FirstOrderImplication(LBJava$constraint$result$2, LBJava$constraint$result$3);
}
LBJava$constraint$result$0 = new UniversalQuantifier("c", s.getFirstSiblingCommasWhichAreNotLast(), LBJava$constraint$result$1);
}
__result = new FirstOrderConjunction(__result, LBJava$constraint$result$0);
}
return __result;
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class locativePairMiddleCommas method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'locativePairMiddleCommas(CommaSRLSentence)' defined on line 220 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence s = (CommaSRLSentence) __example;
{
boolean LBJava$constraint$result$0;
{
LBJava$constraint$result$0 = true;
for (java.util.Iterator __I0 = (s.getMiddleSiblingCommas()).iterator(); __I0.hasNext() && LBJava$constraint$result$0; ) {
Comma c = (Comma) __I0.next();
{
boolean LBJava$constraint$result$1;
LBJava$constraint$result$1 = ("" + (__LocalCommaClassifier.discreteValue(c))).equals("" + ("Locative"));
if (LBJava$constraint$result$1) {
boolean LBJava$constraint$result$2;
LBJava$constraint$result$2 = ("" + (__LocalCommaClassifier.discreteValue(s.getNextSiblingComma(c)))).equals("" + ("Locative"));
if (!LBJava$constraint$result$2)
LBJava$constraint$result$0 = ("" + (__LocalCommaClassifier.discreteValue(s.getPreviousSiblingComma(c)))).equals("" + ("Locative"));
else
LBJava$constraint$result$0 = true;
} else
LBJava$constraint$result$0 = true;
}
}
}
if (!LBJava$constraint$result$0)
return "false";
}
return "true";
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class oxfordComma method makeConstraint.
public FirstOrderConstraint makeConstraint(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'oxfordComma(CommaSRLSentence)' defined on line 236 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence s = (CommaSRLSentence) __example;
FirstOrderConstraint __result = new FirstOrderConstant(true);
{
Object[] LBJ$constraint$context = new Object[1];
LBJ$constraint$context[0] = s;
FirstOrderConstraint LBJava$constraint$result$0 = null;
{
FirstOrderConstraint LBJava$constraint$result$1 = null;
{
FirstOrderConstraint LBJava$constraint$result$2 = null;
{
EqualityArgumentReplacer LBJ$EAR = new EqualityArgumentReplacer(LBJ$constraint$context, true) {
public String getLeftValue() {
Comma c = (Comma) quantificationVariables.get(0);
return "" + (__UnigramRightFeature.discreteValue(c));
}
};
LBJava$constraint$result$2 = new FirstOrderEqualityTwoValues(true, null, "" + ("and"), LBJ$EAR);
}
FirstOrderConstraint LBJava$constraint$result$3 = null;
{
EqualityArgumentReplacer LBJ$EAR = new EqualityArgumentReplacer(LBJ$constraint$context, true) {
public Object getLeftObject() {
Comma c = (Comma) quantificationVariables.get(0);
return c;
}
};
LBJava$constraint$result$3 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__LocalCommaClassifier, null), "" + ("List"), LBJ$EAR);
}
LBJava$constraint$result$1 = new FirstOrderImplication(LBJava$constraint$result$2, LBJava$constraint$result$3);
}
LBJava$constraint$result$0 = new UniversalQuantifier("c", s.getCommas(), LBJava$constraint$result$1);
}
__result = new FirstOrderConjunction(__result, LBJava$constraint$result$0);
}
return __result;
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class substitutePair method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'substitutePair(CommaSRLSentence)' defined on line 209 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence s = (CommaSRLSentence) __example;
{
boolean LBJava$constraint$result$0;
{
boolean LBJava$constraint$result$1;
LBJava$constraint$result$1 = __substitutePairFirstComma.discreteValue(s).equals("true");
if (LBJava$constraint$result$1)
LBJava$constraint$result$0 = __substitutePairMiddleCommas.discreteValue(s).equals("true");
else
LBJava$constraint$result$0 = false;
}
if (!LBJava$constraint$result$0)
return "false";
}
return "true";
}
Aggregations