stanfordnlp/CoreNLP · error · IllegalArgumentException
Not a valid ellipses style:
Error message
Not a valid ellipses style:
What it means
PTBLexer's options parser throws this IllegalArgumentException when the "ellipses" option value cannot be converted to a LexerUtils.EllipsesEnum constant via valueOf (after trimming and uppercasing). Accepted values are the enum constants such as unicode and pt3. This surfaces when configuring PTBTokenizer options through properties or the options string.
Solutions
- Set ellipses to a valid enum name such as unicode or pt3 (case-insensitive).
- Consult LexerUtils.EllipsesEnum in your CoreNLP version for the exact accepted constants.
- Remove the ellipses option to use the default if not needed.
- Validate option strings against the enums before passing them to PTBTokenizer in production code.
Example fix
// before PTBTokenizer<CoreLabel> tok = new PTBTokenizer<>(reader, "ellipses=dots"); // throws // after PTBTokenizer<CoreLabel> tok = new PTBTokenizer<>(reader, "ellipses=unicode");
Defensive patterns
Strategy: validation
Validate before calling
// Pre-validate the ellipses option against the enum
static void checkEllipsesOption(String value) {
try {
edu.stanford.nlp.process.LexerUtils.EllipsesEnum.valueOf(value.trim().toUpperCase(java.util.Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("ellipses must be one of " + java.util.Arrays.toString(edu.stanford.nlp.process.LexerUtils.EllipsesEnum.values()) + ", got: " + value);
}
} Try / catch
try {
PTBTokenizer<CoreLabel> tok = new PTBTokenizer<>(reader, options);
} catch (IllegalArgumentException e) {
logger.error("Bad tokenizer option (allowed ellipses values: e.g. unicode, pt3): {}", e.getMessage());
throw e;
} Prevention
- Use only enum names valid for your CoreNLP version (e.g. unicode, pt3)
- Do not reuse dashes values for the ellipses option
- Smoke-test option strings at startup
- Centralize tokenizer options and review changes
When it happens
Trigger: Setting the tokenizer option ellipses=<value> (via PTBTokenizer options string or CoreNLP tokenize properties) with a value that is not a valid LexerUtils.EllipsesEnum name, e.g. ellipses=dots or ellipses=three-dots.
Common situations: CoreNLP config files with ellipses values copied from blog posts for the wrong library version; typos; confusion between the ellipses and dashes option value sets.
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 quotes style:
- Not a valid ellipses style:
- TokenizerAnnotator: unknown tokenize.class property
- TokenizerAnnotator: unknown tokenize.language property
- No valid tokenizer type provided. Use -tokenize.language…
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/7789f7cc01d12690.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/process/PTBLexer.flex:210
} 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)