stanfordnlp/CoreNLP · warning

Error resolving

Error message

Error resolving 

What it means

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.

Solutions

  1. Set the reference date correctly: pipeline property 'sutime.referenceDate' (ISO yyyy-MM-dd) or ensure a DocDateAnnotation is present
  2. Enable sutime.verbose to see the underlying exception and which temporal failed
  3. Fix the custom SUTime rule producing the unresolvable temporal
  4. Upgrade CoreNLP; several resolution edge cases around relative dates have been fixed

Example fix

// before
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner"); // no reference date
// after
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner");
props.setProperty("sutime.referenceDate", "2024-06-15"); // ground relative temporals like "last Friday"
Defensive patterns

Strategy: validation

Validate before calling

// always supply a reference date before running sutime
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner");
String refDate = docDate; // must match yyyy-MM-dd or be null
if (refDate != null) {
  if (!refDate.matches("\\d{4}-\\d{2}-\\d{2}.*")) throw new IllegalArgumentException("bad referenceDate: " + refDate);
  props.setProperty("sutime.referenceDate", refDate);
}

Try / catch

try {
  List<CoreMap> timex = extractor.extractTimeExpressionCoreMaps(annotation, docDate, timeIndex);
} catch (Exception e) {
  log.warn("SUTime resolution failed", e); // unresolved relative dates remain
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/8b103cf0609d2c7d. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java:293

  private void resolveTimeExpression(CoreMap annotation, TimeExpression te, SUTime.Time docDate) {
    SUTime.Temporal temporal = te.getTemporal();
    if (temporal != null) {
      // TODO: use correct time for anchor
      try {
        int flags = timexPatterns.determineRelFlags(annotation, te);
        //int flags = 0;
        SUTime.Temporal grounded = temporal.resolve(docDate, flags);
        if (grounded == null) {
          logger.debug("Error resolving " + temporal + ", using docDate=" + docDate);
        }
        if (grounded != temporal) {
          te.origTemporal = temporal;
          te.setTemporal(grounded);
        }
      } catch (Exception ex) {
        if (options.verbose) {
          logger.warn("Error resolving " + temporal, ex);
          logger.warn(ex);
        }
      }
    }
  }

  private void resolveTimeExpressions(CoreMap annotation, List<TimeExpression> timeExpressions, SUTime.Time docDate) {
    for (TimeExpression te:timeExpressions) {
      resolveTimeExpression(annotation, te, docDate);
    }
  }

  private static SUTime.Time findReferenceDate(List<TimeExpression> timeExpressions) {
    // Find first full date in this annotation with year, month, and day
    for (TimeExpression te:timeExpressions) {
      SUTime.Temporal t = te.getTemporal();
      if (t instanceof SUTime.Time) {
        if (t.isGrounded()) {

View on GitHub (pinned to 1b7edd19c4)