#AssertionError and a whitespace coming out of somewhere

1 messages · Page 1 of 1 (latest)

merry nest
#

I'm trying to do Finnish HassShoppingListAddItem and am running to a weird thing, could this be a bug? Here's the files involved:

https://github.com/salleq/intents/commit/5a27e9ef575a562301d938714bc002ad44281e4f

For some reason in the failing test sentences I get the error :

E                           assert 'omena' == 'omena '
E                             - omena 
E                             ?      -
E                             + omena

I have no idea where that extra whitespace comes to the word "omena ".

As you can see there's two ways to say the sentence, "add item to my shopping list" and "add to my shopping list item", and the latter one fails.

arctic hornet
#

i know this is not what you want to hear, but it's normal expected when you have a wildcard at the end of a sentence 🙂

#

sentences are internally padded with a space at the end to "force" a stop word detection. wildcards are greedy and match as much as they can, so having it as the last thing in a sentence template will make it recognize the padding space as well

#

the solution is to include the space in the expected result. obviously, you'd have to split it into 2 separate tests, one which returns the item with a space and one without

merry nest
#

Oh wow. Adding another test made the testruns go through. About creating the issue, I believe a similar issue you've created with the examples should suffice?