Narrative-helper classes
April 16, 2026 · View on GitHub
These classes are not Stories. They are scaffolding used by the
composed weather narratives
(weather_overview,
weather_forecast)
to classify a forecast period and emit the matching sentence. They
encapsulate the multi-hour / multi-parameter logic that would
otherwise bloat the generator files.
They all share a similar shape:
class FooForecast
{
public:
FooForecast(wf_story_params& parameters);
Sentence fooSentence(const WeatherPeriod& period /*, ...*/) const;
// internal: period-finding, classification
};
Pages
CloudinessForecastPrecipitationForecastFogForecastThunderForecastWindForecastWeatherForecastStory— the composition scaffold that ties the above together
Shared utilities
WeatherForecast.cpp is a grab-bag of utilities shared by the
narrative helpers:
split_the_area()/check_area_splitting()— horizontal or vertical area splitting driven bytextgen::split_the_area::<area>::method. Used byweather_forecast,temperature_max36hours, andtemperature_anomaly.Rect,get_area_center(),points_in_rectangle()— geometry helpers over aWeatherArea.wf_story_params(inWeatherForecast.h) — the bag of references passed into every helper's constructor (sources, area, period, variable prefix, logger, …).
See also
- Stories — the higher-level concept these helpers serve
- Architecture overview — where the helpers fit in the request flow