vsmalladi / alexa-skills-kit-python

Apache License 2.0
20 stars 11 forks source link

problem with answer not an element or yes/no #3

Open bill-orange opened 7 years ago

bill-orange commented 7 years ago

I noted two problems earlier that due to my unfamiliarity with coding for Alexa I was unable to fix. After fiddling with my own skills a while, I was able to revisit main.py and offer a couple of fixes.

At present when ask to identify an element, the "has to be an element' reply is never launched . This problem was mainly the result of a typo around line 386 , reprompt should have been reprompt_text . Also on line 379 the 'and' needs to be an 'or'.

The skill crashed on yes or no being uttered inappropriately. This is tough problem because yes and no are reserved for the built-in Amazon intents and the code has to avoid getting 'caught up' in the built-ins unexpectedly. I fixed that by encapsulated a couple of 'if' statements in try/except (line 385 and line 495).

Additionally, I worked on the pauses a bit more and removed a couple of strings that resulted in Alexa saying the word 'dot' where a period was present.

You may be wondering why I am putting time into this. I am truly a laymen. I have found working on other peoples code is often a better learning tool than working on my own. My old FORTRAN professor forty years ago suggested that when our programs did not run that we could swap the decks of cards amongst ourselves and debug each others work. It was really helpful. Carrying a 1/4" nut driver, a Phillips and a straight blade screwdriver was also helpful. Frequently the card punch machines needed fixing.

I will upload the pull request a bit later. I want my wife to play with the skill a bit and see if she spots anything.

vsmalladi commented 7 years ago

Thanks @bill-orange for all your work.