stanfordnlp/CoreNLP · error · IllegalArgumentException

Not a valid ellipses style:

Error message

Not a valid ellipses style: 

What it means

SpanishLexer throws this IllegalArgumentException when the 'ellipses' option value does not match any constant of LexerUtils.EllipsesEnum. The constructor trims and uppercases the value and calls Enum.valueOf; unknown names throw IllegalArgumentException which is rethrown with this message. It is a construction-time configuration validation error.

Solutions

  1. Use a valid LexerUtils.EllipsesEnum constant name for the ellipses option (e.g. "none", "unicode", "ptb"), case-insensitive.
  2. Check LexerUtils.EllipsesEnum source for the exact accepted values in your CoreNLP version.
  3. Pre-validate the option with a try-catch around Enum.valueOf before constructing the lexer.
  4. The exception message echoes the bad value; use it to find the offending config entry.

Example fix

// before
props.put("ellipses", "threeDots");
lex = new SpanishLexer(reader, tf, props);
// after
props.put("ellipses", "unicode");
lex = new SpanishLexer(reader, tf, props);
Defensive patterns

Strategy: validation

Validate before calling

// before constructing SpanishLexer
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 SpanishLexer(reader, tf, options);
} catch (IllegalArgumentException e) {
  if (e.getMessage().contains("Not a valid ellipses style")) {
    options.put("ellipses", "unicode");
    lex = new SpanishLexer(reader, tf, options);
  } else throw e;
}

Prevention

When it happens

Trigger: new SpanishLexer(reader, tf, options) with key="ellipses" and a value like "ellipsis", "three dots", or "..." rather than a valid EllipsesEnum constant (e.g. NONE, UNICODE, PTB).

Common situations: Typos in Spanish tokenizer options in CoreNLP pipeline properties; copying option strings from other tokenizers; version differences in enum constants between CoreNLP releases.

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


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/01ea74824e943ed9. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/international/spanish/process/SpanishLexer.flex:144

            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(key.trim().toLowerCase(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)