Skip to content

Commit 1bcbf46

Browse files
committed
Fix crash when parsing a sentence fails
1 parent 0bf5573 commit 1bcbf46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/edu/stanford/nlp/parser/lexparser/ExhaustiveDependencyParser.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ public boolean hasParse() {
603603

604604
@Override
605605
public double getBestScore() {
606+
if (sentence == null) {
607+
return Float.NEGATIVE_INFINITY;
608+
}
606609
int length = sentence.size();
607610
if (length > arraySize) {
608611
return Float.NEGATIVE_INFINITY;

0 commit comments

Comments
 (0)