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

  1. Add '@' to exactly one node label in the createSubtree aux tree to designate the foot/attachment point.
  2. If the intent is a simple single-leaf wrapper, ensure the aux tree is a single leaf node — the foot is then simulated automatically.
  3. 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

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


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, then

View on GitHub (pinned to 1b7edd19c4)