use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class SubstitutePairConstrainedInference$subjectto method makeConstraint.
public FirstOrderConstraint makeConstraint(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'SubstitutePairConstrainedInference$subjectto(CommaSRLSentence)' defined on line 264 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;
LBJava$constraint$result$0 = __substitutePair.makeConstraint(s);
__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 listCommas method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'listCommas(CommaSRLSentence)' defined on line 244 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;
{
boolean LBJava$constraint$result$2;
LBJava$constraint$result$2 = ("" + (__LocalCommaClassifier.discreteValue(s.getPreviousSiblingComma(c)))).equals("" + ("List"));
if (LBJava$constraint$result$2)
LBJava$constraint$result$1 = ("" + (__LocalCommaClassifier.discreteValue(s.getNextSiblingComma(c)))).equals("" + ("List"));
else
LBJava$constraint$result$1 = false;
}
if (LBJava$constraint$result$1)
LBJava$constraint$result$0 = ("" + (__LocalCommaClassifier.discreteValue(c))).equals("" + ("List"));
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 LocativePairConstrainedCommaClassifier method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof Comma)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Classifier 'LocativePairConstrainedCommaClassifier(Comma)' defined on line 276 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence head = LocativePairConstrainedInference.findHead((Comma) __example);
LocativePairConstrainedInference inference = (LocativePairConstrainedInference) InferenceManager.get("edu.illinois.cs.cogcomp.comma.lbj.LocativePairConstrainedInference", head);
if (inference == null) {
inference = new LocativePairConstrainedInference(head);
InferenceManager.put(inference);
}
String result = null;
try {
result = inference.valueOf(__LocalCommaClassifier, __example);
} catch (Exception e) {
System.err.println("LBJava ERROR: Fatal error while evaluating classifier LocativePairConstrainedCommaClassifier: " + e);
e.printStackTrace();
System.exit(1);
}
return result;
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class OxfordCommaConstrainedCommaClassifier method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof Comma)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Classifier 'OxfordCommaConstrainedCommaClassifier(Comma)' defined on line 260 of CommaClassifier.lbj received '" + type + "' as input.");
new Exception().printStackTrace();
System.exit(1);
}
CommaSRLSentence head = OxfordCommaConstrainedInference.findHead((Comma) __example);
OxfordCommaConstrainedInference inference = (OxfordCommaConstrainedInference) InferenceManager.get("edu.illinois.cs.cogcomp.comma.lbj.OxfordCommaConstrainedInference", head);
if (inference == null) {
inference = new OxfordCommaConstrainedInference(head);
InferenceManager.put(inference);
}
String result = null;
try {
result = inference.valueOf(__LocalCommaClassifier, __example);
} catch (Exception e) {
System.err.println("LBJava ERROR: Fatal error while evaluating classifier OxfordCommaConstrainedCommaClassifier: " + e);
e.printStackTrace();
System.exit(1);
}
return result;
}
use of edu.illinois.cs.cogcomp.comma.datastructures.CommaSRLSentence in project cogcomp-nlp by CogComp.
the class OxfordCommaConstrainedInference$subjectto method discreteValue.
public String discreteValue(Object __example) {
if (!(__example instanceof CommaSRLSentence)) {
String type = __example == null ? "null" : __example.getClass().getName();
System.err.println("Constraint 'OxfordCommaConstrainedInference$subjectto(CommaSRLSentence)' defined on line 256 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 = __oxfordComma.discreteValue(s).equals("true");
if (!LBJava$constraint$result$0)
return "false";
}
return "true";
}
Aggregations