-
Notifications
You must be signed in to change notification settings - Fork 625
[BG] Add HassGetDate and HassGetTime #2432
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
Changes from 4 commits
87e4cd8
b4356af
ca9b55b
8c8294c
f60e6e2
39acbcd
3d61b5c
de61114
ae0795c
f71ee90
d7a7408
2f93c97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
language: bg | ||
responses: | ||
intents: | ||
HassGetCurrentDate: | ||
default: > | ||
{% set months = { | ||
1: 'Януари', | ||
2: 'Февруари', | ||
3: 'Март', | ||
4: 'Април', | ||
5: 'Май', | ||
6: 'Юни', | ||
7: 'Юли', | ||
8: 'Август', | ||
9: 'Септември', | ||
10: 'Октомври', | ||
11: 'Ноември', | ||
12: 'Декември', | ||
} %} | ||
{% set ordinal = { | ||
1: 'първи', | ||
2: 'втори', | ||
3: 'трети', | ||
4: 'четвърти', | ||
5: 'пети', | ||
6: 'шести', | ||
7: 'седми', | ||
8: 'осми', | ||
9: 'девети', | ||
10: 'десети', | ||
11: 'единадесети', | ||
12: 'дванадесети', | ||
13: 'тринадесети', | ||
14: 'четиринадесети', | ||
15: 'петнадесети', | ||
16: 'шестнадесети', | ||
17: 'седемнадесети', | ||
18: 'осемнадесети', | ||
19: 'деветнадесети', | ||
20: 'двадесети', | ||
21: 'двадесет и първи', | ||
22: 'двадесет и втори', | ||
23: 'двадесет и трети', | ||
24: 'двадесет и четвърти', | ||
25: 'двадесет и пети', | ||
26: 'двадесет и шести', | ||
27: 'двадесет и седми', | ||
28: 'двадесет и осми', | ||
29: 'двадесет и девети', | ||
30: 'тридесети', | ||
31: 'тридесет и първи', | ||
} %} | ||
{{ ordinal[slots.date.day] }} {{ months[slots.date.month] }} {{ slots.date.year }}-та |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: bg | ||
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 }} минути | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||||||||||||||||||||||
language: bg | ||||||||||||||||||||||||||
intents: | ||||||||||||||||||||||||||
HassGetCurrentDate: | ||||||||||||||||||||||||||
data: | ||||||||||||||||||||||||||
- sentences: | ||||||||||||||||||||||||||
- "[кажи ми] [коя е|каква е] [днешната] дата[та]" | ||||||||||||||||||||||||||
- "[кажи ми] (коя|каква) дата (е|сме) [днес]" | ||||||||||||||||||||||||||
+ - "[кажи ми] датата [днес]" | ||||||||||||||||||||||||||
+ - "[кажи ми] кой ден сме [днес]" | ||||||||||||||||||||||||||
|
data: | |
- sentences: | |
- "[кажи ми] [коя е|каква е] [днешната] дата[та]" | |
- "[кажи ми] (коя|каква) дата (е|сме) [днес]" | |
+ - "[кажи ми] датата [днес]" | |
+ - "[кажи ми] кой ден сме [днес]" | |
data: | |
- sentences: | |
- "[кажи ми] [коя е|каква е] [днешната] дата[та]" | |
- "[кажи ми] (коя|каква) дата (е|сме) [днес]" | |
- "[кажи ми] датата [днес]" | |
- "[кажи ми] кой ден сме [днес]" |
🧰 Tools
🪛 yamllint
[error] 9-9: syntax error: could not find expected ':'
(syntax)
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: bg | ||
intents: | ||
HassGetCurrentTime: | ||
data: | ||
- sentences: | ||
- "[кажи ми] колко е часа" | ||
- "[кажи ми] час[а]" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: bg | ||
tests: | ||
- sentences: | ||
- "дата" | ||
- "кажи ми датата" | ||
- "коя е днешната дата" | ||
- "коя дата е днес" | ||
- "кажи ми днешната дата" | ||
intent: | ||
name: HassGetCurrentDate | ||
response: "седемнайсети Септември 2013-та" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: bg | ||
tests: | ||
- sentences: | ||
- "колко е часа" | ||
- "кажи ми колко е часа" | ||
- "час" | ||
- "кажи ми час" | ||
intent: | ||
name: HassGetCurrentTime | ||
response: "01 часа и 02 минути" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
🛠️ Refactor suggestion
The review suggestions are valid and should be implemented
After analyzing other language implementations, the review suggestions are well-founded:
The suggested improvements in the review are appropriate and align with best practices seen in other language implementations, particularly:
🔗 Analysis chain
Consider improving time formatting and adding error handling.
A few suggestions to enhance the implementation:
Here's a suggested improvement:
Let's verify if there are any similar patterns in other language implementations:
Let me gather more information about error handling patterns in other language implementations.
Let me check the full content of time response files to understand the complete implementation patterns.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1556
Script:
Length of output: 76
Script:
Length of output: 21405