intents
intents copied to clipboard
To-Do / Shopping list wildcards currently matches partial words, which makes some sentence definitions to work wrongly
Hello, I'm unable to make the following sentences work:
- Añadir manzanas a la lista de la compra
- Añadir manzanas a mi lista de la compra
While the following works fine:
- Añadir manzanas en la lista de la compra
- Añadir manzanas en mi lista de la compra
@davefx I think something may be wrong in the definition, maybe spacing?
Having the same issue, I think the problem is because of this
so basically
data:
- sentences:
- <añadir> <item> (en|a)<my_list>
response: item_added
expansion_rules:
my_list: "[ mi| la] lista [de] [la] [compra]"
HA gets manzas a l
as <item>
then a
as (a)
then lista de la compra
as <my_list>
.
To workaround this I extended the intent:
language: "es"
intents:
HassShoppingListAddItem:
data:
- sentences:
- "apunta {shopping_list_item:item}."
response: item_added
With this I just have to say apunta manzanas.
To be noticed that the final .
avoids having manzanas.
on your list.
Reopening the issue. The problem is not fixed and still happens in the last version, both with to-do lists and with the shopping list.
The problem is caused because of the wildcard rule, that currently matches partial words. In order to make it work, I've made a change in the to-do list sentence definition so we always require the definite article "la lista" in order to avoid false recognitions (but then ignoring sentences without the definite article).
@synesthesiam Could we make some kind of change so the {shopping_list_item:item}
wildcard only matches full words (and never partial words), so Añadir manzanas a la lista de la compra
never matches manzanas a l
as the item name?
We should be able to support all these sentences:
Añadir manzanas a lista de la compra
Añadir manzanas a la lista de la compra
But now, if we define a rule like <añadir> <item> (en|a) [la] lista de la compra
, it will always identify manzanas a l
as the item list.
Related to https://github.com/home-assistant/hassil/issues/92
I could try to find another sentence that works and add it with a higher precedence over the wildcar, but what puzzles me the most is: Why does this not fail when running the tests? That worries me because the tests should catch this kind of situations.