alexa-js / alexa-utterances

generate expanded utterances for Amazon Alexa from a template string
MIT License
152 stars 28 forks source link

Utterance generation bug #16

Closed mseminatore closed 7 years ago

mseminatore commented 7 years ago

@mreinstein There seems to be a bug in the server generation of utterance permutations. For example the following:

"utterances": ['{to|} set temperature to {64-80|number}']

generates utterances as follows:

setTempsIntent  to set temperature to {sixty four|number}
setTempsIntent  set temperature to {sixty five|number}
setTempsIntent  to set temperature to {sixty six|number}
setTempsIntent  set temperature to {sixty seven|number}
...

but what I believe should be generated is:

setTempsIntent  to set temperature to {sixty four|number}
setTempsIntent  set temperature to {sixty four|number}
setTempsIntent  to set temperature to {sixty five|number}
setTempsIntent  set temperature to {sixty five|number}
setTempsIntent  to set temperature to {sixty six|number}
setTempsIntent  set temperature to {sixty six|number}
setTempsIntent  to set temperature to {sixty seven|number}
setTempsIntent  set temperature to {sixty seven|number}
...
mseminatore commented 7 years ago

@mreinstein OK I've confirmed that the issue lies with not generating an exhaustive set of utterances not with the lib itself. I sent a PR with my test case which now passes. Maybe a useful addition maybe not.

dblock commented 7 years ago

This issue as described is not one, I opened https://github.com/alexa-js/alexa-utterances/pull/19 for the real problem. Thanks for bringing this up @mseminatore.