Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PL] Add basic weather sentences #1993

Merged
merged 7 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions responses/pl/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: pl
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'bez zachmurzenia',
'clear-night': 'bez zachmurzenia',
'cloudy': 'i pochmurnie',
'exceptional': 'i wyjątkowo',
'fog': 'z mgłą',
'hail': 'z gradem',
'lightning': 'z piorunami',
'lightning-rainy': 'z deszczem i piorunami',
'partlycloudy': 'z częściowym zachmurzeniem',
'pouring': 'i leje deszcz',
'rainy': 'i pada deszcz',
'snowy': 'i pada śnieg',
'snowy-rainy': 'z deszczem i śniegiem',
'sunny': 'i słonecznie',
'windy': 'i wietrznie',
'windy-variant': 'i wietrznie z zachmurzeniem'
} %}
{{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.state | string).lower(), "") }}
4 changes: 3 additions & 1 deletion sentences/pl/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ lists:
out: "fahrenheit"
brightness_level:
values:
- in: (maksymalny | najjaśniej | maksa)
- in: (maksymalny | najjaśniej | maksa | maksymalnie)
out: 100
- in: (minimalnie | najciemniej | minimum)
out: 1
Expand Down Expand Up @@ -128,3 +128,5 @@ expansion_rules:
skip_words:
- "Proszę"
- "Poproszę"
- "możesz"
- "czy możesz"
10 changes: 10 additions & 0 deletions sentences/pl/weather_HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: pl
intents:
HassGetWeather:
data:
- sentences:
- "<what_is> pogoda"
- sentences:
- "<what_is> pogoda (w|dla|we) <name>"
requires_context:
domain: weather
14 changes: 14 additions & 0 deletions tests/pl/_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,17 @@ entities:
state: "21"
attributes:
unit_of_measurement: "°C"

- name: "Pozna(ń|nia|niu)"
id: "weather.poznan"
state: "rainy"
attributes:
temperature: "8"
temperature_unit: "°C"

- name: "Warszaw(a|ie|y)"
id: "weather.warszawa"
state: "clear"
attributes:
temperature: "24"
temperature_unit: "°C"
42 changes: 42 additions & 0 deletions tests/pl/weather_HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: pl
tests:
- sentences:
- "jaka jest pogoda"
intent:
name: HassGetWeather
response: 8 °C i pada deszcz

- sentences:
- "jaka jest pogoda w Warszawie"

intent:
name: HassGetWeather
slots:
name: Warszawie
response: 24 °C bez zachmurzenia

- sentences:
- "jaka jest pogoda w Warszawa"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct sentence should be "jaka jest pogoda w Warszawie"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you can do automatic declination of entities. This could work with aliases though, but by using default entity names here you match the UI

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right but the future these declensions will be used to create sentences for the ML model. I would prefer it to sound correctly in Polish 😀 check this issue #976


intent:
name: HassGetWeather
slots:
name: Warszawa
response: 24 °C bez zachmurzenia

- sentences:
- "jaka jest pogoda dla Warszawy"

intent:
name: HassGetWeather
slots:
name: Warszawy
response: 24 °C bez zachmurzenia

- sentences:
- "jaka jest pogoda w Poznaniu"
intent:
name: HassGetWeather
slots:
name: Poznaniu
response: 8 °C i pada deszcz