ConversionTimelineExtraction.h header

#include <ew/app/ConversionTimelineExtraction.h>

Namespace ew::app

ConvertedEra struct

struct ew::app::ConvertedEra

One named era band ("The Charted Age", 1100-1500).

Members

QString ew::app::ConvertedEra::name

The era's name.

QString ew::app::ConvertedEra::from

Start instant as the text writes it.

QString ew::app::ConvertedEra::to

End instant; empty for an era the text leaves open.

bool ew::app::ConvertedEra::operator==(const ConvertedEra &) const =default

Value equality across all fields.

ConvertedTimeline struct

struct ew::app::ConvertedTimeline

Everything the timeline stage proposes from one batch of source text.

Members

std::vector<ConvertedTimelineEvent> ew::app::ConvertedTimeline::events

Dated events (title + when required; duplicates by title+when collapsed).

std::vector<ConvertedEra> ew::app::ConvertedTimeline::eras

Named eras (name + from required).

QString ew::app::ConvertedTimeline::calendarHint

A free-text note when the text implies a custom reckoning (era suffixes like "AC", invented month names) – surfaced to the user/report; never applied blindly.

bool ew::app::ConvertedTimeline::operator==(const ConvertedTimeline &) const =default

Value equality across all fields.

ConvertedTimelineEvent struct

struct ew::app::ConvertedTimelineEvent

One dated event the conversion proposes for the validating timeline.

Members

QString ew::app::ConvertedTimelineEvent::title

The event title.

QString ew::app::ConvertedTimelineEvent::when

The start instant, exactly as the text expresses it (a year or date in the world's own reckoning – the apply stage parses it against the project calendar).

QString ew::app::ConvertedTimelineEvent::until

The end instant for a duration; empty for an instantaneous event.

QString ew::app::ConvertedTimelineEvent::description

A one-sentence description grounded in the text (may be empty).

QStringList ew::app::ConvertedTimelineEvent::participants

Participating entities – filtered to KNOWN names, so an event can never reference an entity that is not in the codex (the same no-dangling rule as the detail extraction).

QString ew::app::ConvertedTimelineEvent::location

The location entity, when known; empty otherwise.

bool ew::app::ConvertedTimelineEvent::operator==(const ConvertedTimelineEvent &) const =default

Value equality across all fields.

Functions

AiRequest ew::app::buildConversionTimelineRequest(const QString &sourceText, const QStringList &knownNames)

Builds the AI request asking for dated events, eras, and calendar hints found in sourceText, with participants/locations restricted to knownNames, as strict JSON for parseConversionTimelineResponse. Pure; the caller sets the model and sends it.

ConvertedTimeline ew::app::parseConversionTimelineResponse(const QString &content, const QStringList &knownNames)

Parses the model reply. Tolerant like every conversion parser (hardened JSON isolation, scalars kept); an event without a title or a when is dropped, duplicate title+when events collapse to the first, participants/locations not in knownNames are dropped (never dangle), and an era without a name or a from is dropped. Returns an empty proposal when no well-formed object is present.