ThunderForecast

April 16, 2026 · View on GitHub

Narrative helper that picks the appropriate thunder phrase from the thunder probability and thunder-area extent over a forecast period.

Header: textgen/ThunderForecast.h Source: textgen/ThunderForecast.cpp

What it does

Thunder is always reported as a supplementary clause to a precipitation sentence — it is never an independent narrative in weather_forecast. The helper takes the maximum thunder probability and the maximum thunder-area extent over a period, and dispatches them through a 3×3 table to select one of five phrases.

Primary methods

Sentence thunderSentence(
    const WeatherPeriod& period,
    AreaTools::forecast_area_id forecastArea,
    const std::string& variable) const;

Sentence areaSpecificSentence(const WeatherPeriod& period) const;

Phrase-selection table

From the weather_forecast thunder section:

Extent × Probability20 ≤ tn ≤ 3030 ≤ tn ≤ 6060 ≤ tn ≤ 100
summer: 5 ≤ laajuus < 30paikoin voi myös ukkostaapaikoin myös ukkostaatodennäköisesti myös ukkostaa
winter: 10 ≤ laajuus < 30paikoin voi myös ukkostaapaikoin myös ukkostaatodennäköisesti myös ukkostaa
laajuus ≥ 30mahdollisesti myös ukkostaamyös ukkostaa esiintyytodennäköisesti myös ukkostaa

Internal helpers

The helper has a private getMaxValue() static that walks a weather_result_data_item_vector for a given period and returns the maximum — used both for probability and extent.

See also