{"record":{"id":"7cb63d5039512159","repo":"stanfordnlp/CoreNLP","slug":"error-on-line-7cb63d","errorCode":null,"errorMessage":"Error on line ","messagePattern":"Error on line ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/trees/DependencyScoring.java","lineNumber":232,"sourceCode":"        grel = EnglishGrammaticalRelations.getConj(conj);\n      }\n      if (grel == null) {\n        throw new RuntimeException(\"Unknown grammatical relation '\" + depName+\"'\");\n      }\n\n      //Word govWord = new Word(govName.substring(0, govDash));\n      IndexedWord govWord = new IndexedWord();\n      govWord.setValue(normalizeNumbers(govName));\n      govWord.setWord(govWord.value());\n      //Word childWord = new Word(childName.substring(0, childDash));\n      IndexedWord childWord = new IndexedWord();\n      childWord.setValue(normalizeNumbers(childName));\n      childWord.setWord(childWord.value());\n      TypedDependency dep = new TypedDependencyStringEquality(grel, govWord, childWord);\n      deps.add(dep);\n      } catch (Exception e) {\n        breader.close();\n        throw new RuntimeException(\"Error on line \"+breader.getLineNumber()+\":\\n\\n\"+e);\n      }\n    }\n    if (deps.size() != 0) {\n       readDeps.add(deps);\n    }\n\n    //log.info(\"last: \"+readDeps.get(readDeps.size()-1));\n    breader.close();\n    return readDeps;\n  }\n\n  /**\n   * Score system typed dependencies\n   *\n   * @param system\n   * @return a triple consisting of (labeled attachment, unlabeled attachment,\n   *         label accuracy)\n   */","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/trees/DependencyScoring.java#L214-L250","documentation":"readDeps wraps each line's parsing in a try block; if anything fails while parsing a dependency line (bad number format, unknown fields, malformed indices) the BufferedReader is closed and the original exception is rethrown wrapped in a RuntimeException prefixed with 'Error on line <N>' so the user can locate the offending input line.","triggerScenarios":"Any malformed line in the dependency input file: missing tabs/columns, non-numeric indices, empty relation fields, or an exception thrown by the grel lookup — encountered while constructing the DependencyScoring.","commonSituations":"Files with different column conventions (CoNLL vs. simple 3-column format), trailing blank or header lines, truncated output from a crashed parser, Windows line endings or invisible characters breaking the split.","solutions":["Inspect the reported line number and fix that line to match the expected 'rel gov child' format.","Strip headers/blank lines and verify the delimiter (tab vs. whitespace) matches the reader's expectation.","Regenerate the dependency file from the parser, ensuring the run completed successfully."],"exampleFix":"// before (input line)\nnsubj the-dog-1 runs-2\n// after\nnsubj\t1\t2","handlingStrategy":"validation","validationCode":"try (Stream<String> lines = Files.lines(path)) { IntStream.range(1, (int) lines.count()+1).forEach(i -> assertValidDepLine(lineAt(i))); }","typeGuard":null,"tryCatchPattern":"try { scoring = new DependencyScoring(file, ...); } catch (RuntimeException e) { System.err.println(e.getMessage()); /* message names the offending line */ }","preventionTips":["Validate input file line format (3 tab-separated fields) before scoring","Strip headers and blank lines","Ensure parser output completed and was not truncated"],"tags":["java","nlp","file-parsing","invalid-argument-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}