From e490d06f54ff309913c27e8acbcec73c9b0ca39f Mon Sep 17 00:00:00 2001 From: Kasun Perera Date: Mon, 28 Jul 2014 11:59:18 +0530 Subject: [PATCH 1/2] add Equative tests sentences --- src/java_test/relex/test/TestRelEx.java | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/java_test/relex/test/TestRelEx.java b/src/java_test/relex/test/TestRelEx.java index 48e0e89c3..62f7ee1ff 100644 --- a/src/java_test/relex/test/TestRelEx.java +++ b/src/java_test/relex/test/TestRelEx.java @@ -906,6 +906,41 @@ public boolean test_comparatives() report(rc, "Comparatives"); return rc; } + + public boolean test_equatives() + { + boolean rc = true; + //Equative:two entities one feature + rc &= test_sentence ("Amen's hair is as long as Ben's.", + "_as(long, hair)\n"+ + "_than(Amen, Ben)\n"); + + rc &= test_sentence ("Amen’s hair is same as Ben’s.", + "_as(same, hair)\n"+ + "_than(Amen, Ben)\n"); + + rc &= test_sentence ("Jack’s hair color is similar to that of Ben’s.", + "_as(similar, color)\n"+ + "_than(Jack, Ben)\n"+ + "_nn(color, hair)\n"); + + rc &= test_sentence ("Jack is as intelligent as Ben.", + "_as(intelligent, Jack)\n"+ + "_than(Jack, Ben)\n"); + + rc &= test_sentence ("The book’s color is same as that of the pen’s.", + "_as(same, color)\n"+ + "_than(book, pen)\n"+ + "_poss(color, book)\n"); + + rc &= test_sentence ("The snail is running exactly as fast as the cheetah.", + "_as(fast, run)\n"+ + "_than(snail, cheetah)\n"+ + "_advmod(is, exactly)\n"); + + report(rc, "Equatives"); + return rc; + } public boolean test_conjunctions() { @@ -1145,6 +1180,7 @@ public void runTests() { rc &= ts.test_determiners(); rc &= ts.test_comparatives(); + rc &= ts.test_equatives(); rc &= ts.test_extraposition(); rc &= ts.test_conjunctions(); From 2d11b08b9ba8a7453dd37c6b80998ac98740b456 Mon Sep 17 00:00:00 2001 From: Kasun Perera Date: Mon, 28 Jul 2014 13:00:31 +0530 Subject: [PATCH 2/2] adding Equative sentence binary relationships --- src/java_test/relex/test/TestRelEx.java | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/java_test/relex/test/TestRelEx.java b/src/java_test/relex/test/TestRelEx.java index 62f7ee1ff..f8dd54b6c 100644 --- a/src/java_test/relex/test/TestRelEx.java +++ b/src/java_test/relex/test/TestRelEx.java @@ -912,31 +912,43 @@ public boolean test_equatives() boolean rc = true; //Equative:two entities one feature rc &= test_sentence ("Amen's hair is as long as Ben's.", + "_poss(hair, Amen)\n"+ + "_predadj(hair, long)\n"+ "_as(long, hair)\n"+ "_than(Amen, Ben)\n"); rc &= test_sentence ("Amen’s hair is same as Ben’s.", + "_poss(hair, Amen)\n"+ + "_predadj(hair, same)\n"+ "_as(same, hair)\n"+ "_than(Amen, Ben)\n"); rc &= test_sentence ("Jack’s hair color is similar to that of Ben’s.", + "_poss(color, Jack)\n"+ + "_nn(color, hair)\n"+ + "_predadj(color, similar)\n"+ + "of(that, Ben)\n"+ + "to(similar, that)\n"+ "_as(similar, color)\n"+ - "_than(Jack, Ben)\n"+ - "_nn(color, hair)\n"); + "_than(Jack, Ben)\n"); rc &= test_sentence ("Jack is as intelligent as Ben.", + "_predadj(Jack, intelligent)\n"+ "_as(intelligent, Jack)\n"+ "_than(Jack, Ben)\n"); rc &= test_sentence ("The book’s color is same as that of the pen’s.", + "_poss(color, book)\n"+ + "_predadj(color, same)\n"+ + "of(that, pen)\n"+ "_as(same, color)\n"+ - "_than(book, pen)\n"+ - "_poss(color, book)\n"); + "_than(book, pen)\n"); rc &= test_sentence ("The snail is running exactly as fast as the cheetah.", + "_predadj(snail, run)\n"+ "_as(fast, run)\n"+ - "_than(snail, cheetah)\n"+ - "_advmod(is, exactly)\n"); + "_advmod(fast, exactly)\n"+ + "_than(snail, cheetah)\n"); report(rc, "Equatives"); return rc;