{"record":{"id":"62737539c1c0a476","repo":"stanfordnlp/CoreNLP","slug":"frenchlexer-invalid-option-value-in-constructor","errorCode":null,"errorMessage":"FrenchLexer: Invalid option value in constructor: : ","messagePattern":"FrenchLexer: Invalid option value in constructor: : ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/international/french/process/FrenchLexer.java","lineNumber":12441,"sourceCode":"              untokenizable = UntokenizableOptions.NONE_DELETE;\n              break;\n            case \"firstDelete\":\n              untokenizable = UntokenizableOptions.FIRST_DELETE;\n              break;\n            case \"allDelete\":\n              untokenizable = UntokenizableOptions.ALL_DELETE;\n              break;\n            case \"noneKeep\":\n              untokenizable = UntokenizableOptions.NONE_KEEP;\n              break;\n            case \"firstKeep\":\n              untokenizable = UntokenizableOptions.FIRST_KEEP;\n              break;\n            case \"allKeep\":\n              untokenizable = UntokenizableOptions.ALL_KEEP;\n              break;\n            default:\n              throw new IllegalArgumentException(\"FrenchLexer: Invalid option value in constructor: \" + key + \": \" + value);\n          }\n        } else if (\"strictTreebank3\".equals(key)) {\n          strictTreebank3 = val;\n        } else {\n          System.err.printf(\"%s: Invalid options key in constructor: %s%n\", this.getClass().getName(), key);\n        }\n      }\n      // this.seenUntokenizableCharacter = false; // unnecessary, it's default initialized\n      if (invertible) {\n        if ( ! (tf instanceof CoreLabelTokenFactory)) {\n          throw new IllegalArgumentException(\"FrenchLexer: the invertible option requires a CoreLabelTokenFactory\");\n        }\n        prevWord = (CoreLabel) tf.makeToken(\"\", 0, 0);\n        prevWordAfter = new StringBuilder();\n      }\n    }\n\n","sourceCodeStart":12423,"sourceCodeEnd":12459,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/international/french/process/FrenchLexer.java#L12423-L12459","documentation":"The FrenchLexer options constructor iterates key/value pairs and throws this IllegalArgumentException in the default case of the 'untokenizable' switch, or generally when an option value is invalid for its key. It signals an unrecognized or unsupported option value passed to the constructor.","triggerScenarios":"Passing an option string where 'untokenizable' has a value other than noneDelete/noneKeep/firstDelete/firstKeep/allDelete/allKeep, or any other key with an unparseable value reaching the default branch.","commonSituations":"Typo like 'untokenizable=allkeep' (needs exact mixed-case match), copying PTBTokenizer options that FrenchLexer does not support, hand-edited configuration files.","solutions":["Use an exact valid untokenizable value: noneDelete, noneKeep, firstDelete, firstKeep, allDelete, allKeep","Check the option key spelling; unknown keys are only logged to stderr, invalid values throw","Compare against the switch cases in FrenchLexer's options constructor","Validate the options string programmatically before constructing"],"exampleFix":"// before\nnew FrenchLexer(\"untokenizable=allkeep\");\n// after\nnew FrenchLexer(\"untokenizable=allKeep\");","handlingStrategy":"validation","validationCode":"java.util.Set<String> ok = java.util.Set.of(\"noneDelete\",\"noneKeep\",\"firstDelete\",\"firstKeep\",\"allDelete\",\"allKeep\");\nif (!ok.contains(untokenizableValue)) throw new IllegalArgumentException(\"Bad untokenizable value: \" + untokenizableValue);","typeGuard":"boolean isValidUntokenizable(String v) { return java.util.Set.of(\"noneDelete\",\"noneKeep\",\"firstDelete\",\"firstKeep\",\"allDelete\",\"allKeep\").contains(v); }","tryCatchPattern":"try { lexer = new FrenchLexer(optionsString); } catch (IllegalArgumentException e) { log.error(\"Invalid FrenchLexer option: \" + e.getMessage()); throw new ConfigurationException(e); }","preventionTips":["Use exact mixed-case option values as defined in the switch","Validate all key/value pairs before constructing the lexer","Check unknown-key stderr warnings during development"],"tags":["tokenizer","configuration","illegal-argument"],"backgroundTag":"invalid-config-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"}