{"record":{"id":"0e541b33e8a161af","repo":"stanfordnlp/CoreNLP","slug":"error-processing-field-from-0e541b","errorCode":null,"errorMessage":"Error processing field : '' from + (:): ","messagePattern":"Error processing field : '' from \\+ \\(:\\): ","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ling/tokensregex/PhraseTable.java","lineNumber":205,"sourceCode":"    int lineno = 0;\n    while ((line = br.readLine()) != null) {\n      String[] columns = fieldDelimiterPattern.split(line);\n      String phrase = columns[0];\n      // Pick map factory to use depending on number of tags we have\n      MapFactory<String,MutableDouble> mapFactory = (columns.length < 20)?\n              MapFactory.<String,MutableDouble>arrayMapFactory(): MapFactory.<String,MutableDouble>linkedHashMapFactory();\n      Counter<String> counts = new ClassicCounter<>(mapFactory);\n      for (int i = 1; i < columns.length; i++) {\n        String[] tagCount = countDelimiterPattern.split(columns[i], 2);\n        if (tagCount.length == 2) {\n          try {\n            counts.setCount(tagCount[0], Double.parseDouble(tagCount[1]));\n          } catch (NumberFormatException ex) {\n            throw new RuntimeException(\"Error processing field \" + i + \": '\" + columns[i] +\n                    \"' from (\" + filename + \":\" + lineno + \"): \" + line, ex);\n          }\n        } else {\n          throw new RuntimeException(\"Error processing field \" + i + \": '\" + columns[i] +\n                  \"' from + (\" + filename + \":\" + lineno + \"): \" + line);\n        }\n      }\n      addPhrase(phrase, null, counts);\n      lineno++;\n    }\n    br.close();\n    timer.done();\n  }\n\n  public void readPhrases(String filename, int phraseColIndex, int tagColIndex) throws IOException\n  {\n    if (phraseColIndex < 0) {\n      throw new IllegalArgumentException(\"Invalid phraseColIndex \" + phraseColIndex);\n    }\n    Timing timer = new Timing();\n    timer.doing(\"Reading phrases: \" + filename);\n    BufferedReader br = IOUtils.readerFromString(filename);","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ling/tokensregex/PhraseTable.java#L187-L223","documentation":"The sibling error of [413] in readPhrasesWithTagScores: thrown when a column's tag:count segment does NOT split into exactly 2 parts, i.e. it lacks the count delimiter entirely (note the 'from + (' in the message, a typo in the format string).","triggerScenarios":"A data line column containing just a tag ('NN') or free text with no ':' (or whatever the configured delimiter is) after the phrase column.","commonSituations":"Mismatch between the file format and the loader — e.g. a phrase-only file (no tag scores) passed to readPhrasesWithTagScores, or a file using spaces instead of tabs/delimiters so columns merge.","solutions":["Use readPhrases (no tag scores) instead of readPhrasesWithTagScores for files without tag:count fields","Fix the malformed column so each field is 'tag:count'","Verify the delimiter between tag and count matches the file (countDelimiterPattern configuration)"],"exampleFix":"// before (file line, missing count)\nhello\tNN\n// after\nhello\tNN:1","handlingStrategy":"validation","validationCode":"for (String col : line.split(\"\\t\")) {\n    if (!col.contains(\":\") || col.split(\":\", 2)[1].isEmpty())\n        throw new IllegalArgumentException(\"Column missing tag:count: \" + col);\n}","typeGuard":"static boolean hasTagCountFormat(String col) { String[] p = col.split(\":\", 2); return p.length == 2 && !p[1].isEmpty(); }","tryCatchPattern":"try { table.readPhrasesWithTagScores(file); } catch (RuntimeException e) { if (e.getMessage().contains(\"from + (\")) { LOG.error(\"Malformed tag:count column: {}\", e.getMessage()); } throw e; }","preventionTips":["Match the loader to the file format (readPhrases for tag-less files)","Confirm the delimiter used in the file matches the loader's expected pattern","Validate a sample of lines before bulk loading"],"tags":["tokensregex","file-parsing","format-mismatch"],"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-17T15:17:12.973Z"}