# `Foresight.Recall.QueryAnalyzer`
[🔗](https://github.com/fosferon/foresight/blob/v0.3.2/lib/foresight/recall/query_analyzer.ex#L1)

Extracts a temporal constraint (a `%{from: DateTime, to: DateTime}` day/period range)
from a natural-language query.

Native port of Hindsight's `DateparserQueryAnalyzer._extract_period`
(query_analyzer.py:175-294): multilingual *period* expressions in EN/ES/IT/FR/DE
(yesterday, today, "a few weeks ago", last week/month/year/weekend, "June 2024")
plus explicit ISO dates. This is the always-available layer.

The 200+ language single-date tail (incl. Greek) is handled by the Python
`dateparser` layer which falls back to this module when unavailable.

# `analyze`

```elixir
@spec analyze(String.t(), DateTime.t(), keyword()) ::
  %{from: DateTime.t(), to: DateTime.t()} | nil
```

Returns a `%{from: DateTime, to: DateTime}` range for the first temporal period
found in `query`, resolved against `reference` (a `DateTime`), or `nil`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
