{"record":{"id":"94dd8b22c87704ea","repo":"stanfordnlp/CoreNLP","slug":"cannot-make-a-lemmatize-out-of-argsbox-nodes-s","errorCode":null,"errorMessage":"Cannot make a Lemmatize out of \" + argsBox.nodes.size() + \" nodes.  Please use exactly one -node","messagePattern":"Cannot make a Lemmatize out of \" \\+ argsBox\\.nodes\\.size\\(\\) \\+ \" nodes\\.  Please use exactly one -node","errorType":"exception","errorClass":"SsurgeonParseException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java","lineNumber":646,"sourceCode":"          return new ReattachNamedEdge(argsBox.edge, argsBox.govNodeName, argsBox.dep);\n      } else if (command.equalsIgnoreCase(DeleteGraphFromNode.LABEL)) {\n        if (argsBox.nodes.size() != 1) {\n          throw new SsurgeonParseException(\"Cannot make a DeleteGraphFromNode out of \" + argsBox.nodes.size() + \" nodes\");\n        }\n        return new DeleteGraphFromNode(argsBox.nodes.get(0));\n      } else if (command.equalsIgnoreCase(DeleteLeaf.LABEL)) {\n        if (argsBox.nodes.size() != 1) {\n          throw new SsurgeonParseException(\"Cannot make a DeleteLeaf out of \" + argsBox.nodes.size() + \" nodes\");\n        }\n        return new DeleteLeaf(argsBox.nodes.get(0));\n      } else if (command.equalsIgnoreCase(EditNode.LABEL)) {\n        if (argsBox.nodes.size() != 1) {\n          throw new SsurgeonParseException(\"Cannot make an EditNode out of \" + argsBox.nodes.size() + \" nodes.  Please use exactly one -node\");\n        }\n        return new EditNode(argsBox.nodes.get(0), argsBox.annotations, argsBox.updateMorphoFeatures, argsBox.remove, argsBox.removeMorphoFeatures);\n      } else if (command.equalsIgnoreCase(Lemmatize.LABEL)) {\n        if (argsBox.nodes.size() != 1) {\n          throw new SsurgeonParseException(\"Cannot make a Lemmatize out of \" + argsBox.nodes.size() + \" nodes.  Please use exactly one -node\");\n        }\n        return new Lemmatize(argsBox.nodes.get(0), language);\n      } else if (command.equalsIgnoreCase(MergeNodes.LABEL)) {\n        if (argsBox.nodes.size() < 2) {\n          throw new SsurgeonParseException(\"Cannot make a MergeNodes out of fewer than 2 nodes (got \" + argsBox.nodes.size() + \")\");\n        }\n        return new MergeNodes(argsBox.nodes, argsBox.annotations);\n      } else if (command.equalsIgnoreCase(RelabelNamedEdge.LABEL)) {\n        if (argsBox.reln == null) {\n          throw new SsurgeonParseException(\"Relation not specified for AddEdge\");\n        }\n        GrammaticalRelation reln = GrammaticalRelation.valueOf(language, argsBox.reln);\n        return new RelabelNamedEdge(argsBox.edge, reln);\n      } else if (command.equalsIgnoreCase(RemoveEdge.LABEL)) {\n        GrammaticalRelation reln = null;\n        if (argsBox.reln != null) {\n          reln = GrammaticalRelation.valueOf(argsBox.reln);\n        }","sourceCodeStart":628,"sourceCodeEnd":664,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java#L628-L664","documentation":"Lemmatize lemmatizes exactly one node, so parseEditLine requires argsBox.nodes.size() == 1. Any other count raises SsurgeonParseException('Cannot make a Lemmatize out of N nodes. Please use exactly one -node').","triggerScenarios":"A 'lemmatize' edit line with zero or multiple -node flags.","commonSituations":"Batch lemmatization attempts in a single edit; forgetting -node entirely; confusing this op with MergeNodes which requires >=2 nodes.","solutions":["Use exactly one -node <name> flag on the lemmatize line.","Add one lemmatize edit per node that needs lemmatization.","Verify the named node exists in the rule's semgrex pattern (a named group or created node)."],"exampleFix":"// before\nlemmatize -node a -node b\n// after\nlemmatize -node a\nlemmatize -node b","handlingStrategy":"validation","validationCode":"int count = countFlagOccurrences(line, \"-node\");\nif (line.startsWith(\"lemmatize\") && count != 1)\n  throw new IllegalArgumentException(\"lemmatize needs exactly one -node, got \" + count);","typeGuard":null,"tryCatchPattern":"try { parseEditLine(line, attrs, lang); } catch (SsurgeonParseException e) { if (e.getMessage().startsWith(\"Cannot make a Lemmatize\")) log.error(\"lemmatize requires exactly one -node: \" + line); }","preventionTips":["Use one lemmatize edit per node","Ensure the named node exists in the semgrex pattern","Run rule parsing in a startup self-check"],"tags":["parsing","ssurgeon","argument-count"],"backgroundTag":"invalid-argument-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}