Polish weather phrasing for current and forecast replies

This commit is contained in:
Jacob Dubin
2026-05-16 10:16:34 -05:00
parent 393c34055d
commit a47c90c9c3
4 changed files with 26 additions and 88 deletions

View File

@@ -988,10 +988,10 @@ public sealed class JiboInteractionService(
var forecastLeadIn = string.IsNullOrWhiteSpace(weatherDate.ForecastLeadIn)
? "Tomorrow"
: weatherDate.ForecastLeadIn;
return $"{forecastLeadIn} in {location}, expect {summary}{tempRange}.";
return $"{forecastLeadIn} in {location}, it looks {summary}{tempRange}.";
}
return $"Right now in {location}, it is {summary} and {snapshot.Temperature} degrees {unit}.";
return $"Right now in {location}, it's {summary}, around {snapshot.Temperature} degrees {unit}.";
}
private static string BuildWeeklyForecastSpokenReply(

View File

@@ -173,21 +173,10 @@ public sealed class OpenWeatherReportProvider(
var temperature = TryReadInt(main, "temp");
var high = TryReadInt(main, "temp_max");
var low = TryReadInt(main, "temp_min");
try
if (temperature is not null)
{
var enrichedBand = await TryResolveCurrentDayHighLowFromForecastAsync(
location,
useCelsius,
cancellationToken);
if (enrichedBand is not null)
{
high = enrichedBand.Value.High ?? high;
low = enrichedBand.Value.Low ?? low;
}
}
catch (Exception exception) when (!cancellationToken.IsCancellationRequested)
{
logger.LogDebug(exception, "OpenWeather forecast enrichment failed for current-day Hi/Lo.");
high = high is null ? temperature : Math.Max(high.Value, temperature.Value);
low = low is null ? temperature : Math.Min(low.Value, temperature.Value);
}
if (temperature is null && high is null && low is null)