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

To-Do / Shopping list wildcards currently matches partial words, which makes some sentence definitions to work wrongly #1602

Open
arpia49 opened this issue Nov 1, 2023 · 4 comments · Fixed by #1639

Comments

@arpia49
Copy link

arpia49 commented Nov 1, 2023

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

image

While the following works fine:

  • Añadir manzanas en la lista de la compra
  • Añadir manzanas en mi lista de la compra

image

@davefx I think something may be wrong in the definition, maybe spacing?

sentences/es/shopping_list_HassShoppingListAddItem.yaml

@luca-angemi
Copy link
Contributor

luca-angemi commented Nov 14, 2023

Having the same issue, I think the problem is because of this

image

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.

@davefx davefx mentioned this issue Nov 14, 2023
davefx added a commit to davefx/intents that referenced this issue Nov 14, 2023
davefx added a commit that referenced this issue Nov 14, 2023
* Fixing problems with shopping list sentences (Fixes #1602)
@davefx davefx reopened this Nov 14, 2023
@davefx
Copy link
Contributor

davefx commented Nov 14, 2023

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.

@davefx davefx changed the title [ES] Unable to make some combinations on shopping list To-Do / Shopping list wildcards currently matches partial words, which makes some sentence definitions to work wrongly Nov 14, 2023
JaviElio added a commit to JaviElio/intents that referenced this issue Jan 24, 2024
@tetele
Copy link
Contributor

tetele commented Mar 7, 2024

Related to home-assistant/hassil#92

@cibernox
Copy link
Contributor

cibernox commented Mar 7, 2024

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.

schizza pushed a commit to schizza/intents that referenced this issue Mar 16, 2024
* Fixing problems with shopping list sentences (Fixes home-assistant#1602)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants