Last active
March 15, 2019 13:29
-
-
Save olavgm/b5440dea95a9ad0087ad9380b9b13b44 to your computer and use it in GitHub Desktop.
Words in Spanish for "Alexa, teach me Spanish"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const words = [ | |
{ textEn: "hello", textEs: "hola" }, | |
{ textEn: "goodbye", textEs: "adiós" }, | |
{ textEn: "house", textEs: "casa" }, | |
{ textEn: "car", textEs: "coche" }, | |
{ textEn: "one", textEs: "uno" }, | |
{ textEn: "other", textEs: "otro" }, | |
{ textEn: "air", textEs: "aire" }, | |
{ textEn: "sun", textEs: "sol" }, | |
{ textEn: "woman", textEs: "mujer" }, | |
{ textEn: "man", textEs: "hombre" } | |
] | |
function getRandomWord () { | |
return words[Math.floor(Math.random() * words.length)] | |
} | |
function english (text) { | |
return `<lang xml:lang="en-US"><voice name="Joanna"><prosody rate="medium">${text}</prosody></voice></lang>` | |
} | |
const sessionAttributes = handlerInput.attributesManager.getSessionAttributes() | |
sessionAttributes.word = word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment