{"record":{"id":"4284ffbf7775e9bc","repo":"stanfordnlp/CoreNLP","slug":"cannot-interpret-fieldvaluestr","errorCode":null,"errorMessage":"Cannot interpret ${fieldValueStr}","messagePattern":"Cannot interpret (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/time/TimeFormatter.java","lineNumber":379,"sourceCode":"        sb.append(\"\\\\d{\").append(minDigits).append(\",\").append(maxDigits).append(\"}\");\n      } else {\n        for (int i = 0; i < minDigits; i++) {\n          sb.append(\"\\\\d\");\n        }\n      }\n      return sb;\n    }\n\n    public SUTime.Temporal updateTemporal(SUTime.Temporal t, String fieldValueStr) {\n      if (fieldValueStr != null) {\n        for (NumericDateComponent c:possibleNumericDateComponents) {\n          Integer v = c.parseValue(fieldValueStr);\n          if (v != null) {\n            t = c.updateTemporal(t, fieldValueStr);\n            return t;\n          }\n        }\n        throw new IllegalArgumentException(\"Cannot interpret \" + fieldValueStr);\n      }\n      return t;\n    }\n  }\n\n  private static final Comparator<String> STRING_LENGTH_REV_COMPARATOR = (o1, o2) -> {\n    if (o1.length() > o2.length()) return -1;\n    else if (o1.length() < o2.length()) return 1;\n    else {\n      return o1.compareToIgnoreCase(o2);\n    }\n  };\n\n\n  private static class TextDateComponent extends DateTimeFieldComponent {\n\n    Map<String, Integer> valueMapping;\n    List<String> validValues;","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/TimeFormatter.java#L361-L397","documentation":"Thrown by updateTemporal when none of the registered field comparators can interpret the given value string for the temporal field being updated. This is the fallback failure after all specific field parsers (year, month-name, ordinal, etc.) return null from parseValue.","triggerScenarios":"A rule binds captured text to a temporal field but the text matches none of the comparators — e.g. empty string, \"st\"/\"nd\" suffix alone, or mixed tokens like \"late 1990s\" passed as the field value.","commonSituations":"Over-broad regex groups in temporal rule files; normalization steps removed; user-added custom rules with fields that don't match the capture.","solutions":["Inspect which field the rule targets and constrain its regex to values the built-in comparators accept (digits, month names, ordinals).","Pre-normalize captured text (strip suffixes, convert words to numbers) before binding to the field.","Add a custom comparator to the comparator list for the new value form."],"exampleFix":"// before\nPattern: \"(the )?(early|late)? ?(\\\\d{4})s\" -> field: year  // captures \"late\"\n\n// after\nPattern: \"(the )?(?:early|late)? ?(\\\\d{4})s\" -> field: year  // group now only digits","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  t = formatter.updateTemporal(t, fieldValueStr);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Cannot interpret\")) {\n    log.debug(\"Field value not recognized by any comparator: \" + fieldValueStr);\n    return null; // treat expression as unmatched\n  } else throw e;\n}","preventionTips":["Constrain rule regexes so captures correspond to known value shapes (digits, month names, ordinals).","Add custom comparators when introducing new value forms.","Exercise new rules with a corpus before production."],"tags":["temporal-parsing","rule-file","illegal-argument","sutime"],"backgroundTag":"invalid-argument-format","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"}