{"record":{"id":"ec2dcf877e5066ac","repo":"stanfordnlp/CoreNLP","slug":"not-a-valid-quotes-style-value","errorCode":null,"errorMessage":"Not a valid quotes style: ${value}","messagePattern":"Not a valid quotes style: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/process/PTBLexer.java","lineNumber":61123,"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":61105,"sourceCodeEnd":61141,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/process/PTBLexer.java#L61105-L61141","documentation":"PTBLexer's option parser accepts a \"quotes\" option whose value must be a name of the LexerUtils.QuotesEnum (e.g. UNICODE, ASCII). The value is upper-cased and passed to valueOf(); if it is not a valid enum constant, valueOf throws IllegalArgumentException and the lexer rethrows it with this message.","triggerScenarios":"Calling PTBLexer/PTBTokenizer with option map entry key=\"quotes\" and a value that is not a QuotesEnum constant, e.g. quotes=curly, quotes=\", or a misspelling like quotes=unicodes.","commonSituations":"Typing a free-text token style in tokenizer options (e.g. in a properties file for StanfordCoreNLP with tokenize.options=\"quotes=smart\"); version drift where an old style name was removed; case errors combined with non-enum words.","solutions":["Check LexerUtils.QuotesEnum and use an exact constant name (case-insensitive), e.g. quotes=unicode or quotes=ascii.","Fix typos/extra words in the option value in your properties or options string.","If style names changed across CoreNLP versions, migrate to the enum names supported by your version."],"exampleFix":"// before\nprops.setProperty(\"tokenize.options\", \"quotes=smart\");\n// after\nprops.setProperty(\"tokenize.options\", \"quotes=unicode\");","handlingStrategy":"validation","validationCode":"Set<String> valid = Arrays.stream(LexerUtils.QuotesEnum.values()).map(e -> e.name().toLowerCase(Locale.ROOT)).collect(Collectors.toSet());\nif (!valid.contains(value.trim().toLowerCase(Locale.ROOT))) throw new IllegalArgumentException(\"quotes must be one of \" + valid);","typeGuard":null,"tryCatchPattern":"try { tokenize(text, \"quotes=\" + style); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Not a valid quotes style\")) { log.warn(\"bad quotes style, using unicode\"); tokenize(text, \"quotes=unicode\"); } else throw e; }","preventionTips":["Build tokenizer options from enum constants (QuotesEnum.name()) instead of raw strings.","Keep a constants class listing allowed quotes/ellipses/dashes values.","Validate the whole options string before handing it to PTBTokenizer."],"tags":["tokenizer","enum","configuration"],"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-17T15:17:12.973Z"}