{"record":{"id":"c2f99ff39d2398d1","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-dashes-style-c2f99f","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/spanish/process/SpanishLexer.flex","lineNumber":150,"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":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/spanish/process/SpanishLexer.flex#L132-L168","documentation":"SpanishLexer throws this IllegalArgumentException when the 'dashes' option value does not match any constant of LexerUtils.DashesEnum. The value is trimmed, uppercased, and passed to Enum.valueOf; unrecognized names are rethrown with this message at lexer construction time.","triggerScenarios":"Constructing SpanishLexer with an options map entry key=\"dashes\" and a value such as \"hyphen\", \"emdash\", or \"dashes\" instead of a valid DashesEnum constant (typically NONE, UNICODE, PTB).","commonSituations":"Hand-edited CoreNLP tokenizer properties; translating PTBTokenizer dash options into SpanishLexer without checking its enum vocabulary; typos or renamed constants across versions.","solutions":["Set dashes to a valid LexerUtils.DashesEnum constant name (e.g. \"none\", \"unicode\", \"ptb\").","Verify the accepted values in LexerUtils.DashesEnum for your CoreNLP version.","Validate the value with LexerUtils.DashesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT)) in a try-catch before construction.","Avoid hyphenated or descriptive values — only exact enum names are accepted."],"exampleFix":"// before\nprops.put(\"dashes\", \"hyphens\");\n// after\nprops.put(\"dashes\", \"unicode\");","handlingStrategy":"validation","validationCode":"// before constructing SpanishLexer\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 SpanishLexer(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 SpanishLexer(reader, tf, options);\n  } else throw e;\n}","preventionTips":["Use LexerUtils.DashesEnum constant names exactly; no hyphens or descriptions.","Check LexerUtils source for your CoreNLP version before changing values.","Share a single validated options-builder across your pipeline."],"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"}