{"record":{"id":"bdc6856bd71e8ece","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-ellipses-style-value","errorCode":null,"errorMessage":"Not a valid ellipses style: ${value}","messagePattern":"Not a valid ellipses style: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/spanish/process/SpanishLexer.java","lineNumber":14152,"sourceCode":"            normalizeOtherBrackets = val;\n            ellipsisStyle = val ? LexerUtils.EllipsesEnum.ASCII : LexerUtils.EllipsesEnum.ORIGINAL;\n            dashesStyle = val ? LexerUtils.DashesEnum.ASCII : LexerUtils.DashesEnum.ORIGINAL;\n            quoteStyle = val ? LexerUtils.QuotesEnum.ASCII : LexerUtils.QuotesEnum.ORIGINAL;\n          } else if (\"quotes\".equals(key)) {\n            quoteStyle = LexerUtils.QuotesEnum.valueOf(key.trim().toLowerCase(Locale.ROOT));\n          } 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\":","sourceCodeStart":14134,"sourceCodeEnd":14170,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/spanish/process/SpanishLexer.java#L14134-L14170","documentation":"The generated SpanishLexer (JFlex-based) accepts options passed to its constructor, including 'ellipses' which controls how '...' is tokenized. The value must be a valid LexerUtils.EllipsesEnum constant; if Enum.valueOf fails, the lexer rethrows an IllegalArgumentException reporting the invalid value.","triggerScenarios":"Constructing SpanishLexer with options containing key 'ellipses' and a value that is not a valid EllipsesEnum name (after trim and uppercase), e.g. 'dots', 'three-dots', 'unicode', or an empty string. Valid values are the EllipsesEnum constants (e.g. UNICODE, DELETE, LEAVE).","commonSituations":"Config files (tokenizer options in properties files) written with free-form values; copying PTBTokenizer option values that don't exist for this lexer; typos or lowercase-with-hyphens style values; upgrading the parser and using enum names removed/renamed in LexerUtils.","solutions":["Use a valid EllipsesEnum value, e.g. 'unicode', 'delete', or 'leave' (matching LexerUtils.EllipsesEnum, compared upper-case).","Check the accepted names in LexerUtils.EllipsesEnum for your library version.","Wrap lexer construction in try-catch for IllegalArgumentException and fall back to the default ellipses style.","Validate the config value before passing it to the lexer."],"exampleFix":"// before\nnew SpanishLexer(new InputStreamReader(in), \"ellipses=three-dots\");\n// after\nnew SpanishLexer(new InputStreamReader(in), \"ellipses=unicode\");","handlingStrategy":"validation","validationCode":"String v = value.trim().toUpperCase(Locale.ROOT);\nboolean ok = java.util.Arrays.stream(LexerUtils.EllipsesEnum.values())\n    .anyMatch(e -> e.name().equals(v));\nif (!ok) throw new IllegalArgumentException(\"Bad ellipses option: \" + value);","typeGuard":"static boolean isValidEllipsesStyle(String value) {\n  if (value == null) return false;\n  String v = value.trim().toUpperCase(Locale.ROOT);\n  for (LexerUtils.EllipsesEnum e : LexerUtils.EllipsesEnum.values())\n    if (e.name().equals(v)) return true;\n  return false;\n}","tryCatchPattern":"try {\n  lexer = new SpanishLexer(reader, options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Not a valid ellipses style\")) {\n    lexer = new SpanishLexer(reader, options.replaceAll(\"ellipses=[^,]*\", \"ellipses=unicode\"));\n  } else { throw e; }\n}","preventionTips":["Keep tokenizer option values as enum constants, not free-form text.","Validate properties files at config load time.","Pin the CoreNLP version and check enum names against LexerUtils."],"tags":["java","stanford-nlp","tokenizer","configuration","lexer"],"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"}