{"record":{"id":"382907b68fdf26b5","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-dashes-style-382907","errorCode":null,"errorMessage":"Not a valid dashes style: ","messagePattern":"Not a valid dashes style: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/french/process/FrenchLexer.flex","lineNumber":155,"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":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/french/process/FrenchLexer.flex#L137-L173","documentation":"FrenchLexer throws this IllegalArgumentException when the 'dashes' option value does not match any constant of LexerUtils.DashesEnum. Like the ellipses option, the value is trimmed, uppercased and passed to Enum.valueOf; unrecognized values fail and are rethrown with this message. Thrown at lexer construction time.","triggerScenarios":"Constructing FrenchLexer with an options map containing key=\"dashes\" and a value such as \"hyphen\" or \"em-dash\" instead of a valid DashesEnum constant (typically NONE, UNICODE, PTB).","commonSituations":"Hand-written tokenizer options in a Stanford CoreNLP pipeline properties file; porting English PTBTokenizer dash options to FrenchLexer; typos or version drift where enum constants were renamed between CoreNLP releases.","solutions":["Use a valid LexerUtils.DashesEnum constant name for the dashes option (e.g. \"none\", \"unicode\", \"ptb\").","Inspect LexerUtils.DashesEnum in your CoreNLP version for the accepted values.","Pre-validate the value with a try-catch around LexerUtils.DashesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT)) before constructing the lexer.","Fix typos: value matching is by enum name after trim+uppercase, no hyphens or extra words allowed."],"exampleFix":"// before\nprops.put(\"dashes\", \"em-dash\");\nlex = new FrenchLexer(reader, tf, props);\n// after\nprops.put(\"dashes\", \"ptb\");\nlex = new FrenchLexer(reader, tf, props);","handlingStrategy":"validation","validationCode":"// before constructing FrenchLexer\nString v = options.get(\"dashes\");\nif (v != null) {\n  try { LexerUtils.DashesEnum.valueOf(v.trim().toUpperCase(Locale.ROOT)); }\n  catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"bad dashes value: \" + v); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  lex = new FrenchLexer(reader, tf, options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Not a valid dashes style\")) {\n    options.put(\"dashes\", \"ptb\");\n    lex = new FrenchLexer(reader, tf, options);\n  } else throw e;\n}","preventionTips":["Validate all enum-valued options against LexerUtils enums before construction.","Use enum constants (LexerUtils.DashesEnum.PTB.name()) when building option maps programmatically.","Pin CoreNLP versions to avoid silent enum renames between releases."],"tags":["java","tokenization","configuration","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-15T23:17:13.987Z"}