{"record":{"id":"6d0a4209155ed830","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-dashes-style","errorCode":null,"errorMessage":"Not a valid dashes style: ","messagePattern":"Not a valid dashes style: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/french/process/FrenchLexer.java","lineNumber":12416,"sourceCode":"        } else if (\"normalizeAmpersandEntity\".equals(key)) {\n          normalizeAmpersandEntity = val;\n        } else if (\"normalizeFractions\".equals(key)) {\n          normalizeFractions = val;\n        } else if (\"normalizeParentheses\".equals(key)) {\n          normalizeParentheses = val;\n        } else if (\"normalizeOtherBrackets\".equals(key)) {\n          normalizeOtherBrackets = val;\n        } else if (\"ellipses\".equals(key)) {\n          try {\n            ellipsisStyle = LexerUtils.EllipsesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));\n          } catch (IllegalArgumentException iae) {\n            throw new IllegalArgumentException (\"Not a valid ellipses style: \" + value);\n          }\n        } else if (\"dashes\".equals(key)) {\n          try {\n            dashesStyle = LexerUtils.DashesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));\n          } catch (IllegalArgumentException iae) {\n            throw new IllegalArgumentException (\"Not a valid dashes style: \" + value);\n          }\n        } else if (\"escapeForwardSlashAsterisk\".equals(key)) {\n          escapeForwardSlashAsterisk = val;\n        } else if (\"untokenizable\".equals(key)) {\n          switch (value) {\n            case \"noneDelete\":\n              untokenizable = UntokenizableOptions.NONE_DELETE;\n              break;\n            case \"firstDelete\":\n              untokenizable = UntokenizableOptions.FIRST_DELETE;\n              break;\n            case \"allDelete\":\n              untokenizable = UntokenizableOptions.ALL_DELETE;\n              break;\n            case \"noneKeep\":\n              untokenizable = UntokenizableOptions.NONE_KEEP;\n              break;\n            case \"firstKeep\":","sourceCodeStart":12398,"sourceCodeEnd":12434,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/french/process/FrenchLexer.java#L12398-L12434","documentation":"FrenchLexer option parsing validates the 'dashes' option value by converting it to LexerUtils.DashesEnum via valueOf; if the string is not an enum constant name (case-insensitive) it rethrows an IllegalArgumentException. This guard ensures the lexer is only configured with a supported dashes style.","triggerScenarios":"Calling the FrenchLexer(String) options constructor with 'dashes' set to a value not matching a DashesEnum constant, e.g. options string 'dashes=em-dash' or 'dashes=' (empty).","commonSituations":"Typo in option value, copying options from English PTBTokenizer that supports different styles, passing an empty or null value in the comma/semicolon-delimited options string.","solutions":["Use a valid LexerUtils.DashesEnum constant name (check LexerUtils for allowed values), e.g. 'dashes=short' or whichever constant exists","Fix typos or casing (case is normalized via toUpperCase, so check spelling not case)","Inspect LexerUtils.DashesEnum.values() to list valid values","Validate the options string before constructing the lexer"],"exampleFix":"// before\nnew FrenchLexer(\"dashes=em-dash\");\n// after\nnew FrenchLexer(\"dashes=short\");","handlingStrategy":"validation","validationCode":"boolean dashesOk = java.util.Arrays.stream(LexerUtils.DashesEnum.values()).anyMatch(e -> e.name().equalsIgnoreCase(value));\nif (!dashesOk) throw new IllegalArgumentException(\"Bad dashes option: \" + value);","typeGuard":"boolean isValidDashesStyle(String v) { return v != null && java.util.Arrays.stream(LexerUtils.DashesEnum.values()).anyMatch(e -> e.name().equalsIgnoreCase(v)); }","tryCatchPattern":"try { lexer = new FrenchLexer(optionsString); } catch (IllegalArgumentException e) { log.error(\"Bad lexer option: \" + e.getMessage()); throw new ConfigurationException(e); }","preventionTips":["List DashesEnum values before building the options string","Copy option values from library docs/tests, not memory","Centralize lexer option strings as constants"],"tags":["tokenizer","configuration","illegal-argument"],"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-15T23:17:13.987Z"}