Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7 from niranjanb/unary-bugfix

Pull request for the unary bug fix
  • Loading branch information...
commit aded841053ef36936d0f0cf2edf06009ab5d6ddf 2 parents acfd8e5 + 0de6b98
@afader afader authored
View
2  src/main/java/edu/washington/cs/knowitall/nlp/extraction/ChunkedBinaryExtraction.java
@@ -154,7 +154,7 @@ public String toString() {
if (allowUnaryRelations && results.isEmpty()) {
for (ChunkedArgumentExtraction arg1 : arg1s) {
Range dummyRange = new Range(rel.getRange().getStart()
- + rel.getRange().getLength() + 1, 0);
+ + rel.getRange().getLength(), 0);
ChunkedArgumentExtraction arg2 = new ChunkedArgumentExtraction(
rel.getSentence(), dummyRange, rel);
ChunkedBinaryExtraction extr = new ChunkedBinaryExtraction(rel,
View
24 src/test/java/edu/washington/cs/knowitall/extractor/ReVerbExtractorTest.java
@@ -31,15 +31,6 @@ public void setUp() throws Exception {
if (relaxedReverb == null) {
relaxedReverb = new ReVerbExtractor(0, false, false, true);
}
- /**if(regReverb == null && noFilters == false) {
- regReverb = new ReVerbExtractor();
- }
- else if(noFilters == true){
- regReverb = null;
- }
- if (noFilters == true && relaxedReverb == null) {
- relaxedReverb = new ReVerbExtractor(0, false, false, true);
- }*/
expected = new HashSet<String>();
}
@@ -602,4 +593,19 @@ public void testNoFilterReflexivePronounArg1() throws Exception {
assertTrue(got.contains("(Edison, invented, the phonograph)"));
}
+ @Test
+ public void testUnaryCases() throws Exception{
+ reverb = relaxedReverb;
+ got = extractTriples("people on earth slow down",
+ "NNS IN NN VB RP",
+ "B-NP B-PP B-NP B-VP B-PP");
+ assertTrue(got.contains("(earth, slow down, )"));
+
+ got = extractTriples("It rained",
+ "PRP VBD",
+ "B-NP B-VP");
+ assertTrue(got.contains("(It, rained, )"));
+
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.