{"record":{"id":"cf56136aa683b3bc","repo":"stanfordnlp/CoreNLP","slug":"unknown-monotonicity-mono","errorCode":null,"errorMessage":"Unknown monotonicity: \" + mono","messagePattern":"Unknown monotonicity: \" \\+ mono","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/naturalli/Operator.java","lineNumber":153,"sourceCode":"    this.subjType = subj.second;\n    this.objMono = Monotonicity.INVALID;\n    this.objType = MonotonicityType.NONE;\n  }\n\n  public boolean isUnary() {\n    return objMono == Monotonicity.INVALID;\n  }\n\n  public static Pair<Monotonicity, MonotonicityType> monoFromString(String mono) {\n    switch (mono) {\n      case \"nonmonotone\": return Pair.makePair(Monotonicity.NONMONOTONE, MonotonicityType.NONE);\n      case \"additive\": return Pair.makePair(Monotonicity.MONOTONE, MonotonicityType.ADDITIVE);\n      case \"multiplicative\": return Pair.makePair(Monotonicity.MONOTONE, MonotonicityType.MULTIPLICATIVE);\n      case \"additive-multiplicative\": return Pair.makePair(Monotonicity.MONOTONE, MonotonicityType.BOTH);\n      case \"anti-additive\": return Pair.makePair(Monotonicity.ANTITONE, MonotonicityType.ADDITIVE);\n      case \"anti-multiplicative\": return Pair.makePair(Monotonicity.ANTITONE, MonotonicityType.MULTIPLICATIVE);\n      case \"anti-additive-multiplicative\": return Pair.makePair(Monotonicity.ANTITONE, MonotonicityType.BOTH);\n      default: throw new IllegalArgumentException(\"Unknown monotonicity: \" + mono);\n    }\n  }\n\n  public static String monotonicitySignature(Monotonicity mono, MonotonicityType type) {\n    switch (mono) {\n      case MONOTONE:\n        switch (type) {\n          case NONE: return \"nonmonotone\";\n          case ADDITIVE: return \"additive\";\n          case MULTIPLICATIVE: return \"multiplicative\";\n          case BOTH: return \"additive-multiplicative\";\n        }\n      case ANTITONE:\n        switch (type) {\n          case NONE: return \"nonmonotone\";\n          case ADDITIVE: return \"anti-additive\";\n          case MULTIPLICATIVE: return \"anti-multiplicative\";\n          case BOTH: return \"anti-additive-multiplicative\";","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/naturalli/Operator.java#L135-L171","documentation":"Operator.monoFromString converts a string like \"additive\" or \"anti-multiplicative\" into a Monotonicity/MonotonicityType pair. When the input string does not match any of the seven recognized monotonicity names, the switch falls through to default and throws IllegalArgumentException. This guards against typos or unsupported monotonicity vocabulary in quantifier/operator definitions.","triggerScenarios":"Calling Operator.monoFromString() with any string other than exactly one of: \"monotone\", \"antitone\", \"nonmonotone\" (implied by the switch), \"additive\", \"multiplicative\", \"additive-multiplicative\", \"anti-additive\", \"anti-multiplicative\", or \"anti-additive-multiplicative\" — e.g. passing \"antiadditive\" or \"none\".","commonSituations":"Typo in a custom quantifier specification; parsing an operator gloss/annotation file with unexpected monotonicity strings; case-sensitivity issues since matching is exact lowercase.","solutions":["Check the input string against the accepted spellings in the switch in Operator.monoFromString and fix the typo or casing","Normalize input (trim/lowercase) before calling monoFromString","Parse user/config input with a fallback to Monotonicity.NONMONOTONE when unknown"],"exampleFix":"// before\nMonotonicity m = Operator.monoFromString(\"antiadditive\").first;\n// after\nString mono = input.trim().toLowerCase(); // \"anti-additive\"\nMonotonicity m = Operator.monoFromString(mono).first;","handlingStrategy":"validation","validationCode":"Set<String> VALID = Set.of(\"monotone\",\"antitone\",\"nonmonotone\",\"additive\",\"multiplicative\",\"additive-multiplicative\",\"anti-additive\",\"anti-multiplicative\",\"anti-additive-multiplicative\");\nif (mono == null || !VALID.contains(mono.trim().toLowerCase())) throw new IllegalArgumentException(\"bad mono: \" + mono);","typeGuard":null,"tryCatchPattern":"try { Pair<Monotonicity,MonotonicityType> p = Operator.monoFromString(s); } catch (IllegalArgumentException e) { /* default to NONMONOTONE */ }","preventionTips":["Normalize and lowercase input strings before parsing","Keep quantifier specs aligned with the accepted vocabulary in Operator"],"tags":["java","illegal-argument","parsing"],"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"}