File tree 1 file changed +9
-0
lines changed
itest/src/edu/stanford/nlp/dcoref
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 6
6
import java .io .File ;
7
7
import java .io .IOException ;
8
8
import java .io .StringReader ;
9
+ import java .util .List ;
9
10
import java .util .Properties ;
10
11
import java .util .regex .Matcher ;
11
12
import java .util .regex .Pattern ;
@@ -130,6 +131,14 @@ public static Counter<String> getCorefResults(String resultsString) throws IOExc
130
131
}
131
132
}
132
133
134
+ if (results .keySet ().isEmpty ()) {
135
+ List <String > lines = StringUtils .split (resultsString , "\\ R" );
136
+ int start = Math .max (0 , lines .size () - 20 );
137
+ lines = lines .subList (start , lines .size () - start );
138
+ String tail = StringUtils .join (lines , "\n " );
139
+ throw new RuntimeException ("Coref output did not have any results in it! The end of the log is as follows:\n " + tail );
140
+ }
141
+
133
142
return results ;
134
143
}
135
144
You can’t perform that action at this time.
0 commit comments