stanfordnlp/CoreNLP · error · RuntimeException

Expected blank line, found:

Error message

Expected blank line, found: 

What it means

Options.readData terminates its options section by requiring a blank line; if the final line read is non-empty it throws RuntimeException('Expected blank line, found: ...'). This indicates the serialized options section does not have the expected layout, so the rest of the stream would be misparsed.

Solutions

  1. Replace the model file with the official one matching your parser version.
  2. Regenerate the grammar/serializer output with the current library.
  3. Add the missing blank line if the file was hand-edited (blank line must terminate the options section).
  4. Verify file integrity (size/checksum) against a clean download.

Example fix

// before
coarseDistance true
dcTags false
nPrune false
GENERALOPTIONS
// after (blank line before next section)
coarseDistance true
dcTags false
nPrune false

GENERALOPTIONS
Defensive patterns

Strategy: validation

Validate before calling

String text = Files.readString(modelPath);
// options section must end with a blank line before the next section marker
if (!text.contains("\n\n")) System.err.println("Warning: options section may be missing its terminating blank line");

Try / catch

try {
  parser = LexicalizedParser.loadModel(path);
} catch (RuntimeException e) {
  if (e.getMessage().startsWith("Expected blank line")) {
    throw new IOException("Malformed model file (missing section separator): " + path, e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Loading a parser model whose Options text section lacks the trailing blank line separator — usually because the file was produced by a different format version, truncated, or hand-edited.

Common situations: Version mismatch between model file and parser library, corrupted download, or manually concatenating/modifying grammar text files.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/c4fa6aba1611a1e6. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/parser/lexparser/Options.java:1271

    genStop = Boolean.parseBoolean(value);
    line = in.readLine();
    value = line.substring(line.indexOf(' ') + 1);
    distance = Boolean.parseBoolean(value);
    line = in.readLine();
    value = line.substring(line.indexOf(' ') + 1);
    coarseDistance = Boolean.parseBoolean(value);
    line = in.readLine();
    value = line.substring(line.indexOf(' ') + 1);
    dcTags = Boolean.parseBoolean(value);
    line = in.readLine();
    if ( ! line.matches("^nPrune.*")) {
      throw new RuntimeException("Expected nPrune, found: " + line);
    }
    value = line.substring(line.indexOf(' ') + 1);
    nodePrune = Boolean.parseBoolean(value);
    line = in.readLine(); // get rid of last line
    if (line.length() != 0) {
      throw new RuntimeException("Expected blank line, found: " + line);
    }
  }

  private static final long serialVersionUID = 4L;

} // end class Options

View on GitHub (pinned to 1b7edd19c4)