{"record":{"id":"7328398810d5867f","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-quotes-style","errorCode":null,"errorMessage":"Not a valid quotes style: ","messagePattern":"Not a valid quotes style: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/process/PTBLexer.flex","lineNumber":198,"sourceCode":"          } else if (\"americanize\".equals(key)) {\n            americanize = val;\n          } else if (\"normalizeSpace\".equals(key)) {\n            normalizeSpace = val;\n          } else if (\"normalizeAmpersandEntity\".equals(key)) {\n            normalizeAmpersandEntity = val;\n          } else if (\"normalizeCurrency\".equals(key)) {\n            normalizeCurrency = 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 (\"quotes\".equals(key)) {\n            try {\n              quoteStyle = LexerUtils.QuotesEnum.valueOf(value.trim().toUpperCase(Locale.ROOT));\n            } catch (IllegalArgumentException iae) {\n              throw new IllegalArgumentException (\"Not a valid quotes style: \" + value);\n            }\n          } else if (\"splitAssimilations\".equals(key)) {\n            splitAssimilations = val;\n          } else if (\"splitHyphenated\".equals(key)) {\n            splitHyphenated = val;\n          } else if (\"splitForwardSlash\".equals(key)) {\n            splitForwardSlash = 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);","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/process/PTBLexer.flex#L180-L216","documentation":"PTBLexer's options parser throws this IllegalArgumentException when the \"quotes\" option value cannot be converted to a LexerUtils.QuotesEnum constant via valueOf (after trimming and uppercasing). Only enum-constant names like unicode, ascii, original are accepted. This typically happens when configuring the PTBTokenizer through properties (e.g. tokenize.options or tokenizer options in CoreNLP).","triggerScenarios":"Setting the tokenizer option quotes=<value> (via PTBTokenizer constructor options string, CoreNLP properties token.quote or tokenize options) with a value that is not a valid LexerUtils.QuotesEnum name, e.g. quotes=smart or quotes=curly.","commonSituations":"CoreNLP server/properties files using a quotes value copied from outdated documentation; typos like quote (singular) style names; passing human-friendly labels instead of the exact enum constants (UNICODE, ASCII, ORIGINAL).","solutions":["Set quotes to one of the valid enum names: unicode, ascii, or original (case-insensitive).","Check LexerUtils.QuotesEnum in your Stanford CoreNLP version for the exact accepted values (they changed across versions).","Remove the quotes option entirely to use the default behavior if customization isn't needed.","Wrap tokenizer construction in try-catch for IllegalArgumentException and log the accepted values."],"exampleFix":"// before\nProperties props = new Properties();\nprops.setProperty(\"tokenize.options\", \"quotes=curly,untokenizable=noneDelete\"); // throws\n// after\nprops.setProperty(\"tokenize.options\", \"quotes=unicode,untokenizable=noneDelete\");","handlingStrategy":"validation","validationCode":"// Pre-validate the quotes option against the enum\nstatic void checkQuotesOption(String value) {\n  try {\n    edu.stanford.nlp.process.LexerUtils.QuotesEnum.valueOf(value.trim().toUpperCase(java.util.Locale.ROOT));\n  } catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"quotes must be one of \" + java.util.Arrays.toString(edu.stanford.nlp.process.LexerUtils.QuotesEnum.values()) + \", got: \" + value);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  PTBTokenizer<CoreLabel> tok = new PTBTokenizer<>(reader, options);\n} catch (IllegalArgumentException e) {\n  logger.error(\"Bad tokenizer option (allowed quotes values: unicode, ascii, original): {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Use only documented enum names: unicode, ascii, original","Check the QuotesEnum of your exact CoreNLP version","Validate tokenizer option strings at startup with a smoke tokenize","Keep tokenizer options in one reviewed constants file"],"tags":["tokenizer","configuration","java","corenlp","enum"],"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"}