Skip to content

Commit

Permalink
[DA] Add support for HassGetCurrentDate and HassGetCurrentTime (#2880)
Browse files Browse the repository at this point in the history
* Add support for HassGetCurrentDate and HassGetCurrentTime in danish

* Normalized common words/phrases
  • Loading branch information
kbhsn4 authored Jan 17, 2025
1 parent b761fd6 commit 4121f84
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 1 deletion.
29 changes: 29 additions & 0 deletions responses/da/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: da
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'januar',
2: 'februar',
3: 'marts',
4: 'april',
5: 'maj',
6: 'juni',
7: 'juli',
8: 'august',
9: 'september',
10: 'oktober',
11: 'november',
12: 'december',
} %}
{% set weekday = [
'Mandag',
'Tirsdag',
'Onsdag',
'Torsdag',
'Fredag',
'Lørdag',
'Søndag'
] %}
{{ weekday[slots.date.weekday()] }} den {{ slots.date.day }}. {{ months[slots.date.month] }} {{ slots.date.year }}
8 changes: 8 additions & 0 deletions responses/da/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: da
responses:
intents:
HassGetCurrentTime:
default: >
{% set hour_str = '{0:02d}'.format(slots.time.hour) %}
{% set minute_str = '{0:02d}'.format(slots.time.minute) %}
{{ hour_str }}:{{ minute_str }}
7 changes: 6 additions & 1 deletion sentences/da/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ expansion_rules:
nogen: "(nogen|nogle)"
enhed: "enhed[(en|er|erne)]"
hvor_mange: "hvor[ ]mange"
hvilke: "hvilke[(t|n)]"
hvilke: "(hvilke[(t|n)]|hvad[ for])"
er_nogen: "er [der] <nogen>"
er_noget: "er [der] noget"
carbonmonoxid: "(carbonmonoxid|kulilte|kulmonoxid|kulos)"
Expand All @@ -368,6 +368,11 @@ expansion_rules:
gas_ikke_fundet: "er [der] ikke [noget] gas (detekteret|fundet|registreret)"
bevaegelses_sensor: "bevægelses[ ]sensorer[ne]"
i: "(i|[oppe ]på)"
spørg_om_værdi: "(hvad er|hvor meget er|(giv|fortæl) mig)"
aktuel_tid: "(klokken|tiden)"
nu: "[lige ]nu"
dato: "(dato|dag)"
dags_dato: "(dagens|i dags) dato"

# Timers
timer: "(timer | nedtælling)"
Expand Down
7 changes: 7 additions & 0 deletions sentences/da/homeassistant_HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: da
intents:
HassGetCurrentDate:
data:
- sentences:
- "<hvilke> [en] <dato> er det [i dag]"
- "<spørg_om_værdi> <dags_dato>"
7 changes: 7 additions & 0 deletions sentences/da/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: da
intents:
HassGetCurrentTime:
data:
- sentences:
- "<spørg_om_værdi> <aktuel_tid> [<nu>]"
- "hvad tid er det [<nu>]"
18 changes: 18 additions & 0 deletions tests/da/homeassistant_HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: da
tests:
- sentences:
- "hvilken dag er det"
- "hvilken dag er det i dag"
- "hvilken dato er det"
- "hvilken dato er det i dag"
- "hvad dag er det"
- "hvad dag er det i dag"
- "hvad dato er det"
- "hvad dato er det i dag"
- "hvad er i dags dato"
- "hvad er dagens dato"
- "giv mig i dags dato"
- "giv mig dagens dato"
intent:
name: HassGetCurrentDate
response: Tirsdag den 17. september 2013
17 changes: 17 additions & 0 deletions tests/da/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: da
tests:
- sentences:
- "hvad er klokken"
- "hvad er klokken nu"
- "hvad er klokken lige nu"
- "hvor meget er klokken"
- "hvor meget er klokken nu"
- "hvor meget er klokken lige nu"
- "hvad tid er det"
- "hvad tid er det nu"
- "hvad tid er det lige nu"
- "giv mig klokken"
- "giv mig tiden lige nu"
intent:
name: HassGetCurrentTime
response: 01:02

0 comments on commit 4121f84

Please sign in to comment.