Skip to content

Commit

Permalink
Add support for Timer increase/decrease in Danish plus extend pause/u…
Browse files Browse the repository at this point in the history
…npause sentences (#2900)
  • Loading branch information
kbhsn4 authored Jan 22, 2025
1 parent 15814ca commit edda21e
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 22 deletions.
16 changes: 16 additions & 0 deletions responses/da/HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
language: da
responses:
intents:
HassDecreaseTimer:
default: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' time' if h in [ "1", 'one'] else ' timer') if h else '' %}
{% set m_text = m ~ (' minut' if m in [ "1", 'one'] else ' minutter') if m else '' %}
{% set s_text = s ~ (' sekund' if s in [ "1", 'one'] else ' sekunder') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' og ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' og ') %}
{% set name = (slots.name | trim) if slots.name is defined else '' %}
{{ text }} trukket fra {{ name }} nedtællingen
16 changes: 16 additions & 0 deletions responses/da/HassIncreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
language: da
responses:
intents:
HassIncreaseTimer:
default: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' time' if h in [ "1", 'one'] else ' timer') if h else '' %}
{% set m_text = m ~ (' minut' if m in [ "1", 'one'] else ' minutter') if m else '' %}
{% set s_text = s ~ (' sekund' if s in [ "1", 'one'] else ' sekunder') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' og ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' og ') %}
{% set name = (slots.name | trim) if slots.name is defined else '' %}
{{ text }} lagt til {{ name }} nedtællingen
9 changes: 5 additions & 4 deletions sentences/da/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,15 @@ expansion_rules:
mine_data: "(mine data|det jeg siger|det du <opfanger>|optagelser[ne])"
skabte: "(skabte|har skabt|lavede|har lavet)"
kommandoer: "(kommandoer|ord|sætninger)"
med_navnet: "([med|ved] navn[et]|som hedder|kaldet)"

# Timers
timer: "(nedtælling | timer)"
timers: "(nedtællinger | timere)"
timer: "(nedtælling|timer)[en]"
timers: "(nedtællinger|timere)[ne]"
timer_pause: "(pause|[midlertidig ](stop|stands)[e])"
timer_unpause: "(fortsæt|genoptag[e])"
timer_add: "(læg til|øge)"
timer_decrease: "(sænk|trække fra|reducer)"
timer_add: "(læg|øg)"
timer_decrease: "(sænk|træk|reducer)"
timer_set: "(sæt|start|læg|opret|lav)[ en]"
timer_cancel: "(stop|afbryd|slet|fjern)"
timer_duration_seconds: "{timer_seconds:seconds} sekund[er]"
Expand Down
21 changes: 21 additions & 0 deletions sentences/da/homeassistant_HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
language: da
intents:
HassDecreaseTimer:
data:
- sentences:
- "<timer_decrease> <timer_duration> fra [min] <timer>"
- "<timer_decrease> <timer_duration> fra [min] <timer_start>[s] <timer>"
- "<timer_decrease> <timer_duration> fra [min] <timer> på <timer_start>"
- "<timer_decrease> <timer_duration> fra [min] <område> <timer>"
- "<timer_decrease> <timer_duration> fra [min] <timer> <i_på> <område>"
- "<timer_decrease> <timer_duration> fra [min] {timer_name:name}[ |-]<timer>"
- "<timer_decrease> <timer_duration> fra [min] <timer> <med_navnet> {timer_name:name}"
- sentences:
- "<timer_decrease> [min] <timer> med <timer_duration>"
- "<timer_decrease> [min] <timer_start>[s] <timer> med <timer_duration>"
- "<timer_decrease> [min] <timer> på <timer_start> med <timer_duration>"
- "<timer_decrease> [min] <område>[ |-]<timer> med <timer_duration>"
- "<timer_decrease> [min] <timer> <i_på> <område> med <timer_duration>"
- "<timer_decrease> [min] {timer_name:name}[ |-]<timer> med <timer_duration>"
- "<timer_decrease> [min] <timer> <med_navnet> {timer_name:name} med <timer_duration>"
21 changes: 21 additions & 0 deletions sentences/da/homeassistant_HassIncreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
language: da
intents:
HassIncreaseTimer:
data:
- sentences:
- "<timer_add> <timer_duration> til [min] <timer>"
- "<timer_add> <timer_duration> til [min] <timer_start>[s] <timer>"
- "<timer_add> <timer_duration> til [min] <timer> på <timer_start>"
- "<timer_add> <timer_duration> til [min] <område> <timer>"
- "<timer_add> <timer_duration> til [min] <timer> <i_på> <område>"
- "<timer_add> <timer_duration> til [min] {timer_name:name}[ |-]<timer>"
- "<timer_add> <timer_duration> til [min] <timer> <med_navnet> {timer_name:name}"
- sentences:
- "<timer_add> [min] <timer> med <timer_duration>"
- "<timer_add> [min] <timer_start>[s] <timer> med <timer_duration>"
- "<timer_add> [min] <timer> på <timer_start> med <timer_duration>"
- "<timer_add> [min] <område>[ |-]<timer> med <timer_duration>"
- "<timer_add> [min] <timer> <i_på> <område> med <timer_duration>"
- "<timer_add> [min] {timer_name:name}[ |-]<timer> med <timer_duration>"
- "<timer_add> [min] <timer> <med_navnet> {timer_name:name} med <timer_duration>"
13 changes: 7 additions & 6 deletions sentences/da/homeassistant_HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
language: da
intents:
HassPauseTimer:
data:
- sentences:
- "<timer_pause> [min] <timer>"
- "<timer_pause> [min] <timer_start> <timer>"
- "<timer_pause> [min] <timer> <i_på> <timer_start>"
- "<timer_pause> [min] {area} <timer>"
- "<timer_pause> [min] <timer> <i_på> {area}"
- "<timer_pause> [min] {timer_name:name} <timer>"
- "<timer_pause> [min] <timer> (kaldet|ved navn) {timer_name:name}"
- "<timer_pause> [min] <timer_start>[s] <timer>"
- "<timer_pause> [min] <timer> <timer_start>"
- "<timer_pause> [min] {area}[ |-]<timer>"
- "<timer_pause> [min] <timer> <i_på> <område>"
- "<timer_pause> [min] {timer_name:name}[ |-]<timer>"
- "<timer_pause> [min] <timer> <med_navnet> {timer_name:name}"
13 changes: 7 additions & 6 deletions sentences/da/homeassistant_HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
language: da
intents:
HassUnpauseTimer:
data:
- sentences:
- "<timer_unpause> [min] <timer>"
- "<timer_unpause> [min] <timer_start> <timer>"
- "<timer_unpause> [min] <timer> <i_på> <timer_start>"
- "<timer_unpause> [min] {area} <timer>"
- "<timer_unpause> [min] <timer> <i_på> {area}"
- "<timer_unpause> [min] {timer_name:name} <timer>"
- "<timer_unpause> [min] <timer> (kaldet|ved navn) {timer_name:name}"
- "<timer_unpause> [min] <timer_start>[s] <timer>"
- "<timer_unpause> [min] <timer> <timer_start>"
- "<timer_unpause> [min] {area}[ |-]<timer>"
- "<timer_unpause> [min] <timer> <i_på> <område>"
- "<timer_unpause> [min] {timer_name:name}[ |-]<timer>"
- "<timer_unpause> [min] <timer> <med_navnet> {timer_name:name}"
53 changes: 53 additions & 0 deletions tests/da/homeassistant_HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
language: da
tests:
- sentences:
- "træk 5 minutter fra min nedtælling"
- "træk 5 minutter fra nedtællingen"
- "reducer min nedtælling med 5 minutter"
- "sænk nedtællingen med 5 minutter"
intent:
name: HassDecreaseTimer
slots:
minutes: 5
response: 5 minutter trukket fra nedtællingen

- sentences:
- "træk 5 minutter fra min 1 times nedtælling"
- "træk 5 minutter fra min nedtælling på 1 time"
- "reducer min 1 times nedtælling med 5 minutter"
- "reducer min nedtælling på 1 time med 5 minutter"
- "sænk nedtællingen på 1 time med 5 minutter"
intent:
name: HassDecreaseTimer
slots:
minutes: 5
start_hours: 1
response: 5 minutter trukket fra nedtællingen

- sentences:
- "træk 5 minutter fra min pizza nedtælling"
- "træk 5 minutter fra min nedtælling med navnet pizza"
- "træk 5 minutter fra timeren kaldet pizza"
- "reducer pizza nedtællingen med 5 minutter"
- "reducer nedtællingen med navnet pizza med 5 minutter"
intent:
name: HassDecreaseTimer
slots:
minutes: 5
name:
- "pizza "
- "pizza"
response: 5 minutter trukket fra pizza nedtællingen

- sentences:
- "træk 5 minutter fra min køkken nedtælling"
- "træk 5 minutter fra min nedtælling i Køkkenet"
- "reducer min køkken-timer med 5 minutter"
- "reducer min nedtælling i køkkenet med 5 minutter"
intent:
name: HassDecreaseTimer
slots:
minutes: 5
area: Køkken
response: 5 minutter trukket fra nedtællingen
53 changes: 53 additions & 0 deletions tests/da/homeassistant_HassIncreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
language: da
tests:
- sentences:
- "læg 5 minutter til min nedtælling"
- "læg 5 minutter til nedtællingen"
- "øg min nedtælling med 5 minutter"
- "øg nedtællingen med 5 minutter"
intent:
name: HassIncreaseTimer
slots:
minutes: 5
response: 5 minutter lagt til nedtællingen

- sentences:
- "læg 5 minutter til min 1 times nedtælling"
- "læg 5 minutter til min nedtælling på 1 time"
- "øg min 1 times nedtælling med 5 minutter"
- "øg min nedtælling på 1 time med 5 minutter"
- "øg nedtællingen på 1 time med 5 minutter"
intent:
name: HassIncreaseTimer
slots:
minutes: 5
start_hours: 1
response: 5 minutter lagt til nedtællingen

- sentences:
- "læg 5 minutter til min pizza nedtælling"
- "læg 5 minutter til min nedtælling med navnet pizza"
- "læg 5 minutter til timeren kaldet pizza"
- "øg pizza nedtællingen med 5 minutter"
- "øg nedtællingen med navnet pizza med 5 minutter"
intent:
name: HassIncreaseTimer
slots:
minutes: 5
name:
- "pizza "
- "pizza"
response: 5 minutter lagt til pizza nedtællingen

- sentences:
- "læg 5 minutter til min køkken nedtælling"
- "læg 5 minutter til min nedtælling i Køkkenet"
- "øg min køkken-timer med 5 minutter"
- "øg min nedtælling i køkkenet med 5 minutter"
intent:
name: HassIncreaseTimer
slots:
minutes: 5
area: Køkken
response: 5 minutter lagt til nedtællingen
5 changes: 3 additions & 2 deletions tests/da/homeassistant_HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
language: da
tests:
- sentences:
Expand All @@ -8,7 +9,7 @@ tests:
response: Nedtælling pauset

- sentences:
- "pause 1 time nedtælling"
- "pause 1 times nedtælling"
- "stands min timer på 1 time"
intent:
name: HassPauseTimer
Expand All @@ -29,7 +30,7 @@ tests:

- sentences:
- "pause køkken timer"
- "midlertidig stands nedtælling i køkken"
- "midlertidig stands nedtællingen i køkken"
intent:
name: HassPauseTimer
slots:
Expand Down
9 changes: 5 additions & 4 deletions tests/da/homeassistant_HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
language: da
tests:
- sentences:
Expand All @@ -8,17 +9,17 @@ tests:
response: Nedtælling genoptaget

- sentences:
- "fortsæt 1 time nedtælling"
- "genoptag nedtælling på 1 time"
- "fortsæt 1 times nedtælling"
- "genoptag nedtællingen på 1 time"
intent:
name: HassUnpauseTimer
slots:
start_hours: 1
response: Nedtælling genoptaget

- sentences:
- "fortsæt pizza timer"
- "genoptag nedtælling ved navn pizza"
- "fortsæt pizza-timer"
- "genoptag nedtællingen ved navn pizza"
intent:
name: HassUnpauseTimer
slots:
Expand Down

0 comments on commit edda21e

Please sign in to comment.