{"record":{"id":"8b103cf0609d2c7d","repo":"stanfordnlp/CoreNLP","slug":"error-resolving","errorCode":null,"errorMessage":"Error resolving ","messagePattern":"Error resolving ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java","lineNumber":293,"sourceCode":"\n  private void resolveTimeExpression(CoreMap annotation, TimeExpression te, SUTime.Time docDate) {\n    SUTime.Temporal temporal = te.getTemporal();\n    if (temporal != null) {\n      // TODO: use correct time for anchor\n      try {\n        int flags = timexPatterns.determineRelFlags(annotation, te);\n        //int flags = 0;\n        SUTime.Temporal grounded = temporal.resolve(docDate, flags);\n        if (grounded == null) {\n          logger.debug(\"Error resolving \" + temporal + \", using docDate=\" + docDate);\n        }\n        if (grounded != temporal) {\n          te.origTemporal = temporal;\n          te.setTemporal(grounded);\n        }\n      } catch (Exception ex) {\n        if (options.verbose) {\n          logger.warn(\"Error resolving \" + temporal, ex);\n          logger.warn(ex);\n        }\n      }\n    }\n  }\n\n  private void resolveTimeExpressions(CoreMap annotation, List<TimeExpression> timeExpressions, SUTime.Time docDate) {\n    for (TimeExpression te:timeExpressions) {\n      resolveTimeExpression(annotation, te, docDate);\n    }\n  }\n\n  private static SUTime.Time findReferenceDate(List<TimeExpression> timeExpressions) {\n    // Find first full date in this annotation with year, month, and day\n    for (TimeExpression te:timeExpressions) {\n      SUTime.Temporal t = te.getTemporal();\n      if (t instanceof SUTime.Time) {\n        if (t.isGrounded()) {","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java#L275-L311","documentation":"A logged warning in resolveTimeExpression: after a TimeExpression's temporal is computed, grounding/resolving it against the document date (SUTime resolving, timezone/refs) threw an Exception. When options.verbose is on, 'Error resolving <temporal>' is logged and the expression is left unresolved (origTemporal kept, grounding skipped) — processing continues, so the Timex may keep an unresolved RELATIVE value.","triggerScenarios":"extractTimeExpressions -> resolveTimeExpression on expressions like 'last Friday', 'next month' when the reference date (docDate) is missing, malformed, or the temporal's resolution arithmetic throws (bad Duration/RangeIntersect operations from rule output).","commonSituations":"Documents annotated without a docdate/reference-time property ( sutime.referenceDate not set ), custom rules yielding temporals SUTime cannot ground, or reference dates in unexpected formats causing parse failure inside resolution.","solutions":["Set the reference date correctly: pipeline property 'sutime.referenceDate' (ISO yyyy-MM-dd) or ensure a DocDateAnnotation is present","Enable sutime.verbose to see the underlying exception and which temporal failed","Fix the custom SUTime rule producing the unresolvable temporal","Upgrade CoreNLP; several resolution edge cases around relative dates have been fixed"],"exampleFix":"// before\nProperties props = new Properties();\nprops.setProperty(\"annotators\", \"tokenize,ssplit,pos,lemma,ner\"); // no reference date\n// after\nprops.setProperty(\"annotators\", \"tokenize,ssplit,pos,lemma,ner\");\nprops.setProperty(\"sutime.referenceDate\", \"2024-06-15\"); // ground relative temporals like \"last Friday\"","handlingStrategy":"validation","validationCode":"// always supply a reference date before running sutime\nProperties props = new Properties();\nprops.setProperty(\"annotators\", \"tokenize,ssplit,pos,lemma,ner\");\nString refDate = docDate; // must match yyyy-MM-dd or be null\nif (refDate != null) {\n  if (!refDate.matches(\"\\\\d{4}-\\\\d{2}-\\\\d{2}.*\")) throw new IllegalArgumentException(\"bad referenceDate: \" + refDate);\n  props.setProperty(\"sutime.referenceDate\", refDate);\n}","typeGuard":null,"tryCatchPattern":"try {\n  List<CoreMap> timex = extractor.extractTimeExpressionCoreMaps(annotation, docDate, timeIndex);\n} catch (Exception e) {\n  log.warn(\"SUTime resolution failed\", e); // unresolved relative dates remain\n}","preventionTips":["Always set sutime.referenceDate when processing documents with relative time expressions","Validate reference-date format (ISO 8601) before configuring the pipeline","Keep sutime.verbose on in test runs to catch unresolved temporals"],"tags":["java","nlp","sutime","temporal-resolution"],"backgroundTag":"invalid-date-format","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"}