stanfordnlp/CoreNLP · error · IllegalArgumentException
Not a valid ellipses style
Error message
Not a valid ellipses style: ${value} What it means
Same option-parsing path as the quotes style: the "ellipses" option value must be a LexerUtils.EllipsesEnum constant (e.g. UNICODE, UTF8, ASCII). An unrecognized value fails valueOf() and the lexer throws this IllegalArgumentException.
Solutions
- Use an exact LexerUtils.EllipsesEnum name (case-insensitive), e.g. ellipses=unicode or ellipses=ascii.
- Verify the options string is split correctly on commas/whitespace so the value is a single token.
- Cross-check the enum constants in the CoreNLP version you run against.
Example fix
// before
String[] opts = {"ellipses", "three-dots"};
// after
String[] opts = {"ellipses", "unicode"}; Defensive patterns
Strategy: validation
Validate before calling
boolean ok = Arrays.stream(LexerUtils.EllipsesEnum.values()).anyMatch(e -> e.name().equalsIgnoreCase(value.trim()));
if (!ok) throw new IllegalArgumentException("ellipses must be a LexerUtils.EllipsesEnum name"); Try / catch
try { new PTBTokenizer<>(reader, factory, "ellipses=" + style); } catch (IllegalArgumentException e) { if (e.getMessage().contains("ellipses style")) { /* fall back to unicode */ } else throw e; } Prevention
- Use EllipsesEnum.valueOf(userInput.trim().toUpperCase()) yourself first to fail fast with a better message.
- Whitelist option values in configuration parsing.
- Document accepted values next to the config file.
When it happens
Trigger: Option map with key="ellipses" and a value not in EllipsesEnum, e.g. ellipses=dots, ellipses=three-dots, or ellipses=unicode with trailing punctuation that trim() does not remove.
Common situations: Hand-written tokenize.options strings where the author guesses a style name; copying options from documentation of a different library; combining several options and mis-splitting them so a fragment lands in the value.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Not a valid dashes style
- Not a valid ellipses style:
- Not a valid ellipses style:
- Not a valid quotes style:
- Not a valid quotes style
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/21d55241bbaa289b.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/process/PTBLexer.java:61135
} else if ("normalizeOtherBrackets".equals(key)) {
normalizeOtherBrackets = val;
} else if ("quotes".equals(key)) {
try {
quoteStyle = LexerUtils.QuotesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException iae) {
throw new IllegalArgumentException ("Not a valid quotes style: " + value);
}
} else if ("splitAssimilations".equals(key)) {
splitAssimilations = val;
} else if ("splitHyphenated".equals(key)) {
splitHyphenated = val;
} else if ("splitForwardSlash".equals(key)) {
splitForwardSlash = val;
} else if ("ellipses".equals(key)) {
try {
ellipsisStyle = LexerUtils.EllipsesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException iae) {
throw new IllegalArgumentException ("Not a valid ellipses style: " + value);
}
} else if ("dashes".equals(key)) {
try {
dashesStyle = LexerUtils.DashesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException iae) {
throw new IllegalArgumentException ("Not a valid dashes style: " + value);
}
} else if ("escapeForwardSlashAsterisk".equals(key)) {
escapeForwardSlashAsterisk = val;
} else if ("untokenizable".equals(key)) {
switch (value) {
case "noneDelete":
untokenizable = UntokenizableOptions.NONE_DELETE;
break;
case "firstDelete":
untokenizable = UntokenizableOptions.FIRST_DELETE;
break;
case "allDelete":View on GitHub (pinned to 1b7edd19c4)