Skip to content

Commit 8d890c9

Browse files
committed
Add an error check for a missing -node parameter in the Ssurgeon SplitWord operation
1 parent 3b6684c commit 8d890c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ public static SsurgeonEdit parseEditLine(String editLine, Map<String, String> at
682682
if (argsBox.regex.size() > 0 && argsBox.exact.size() > 0) {
683683
throw new SsurgeonParseException("Found both regex and exact in the splits for splitWord");
684684
}
685+
if (argsBox.nodes.size() == 0) {
686+
throw new SsurgeonParseException("splitWord not given any -node parameter for the node to split");
687+
}
685688
if (argsBox.regex.size() > 0) {
686689
return new SplitWord(argsBox.nodes.get(0), argsBox.regex, argsBox.headIndex, reln, argsBox.name, false);
687690
} else {

0 commit comments

Comments
 (0)