stanfordnlp/CoreNLP · error · TsurgeonParseException
No foot node found for " + auxTree
Error message
No foot node found for " + auxTree
What it means
CreateSubtreeNode.findFoot checks the operation's auxiliary tree for a foot node. Tsurgeon supports a single-leaf aux tree shorthand with no explicit foot, but if the aux tree has more than one node and no foot node ('@' marker), the operation cannot know where to attach and throws TsurgeonParseException.
Solutions
- Add '@' to exactly one node label in the createSubtree aux tree to designate the foot/attachment point.
- If the intent is a simple single-leaf wrapper, ensure the aux tree is a single leaf node — the foot is then simulated automatically.
- Validate the Tsurgeon script syntax so the auxiliary tree parses with its foot marker intact.
Example fix
// before
createSubtree {SBAR {NP the dog}}
// after
createSubtree {SBAR {@NP the dog}} Defensive patterns
Strategy: validation
Validate before calling
static boolean auxTreeOk(String auxTreeString) {
boolean hasFoot = auxTreeString.indexOf('@') >= 0;
boolean isSingleLeaf = !auxTreeString.matches(".*\\{.*\\{.*"); // rough check: multi-node needs a foot
return hasFoot || isSingleLeaf;
} Try / catch
try {
Tsurgeon.parseOperation("createSubtree " + auxSpec);
} catch (TsurgeonParseException e) {
throw new IllegalArgumentException("createSubtree aux tree needs a '@' foot node: " + auxSpec, e);
} Prevention
- Only multi-branch auxiliary trees need '@'; single-leaf wrappers may omit it.
- Add the foot marker when generalizing a single-node example to a larger subtree.
- Parse all Tsurgeon operations at startup so bad scripts fail fast.
When it happens
Trigger: A 'createSubtree' Tsurgeon operation whose auxTree is a multi-node subtree lacking any '@' foot marker; findFoot() runs when CreateSubtreeNode is constructed.
Common situations: Writing createSubtree with a multi-branch replacement subtree and forgetting the '@' on the node under which matched children should be inserted; adapting a single-node example (where foot simulation is allowed) to a larger tree.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Error -- no foot node found for " + originalTreeString
- Error -- two foot nodes in subtree" + t.toString()
- Attempted to replace a root node with more than one node…
- Parents did not match for trees when applied to " + this
- Node name " + name + " does not exist in the searched tree
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/6b95ebac742c2f24.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/trees/tregex/tsurgeon/CreateSubtreeNode.java:41
public CreateSubtreeNode(TsurgeonPattern start, TsurgeonPattern end, AuxiliaryTree tree) {
super("combineSubtrees",
(end == null) ? new TsurgeonPattern[] { start } : new TsurgeonPattern[] { start, end });
this.auxTree = tree;
findFoot();
}
/**
* We want to support a command syntax where a simple node label can
* be given (i.e., without using a tree literal).
*
* Check if this syntax is being used, and simulate a foot if so.
*/
private void findFoot() {
if (auxTree.foot == null) {
if (!auxTree.tree.isLeaf())
throw new TsurgeonParseException("No foot node found for " + auxTree);
// Pretend this leaf is a foot node
auxTree.foot = auxTree.tree;
}
}
@Override
public TsurgeonMatcher matcher(Map<String,Tree> newNodeNames, CoindexationGenerator coindexer) {
return new Matcher(newNodeNames, coindexer);
}
private class Matcher extends TsurgeonMatcher {
public Matcher(Map<String,Tree> newNodeNames, CoindexationGenerator coindexer) {
super(CreateSubtreeNode.this, newNodeNames, coindexer);
}
/**
* Combines all nodes between start and end into one subtree, thenView on GitHub (pinned to 1b7edd19c4)