stanfordnlp/CoreNLP · error · IllegalArgumentException
Not a valid ellipses style:
Error message
Not a valid ellipses style:
What it means
FrenchLexer throws this IllegalArgumentException when the 'ellipses' option is given a value that does not match any constant of LexerUtils.EllipsesEnum. The constructor parses option key/value pairs and uses Enum.valueOf on the uppercased, trimmed value; any unrecognized string fails and is rethrown with this message. It is a configuration validation error, thrown at lexer construction time.
Solutions
- Set the ellipses option to a valid LexerUtils.EllipsesEnum constant name (e.g. "none", "unicode", "ptb"), case-insensitive.
- Check LexerUtils.EllipsesEnum in the source for the exact set of accepted values for your CoreNLP version.
- Validate the options map before constructing the lexer, mirroring Enum.valueOf(value.trim().toUpperCase(Locale.ROOT)) in a try-catch.
- If the value comes from a config file, log or print the offending value; the exception message includes it.
Example fix
// before
props.put("ellipses", "dots");
lex = new FrenchLexer(reader, tf, props);
// after
props.put("ellipses", "unicode");
lex = new FrenchLexer(reader, tf, props); Defensive patterns
Strategy: validation
Validate before calling
// before constructing FrenchLexer
String v = options.get("ellipses");
if (v != null) {
try { LexerUtils.EllipsesEnum.valueOf(v.trim().toUpperCase(Locale.ROOT)); }
catch (IllegalArgumentException e) { throw new IllegalArgumentException("bad ellipses value: " + v); }
} Try / catch
try {
lex = new FrenchLexer(reader, tf, options);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("Not a valid ellipses style")) {
options.put("ellipses", "unicode");
lex = new FrenchLexer(reader, tf, options);
} else throw e;
} Prevention
- Keep a constants file of valid option values derived from LexerUtils.EllipsesEnum.
- Never hand-copy option strings between tokenizers without checking each enum.
- Unit-test pipeline option maps at startup, before annotation jobs run.
When it happens
Trigger: Calling new FrenchLexer(Reader, TokenFactory, Map<String,String>) (or the properties-based constructor) with options map entry key="ellipses" and a value not in EllipsesEnum, e.g. "dots", "...", or "three-dots" (valid values are typically NONE, UNICODE, PTB).
Common situations: Typo in a tokenizer options string in a properties file or pipeline configuration; copying options from PTBTokenizer into FrenchLexer where the enum constants differ; case/formatting changes like "unicode " with stray whitespace (trim is applied, but hyphenated or misspelled variants still fail).
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 dashes style:
- Unknown LogPriorType:
- Not a valid ellipses style:
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/c5453adceb1f9773.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/international/french/process/FrenchLexer.flex:149
normalizeOtherBrackets = val;
ellipsisStyle = val ? LexerUtils.EllipsesEnum.ASCII : LexerUtils.EllipsesEnum.ORIGINAL;
dashesStyle = val ? LexerUtils.DashesEnum.ASCII : LexerUtils.DashesEnum.ORIGINAL;
quoteStyle = val ? LexerUtils.QuotesEnum.ASCII : LexerUtils.QuotesEnum.ORIGINAL;
} else if ("quotes".equals(key)) {
quoteStyle = LexerUtils.QuotesEnum.valueOf(value.toUpperCase(Locale.ROOT));
} else if ("normalizeAmpersandEntity".equals(key)) {
normalizeAmpersandEntity = val;
} else if ("normalizeFractions".equals(key)) {
normalizeFractions = val;
} else if ("normalizeParentheses".equals(key)) {
normalizeParentheses = val;
} else if ("normalizeOtherBrackets".equals(key)) {
normalizeOtherBrackets = 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)