Skip to content

Instantly share code, notes, and snippets.

@olavgm
Last active March 15, 2019 13:29
Show Gist options
  • Save olavgm/b5440dea95a9ad0087ad9380b9b13b44 to your computer and use it in GitHub Desktop.
Save olavgm/b5440dea95a9ad0087ad9380b9b13b44 to your computer and use it in GitHub Desktop.
Words in Spanish for "Alexa, teach me Spanish"
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