{"record":{"id":"cf64afe2565bf19a","repo":"stanfordnlp/CoreNLP","slug":"error-in-ssurgeonedit-parseeditline-command-co","errorCode":null,"errorMessage":"Error in SsurgeonEdit.parseEditLine: command '\"+command+\"' is not supported","messagePattern":"Error in SsurgeonEdit\\.parseEditLine: command '\"\\+command\\+\"' is not supported","errorType":"exception","errorClass":"SsurgeonParseException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java","lineNumber":691,"sourceCode":"      } else if (command.equalsIgnoreCase(CombineMWT.LABEL)) {\n        return new CombineMWT(argsBox.nodes, argsBox.annotations.get(\"word\"));\n      } else if (command.equalsIgnoreCase(SetPhraseHead.LABEL)) {\n        GrammaticalRelation reln = GrammaticalRelation.valueOf(language, argsBox.reln);\n        return new SetPhraseHead(argsBox.nodes, argsBox.headIndex, reln, argsBox.weight);\n      } else if (command.equalsIgnoreCase(SplitWord.LABEL)) {\n        GrammaticalRelation reln = GrammaticalRelation.valueOf(language, argsBox.reln);\n        if (argsBox.regex.size() > 0 && argsBox.exact.size() > 0) {\n          throw new SsurgeonParseException(\"Found both regex and exact in the splits for splitWord\");\n        }\n        if (argsBox.regex.size() > 0) {\n          return new SplitWord(argsBox.nodes.get(0), argsBox.regex, argsBox.headIndex, reln, argsBox.name, false);\n        } else {\n          return new SplitWord(argsBox.nodes.get(0), argsBox.exact, argsBox.headIndex, reln, argsBox.name, true);\n        }\n      } else if (command.equalsIgnoreCase(ReindexGraph.LABEL)) {\n        return new ReindexGraph();\n      }\n      throw new SsurgeonParseException(\"Error in SsurgeonEdit.parseEditLine: command '\"+command+\"' is not supported\");\n    } catch (SsurgeonParseException e) {\n      throw new SsurgeonParseException(\"Unable to process Ssurgeon edit line: \" + editLine, e);\n    }\n  }\n\n  //public static SsurgeonPattern fromXML(String xmlString) throws Exception {\n  //SAXBuilder builder = new SAXBuilder();\n  //Document jdomDoc = builder.build(xmlString);\n  //jdomDoc.getRootElement().getChildren(SsurgeonPattern.SSURGEON_ELEM_TAG);\n  //}\n\n  /**\n   * Given a target filepath and a list of Ssurgeon patterns, writes them out as XML forms.\n   */\n  public static void writeToFile(File tgtFile, List<SsurgeonPattern> patterns) {\n    try {\n      Document domDoc = createPatternXMLDoc(patterns);\n      if (domDoc != null) {","sourceCodeStart":673,"sourceCodeEnd":709,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java#L673-L709","documentation":"parseEditLine dispatches on the first token of an ssurgeon edit line against the known edit LABELs. If the command is not one of the supported labels (and no earlier branch matched), it throws SsurgeonParseException saying the command is not supported. The exception is then wrapped by the catch block with the full edit line.","triggerScenarios":"Any edit line whose command token is misspelled, miscased-sensitive after tokenization, or from an older/newer CoreNLP version's edit set, e.g. 'merge-nodes' instead of 'merge-grams'.","commonSituations":"Typos in ssurgeon files, following outdated documentation or tutorials for a different CoreNLP version, or custom edits that were never registered.","solutions":["Check the command spelling against Ssurgeon's supported LABEL constants for your CoreNLP version","Upgrade/downgrade CoreNLP if the edit exists in a different version","Register or extend the parser if you need a custom edit type"],"exampleFix":"# before\nmerge-nodes -node:dog -node:cat\n# after\nmerge-grams -node:dog -node:cat","handlingStrategy":"validation","validationCode":"java.util.Set<String> SUPPORTED = java.util.Set.of(\n  \"addedge\",\"adddep\",\"removeedge\",\"removedep\",\"relabelnamededge\",\n  \"removenamededge\",\"lemma\",\"merge-grams\",\"killallincomingedges\",\n  \"splitword\",\"combinemwt\",\"setphrasehead\",\"reindexgraph\",\"setwordlist\");\nboolean knownCommand(String line) {\n  String cmd = line.trim().split(\"\\\\s+\")[0];\n  return SUPPORTED.contains(cmd.toLowerCase());\n}","typeGuard":null,"tryCatchPattern":"try {\n  SsurgeonEdit e = Ssurgeon.parseEditLine(line);\n} catch (SsurgeonParseException ex) {\n  log.severe(\"Unknown ssurgeon command, check LABEL constants: \" + line);\n}","preventionTips":["Verify command names against your exact CoreNLP version's Ssurgeon source","Run a dry-run parse of all rules before using them in production","Keep a curated list of valid edit labels for your pipeline"],"tags":["java","ssurgeon","parser","unsupported-command"],"backgroundTag":"unsupported-operation","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"}