libSDRForge
Loading...
Searching...
No Matches
sdrforge.weather.forecast Namespace Reference

Conservative period-based forecast extraction from offline NOAA transcripts. More...

Classes

class  ForecastPeriod
 Provide ForecastPeriod behavior. More...

Functions

list[Match[str]] period_matches (str text, *, bool allow_sunday_alias=False)
 Recognize 'so night' only immediately following a Sunday period.
tuple[ForecastPeriod,...] extract_forecasts (str transcript, *, bool allow_sunday_alias=False)
 Extract explicitly named periods; never infer missing measurements.

Variables

 _PERIOD
tuple _CONDITIONS
 _TEMPERATURE
 _PROBABILITY = re.compile(r"\b(" + _SPOKEN_NUMBER + r")\s*(?:percent|%)\s+chance\b")
 _PROBABILITY_TRAILING

Detailed Description

Conservative period-based forecast extraction from offline NOAA transcripts.

Function Documentation

◆ extract_forecasts()

tuple[ForecastPeriod, ...] sdrforge.weather.forecast.extract_forecasts ( str transcript,
* ,
bool allow_sunday_alias = False )

Extract explicitly named periods; never infer missing measurements.

Parameters
transcriptThe transcript value.
allow_sunday_aliasThe allow sunday alias value.
Returns
The operation result.

◆ period_matches()

list[Match[str]] sdrforge.weather.forecast.period_matches ( str text,
* ,
bool allow_sunday_alias = False )

Recognize 'so night' only immediately following a Sunday period.

Parameters
textThe text value.
allow_sunday_aliasThe allow sunday alias value.
Returns
The operation result.

Variable Documentation

◆ _CONDITIONS

tuple sdrforge.weather.forecast._CONDITIONS
protected
Initial value:
1= (
2 "mostly sunny",
3 "partly sunny",
4 "mostly cloudy",
5 "partly cloudy",
6 "sunny",
7 "cloudy",
8 "mostly clear",
9 "partly clear",
10 "clear",
11 "rain showers",
12 "snow showers",
13 "showers",
14 "thunderstorms",
15 "rain",
16 "snow",
17 "fog",
18)

◆ _PERIOD

sdrforge.weather.forecast._PERIOD
protected
Initial value:
1= re.compile(
2 r"\b(monday|tuesday|wednesday|thursday|friday|saturday|sunday|"
3 r"tonight|today|this afternoon|this evening|overnight|so night)"
4 r"( night| morning| afternoon| evening)?\b"
5)

◆ _PROBABILITY

sdrforge.weather.forecast._PROBABILITY = re.compile(r"\b(" + _SPOKEN_NUMBER + r")\s*(?:percent|%)\s+chance\b")
protected

◆ _PROBABILITY_TRAILING

sdrforge.weather.forecast._PROBABILITY_TRAILING
protected
Initial value:
1= re.compile(
2 r"\bchance\s+of\s+(?:rain|snow|precipitation|showers)\s+("
3 + _SPOKEN_NUMBER
4 + r")\s*(?:percent|%)\b"
5)

◆ _TEMPERATURE

sdrforge.weather.forecast._TEMPERATURE
protected
Initial value:
1= re.compile(
2 r"\b(highs?|lows?|guys|ties|those|flows|close)\s+(?:(?:around|near|in the|of|from)\s+)?"
3 r"(?:(upper|lower|mid|middle)\s+)?("
4 + _SPOKEN_NUMBER
5 + r"|twenties|thirties|forties|fifties|sixties|seventies|eighties|nineties)\b"
6)