{"record":{"id":"d246e3226649253d","repo":"stanfordnlp/CoreNLP","slug":"entitysubclassify-unknown-style","errorCode":null,"errorMessage":"entitySubclassify: unknown style: ","messagePattern":"entitySubclassify: unknown style: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/sequences/IOBUtils.java","lineNumber":92,"sourceCode":"        break;\n      case \"ioe2\":\n        how = 3;\n        break;\n      case \"io\":\n        how = 4;\n        break;\n      case \"sbieo\":\n      case \"iobes\":\n        how = 5;\n        break;\n      case \"noprefix\":\n        how = 6;\n        break;\n      case \"bilou\":\n        how = 7;\n        break;\n      default:\n        throw new IllegalArgumentException(\"entitySubclassify: unknown style: \" + style);\n    }\n    List<TOK> paddedTokens = new PaddedList<>(tokens, (TOK) new CoreLabel());\n    int size = paddedTokens.size();\n    String[] newAnswers = new String[size];\n    for (int i = 0; i < size; i++) {\n      TOK c = paddedTokens.get(i);\n      TOK p = paddedTokens.get(i - 1);\n      TOK n = paddedTokens.get(i + 1);\n      String cAns = c.get(key);\n      String pAns = p.get(key);\n      if (pAns == null) {\n        pAns = backgroundLabel;\n      }\n      String nAns = n.get(key);\n      if (nAns == null) {\n        nAns = backgroundLabel;\n      }\n      String base;","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/sequences/IOBUtils.java#L74-L110","documentation":"IOBUtils.entitySubclassify rewrites IOB-style entity tags into one of several supported styles (io, io2, iob1, iob2, iobes, bieo, bilou). Any other style string hits the switch default and throws IllegalArgumentException('entitySubclassify: unknown style: ' + style).","triggerScenarios":"Calling entitySubclassify(tokens, style, ...) with a style string not in {io, io2, iob1, iob2, iobes, bieo, bilou} — e.g. \"BILOU\" (case-sensitive switch) or \"iobes+\", at IOBUtils.java:92.","commonSituations":"Passing a dataset config value like \"BILOU\" or \"conll\" as the sub-classification style; typos; env/config where the style string comes from user-supplied properties.","solutions":["Use one of the supported lowercase styles: io, io2, iob1, iob2, iobes, bieo, bilou.","Normalize the incoming style string with toLowerCase() before passing it in.","Remove or fix the config/property supplying the invalid style value."],"exampleFix":"// before\nentitySubclassify(tokens, \"BILOU\", ...);\n// after\nentitySubclassify(tokens, \"bilou\", ...);","handlingStrategy":"validation","validationCode":"static final Set<String> STYLES = Set.of(\"io\",\"io2\",\"iob1\",\"iob2\",\"iobes\",\"bieo\",\"bilou\");\nif (!STYLES.contains(style.toLowerCase())) throw new IllegalArgumentException(\"bad entitySubclassify style: \" + style);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the documented lowercase style names.","Normalize config values with toLowerCase().trim() before calling.","List valid values in config validation/error messages."],"tags":["java","stanford-corenlp","ner","iob","enum"],"backgroundTag":"invalid-enum-value","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"}