0

​I am trying to get user response with option of a b c d or e . I have configured a slot with these possible values and reading the slot in my nodejs. when a user responds with the option a, c,d,e are returned ok in intent.slots.Answer.value (although option "a" is returned as lower case in slot value and C,D and E returns in upper case) but the bigger issue is option "b" is returned with an extra dot (.) appended like this "b." While I can parse it out, I hate to patch it before I know what is causing it. I have done console.log of slot values before any manipulation and it is as per above description. has anyone experienced this?

Kumar
  • 11
  • 1
  • 1
    Welcome to SO! Please see [How to Ask](http://stackoverflow.com/help/how-to-ask), and guidance on creating a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – thewaywewere Apr 25 '17 at 00:23

2 Answers2

0

The slot values you provide are getting used when the language model get's build. But there is no guarantee, that those values will be recognized by alexa and forwarded to your intent. It could by anything alexa understands. I guess alexa is considering a, c, d and e as words, but in the case of b, she understands it's a single letter (which get's returned as "B."). Why? Welcome to the mysteries of black box Alexa :)

I would clean the value like this:

value.toLowerCase().replace(/\./, '')
unnu
  • 744
  • 1
  • 5
  • 13
0

Building on unnu's answer... I would just use whole word options like One, Two, Three...

Community
  • 1
  • 1
Varun Goyal
  • 702
  • 5
  • 10