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

[DA] added support for shopping list #2173

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions responses/da/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: "da"
responses:
intents:
HassShoppingListAddItem:
item_added: "{{ slots.item }} tilføjet"
2 changes: 2 additions & 0 deletions sentences/da/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ lists:
out: "on"
- in: "lukket"
out: "closed"
shopping_list_item:
wildcard: true
Comment on lines +273 to +274
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding common shopping items for better user experience.

While the wildcard approach provides flexibility, consider enhancing the user experience by adding common shopping items as suggestions. This could help with:

  • Speech recognition accuracy
  • Consistent item naming
  • User guidance

Example enhancement:

  shopping_list_item:
    wildcard: true
    values:
      - in: "mælk[(en)]"
        out: "mælk"
      - in: "brød[(et)]"
        out: "brød"
      - in: "æg[(gene)]"
        out: "æg"


expansion_rules:
al: "(alle | alt)"
Expand Down
12 changes: 12 additions & 0 deletions sentences/da/shopping_list_HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: "da"
intents:
HassShoppingListAddItem:
data:
- sentences:
- tilføj <item> (til|på) <my_list>
- skriv <item> på <my_list>
- put <item> på <my_list>
Comment on lines +5 to +8
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding more Danish variations for better language coverage.

While the current patterns are valid, consider adding more natural Danish alternatives:

  • "læg på <my_list>"
  • "noter på <my_list>"

Also, consider replacing "put" with more commonly used Danish verbs, as "put" is more English-like.

     - sentences:
         - tilføj <item> (til|på) <my_list>
         - skriv <item> på <my_list>
-        - put <item> på <my_list>
+        - læg <item> på <my_list>
+        - noter <item> på <my_list>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- sentences:
- tilføj <item> (til|på) <my_list>
- skriv <item> på <my_list>
- put <item> på <my_list>
- sentences:
- tilføj <item> (til|på) <my_list>
- skriv <item> på <my_list>
- læg <item> på <my_list>
- noter <item> på <my_list>

response: item_added
expansion_rules:
my_list: "[min ][indkøbs]liste[n]"
item: "{shopping_list_item:item}"
16 changes: 16 additions & 0 deletions tests/da/shopping_list_HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: da
tests:
- sentences:
- tilføj æbler på min indkøbsliste
- tilføj æbler til min indkøbslisten
- tilføj æbler på indkøbslisten
- tilføj æbler til indkøbslisten
- skriv æbler på min indkøbsliste
- skriv æbler på indkøbslisten
- put æbler på min indkøbsliste
- put æbler på indkøbslisten
intent:
name: HassShoppingListAddItem
slots:
item: "æbler "
response: æbler tilføjet