{"record":{"id":"0fc4d618164e4358","repo":"stanfordnlp/CoreNLP","slug":"number-in-types-column-for-key-is-probably-prio","errorCode":null,"errorMessage":"Number in types column for ${key} is probably priority: ${split[iOverwrite]}","messagePattern":"Number in types column for (.+?) is probably priority: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/pipeline/TokensRegexNERAnnotator.java","lineNumber":758,"sourceCode":"      String[] key = (regexes != null)? regexes: new String[] { tokensRegex };\n      if (ignoreCase) {\n        String[] norm = new String[key.length];\n        for (int i = 0; i < key.length; i++) {\n          norm[i] = key[i].toLowerCase();\n        }\n        key = norm;\n      }\n      String[] types = new String[annotationCols.length];\n      for (int i = 0; i < annotationCols.length; i++) {\n        types[i] = split[annotationCols[i]].trim();\n      }\n\n      final Set<String> overwritableTypes;\n      double priority = 0.0;\n\n      if (iOverwrite >= 0 && split.length > iOverwrite) {\n        if (NUMBER_PATTERN.matcher(split[iOverwrite].trim()).matches()) {\n          logger.warn(\"Number in types column for \" + Arrays.toString(key) +\n                  \" is probably priority: \" + split[iOverwrite]);\n        }\n        String[] tempOTs = COMMA_DELIMITERS_PATTERN.split(split[iOverwrite].trim());\n        if (tempOTs.length == 0) {\n          overwritableTypes = Collections.emptySet();\n        } else if (tempOTs.length == 1) {\n          overwritableTypes = Collections.singleton(tempOTs[0]);\n        } else {\n          overwritableTypes = new HashSet<>(Arrays.asList(tempOTs));\n        }\n      } else {\n        overwritableTypes = Collections.emptySet();\n      }\n      if (iPriority >= 0 && split.length > iPriority) {\n        try {\n          priority = Double.parseDouble(split[iPriority].trim());\n        } catch (NumberFormatException e) {\n          throw new IllegalArgumentException(\"TokensRegexNERAnnotator \" + annotatorName","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/TokensRegexNERAnnotator.java#L740-L776","documentation":"When reading a TokensRegexNER mapping file, the annotator checks the 'types' (overwritable types) column. If the value there is a pure number, it is almost certainly a misplaced priority value (priority belongs in its own column), so this warning is logged. The value is still split as types, likely producing a bogus numeric type.","triggerScenarios":"A mapping file row whose priority number was written into the types column (wrong column count), e.g. 'word\t1.0' where 1.0 is the priority but sits where types are expected.","commonSituations":"Hand-edited rules files with columns transposed or missing; copy-paste from spreadsheets dropping a column; format changes between CoreNLP versions (4-column vs 5-column mapping files).","solutions":["Move the numeric priority into the priority column (last column) of the mapping file","Leave the types column empty or list actual NER types (e.g. PERSON,ORGANIZATION) that may be overwritten","Compare your file against the sample mapping format in the CoreNLP distribution","Count tab-separated columns per line to ensure they match the expected schema"],"exampleFix":"// before (mapping line)\nBarack\t1.0\t0.0\n// after\nBarack\tPERSON\t0.0\t1.0","handlingStrategy":"validation","validationCode":"String[] cols = line.split(\"\\t\", -1);\nfor (String col : cols) {\n  if (col.matches(\"\\\\d+(\\\\.\\d+)?\"))\n    throw new IllegalArgumentException(\"Numeric value in non-numeric column: \" + line);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow the documented mapping-file column order exactly","Put priorities only in the priority (last) column","Validate column count and content with a pre-deployment lint script","Compare against sample mapping files shipped with CoreNLP"],"tags":["nlp","ner","configuration","data-format"],"backgroundTag":"invalid-config-value","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"}