Weather text generation

A job advertised as 50% science, 50% programming — in practice it was close to 100% programming, and it's what completed my move from scientist to programmer. The main work was turning structured weather data into natural-language forecast text under hard constraints, for example a forecast that had to fit inside a single SMS message. This was pre-LLM, rule-based text generation: fixed templates and branching rules, not a statistical model. The diagram below runs one forecast through that pipeline — watch the draft text blow through its 160-character budget and get trimmed back down to fit.

  1. Data in — Keswick, 06:00 forecast run
  2. Rain prob 80% → include shower clause
  3. Gust 40mph → include wind detail
  4. Draft assembled — 186 chars
  5. Over budget: 186/160 — trimming required
  6. Drop gust clause (lowest priority) → 162 chars
  7. Still over: 162/160 — simplify further
  8. Wind clause shortened → 151 chars
  9. Fits: 151/160 — approved for send
  10. “Keswick: cloudy with heavy showers this morning, 80% chance of rain, easing during the afternoon before a clear evening. Max 14C min 6C. Wind SW 25mph.” — SENT