{"record":{"id":"30195155dbbfa547","repo":"stanfordnlp/CoreNLP","slug":"invalid-mapping-line","errorCode":null,"errorMessage":"Invalid mapping line: ","messagePattern":"Invalid mapping line: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/arabic/pipeline/UniversalPOSMapper.java","lineNumber":97,"sourceCode":"        MorphoFeatureType feat = MorphoFeatureType.valueOf(optToks[0]);\n        List<String> featVals = morphoSpec.getValues(feat);\n        morphoSpec.activate(feat);\n      }\n    }\n  }\n\n  private void loadUniversalMap(String path) {\n    \n    LineNumberReader reader = null;\n    try {\n      reader = new LineNumberReader(new FileReader(path));\n      \n      for(String line; (line = reader.readLine()) != null;) {\n        if(line.trim().equals(\"\")) continue;\n        \n        String[] toks = line.trim().split(\"\\\\s+\");\n        if(toks.length != 2)\n          throw new RuntimeException(\"Invalid mapping line: \" + line);\n        \n        universalMap.put(toks[0], toks[1]);\n      }\n      \n      reader.close();\n    \n    } catch (FileNotFoundException e) {\n      System.err.printf(\"%s: File not found %s%n\", this.getClass().getName(),path);\n    \n    } catch (IOException e) {\n      int lineId = (reader == null) ? -1 : reader.getLineNumber();\n      System.err.printf(\"%s: Error at line %d%n\", this.getClass().getName(),lineId);\n      e.printStackTrace();\n    }\n  }\n}\n","sourceCodeStart":79,"sourceCodeEnd":114,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/arabic/pipeline/UniversalPOSMapper.java#L79-L114","documentation":"UniversalPOSMapper.loadUniversalMap reads a universal POS mapping file where every non-empty line must contain exactly two whitespace-separated tokens (source tag, universal tag). Any line that does not split into exactly 2 fields triggers this RuntimeException.","triggerScenarios":"Calling setup() with a universal POS map file containing a line with one token, three or more tokens, or stray unquoted extra whitespace-separated content.","commonSituations":"Hand-edited mapping files, comments accidentally left in the map file, tab-separated files with trailing comments, or files exported from spreadsheets with extra columns.","solutions":["Open the mapping file and find the line that doesn't have exactly 2 whitespace-separated fields","Remove comments or blank extras; one 'sourceTag<TAB>universalTag' per line","Re-download the canonical universal POS mapping file matching your UD/Stanford version","Validate each line in a pre-pass before loading"],"exampleFix":"// before (map file)\nNOUN comment line\nVERB\n// after\nNOUN NOUN\nVERB VERB","handlingStrategy":"validation","validationCode":"List<String> bad = new ArrayList<>();\nint i = 0;\nfor (String line : Files.readAllLines(mapPath)) {\n  i++;\n  String t = line.trim();\n  if (t.isEmpty()) continue;\n  if (t.split(\"\\\\s+\").length != 2) bad.add(\"line \" + i + \": \" + t);\n}\nif (!bad.isEmpty()) throw new IllegalStateException(\"Bad mapping lines: \" + bad);","typeGuard":null,"tryCatchPattern":"try {\n  mapper.setup(new BufferedReader(new FileReader(mapFile)));\n} catch (RuntimeException e) {\n  if (e.getMessage().startsWith(\"Invalid mapping line\")) {\n    throw new IllegalArgumentException(\"Fix the universal POS map file: \" + e.getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["One 'source universal' pair per line; no comments","Validate the map file before loading","Use canonical mapping files shipped with the distribution"],"tags":["arabic-nlp","pos-tagging","file-parsing"],"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-15T23:17:13.987Z"}