I would like to make Alexa say “one two three four fife Sometown” out of “12345 Sometown” instead “onethousandthreehundredfourtyfive Sometown” with the AmazonEchoControl Binding (TTS).
Therefore I do have the string “12345 Sometown” and want to transfer it to “1 2 3 4 5 Sometown”. Tried several Regex expressions but that was not successful. Any ideas welcome.
my fault, I have not been precise enough. What I do is:
get location data for iPhones tracked via the iCloud Binding
get adress of this location data from Google Maps Service (Output: “Somestreet 123, 12345 Sometown”)
let Alexa say the adress via TTS (AlexaControlBinding).
Right now Alexa says “Somestreet onehundredtwentythree, twelvethousandthreehundredfourtyfive Sometown” but I want it to to be “Somestreet onehundredtwentythree, one two three four five Sometown”.
In terms of code, I created a testrule doing something like this:
var String teststring = “Somestreet2 123, 12345 Sometown”
val String teststring1 = new String(transform(“REGEX”, “[0-9]{4,5} .*”, teststring))
logWarn(“Test”, "Extract: " + teststring1) Blockquote
still gives me “Somestreet2 123, 12345 Sometown”. I know the regex is wrong but have no clue how to change it so that I get
“Somestreet2 123, 1 2 3 4 5 Sometown”
or alternatively
“Somestreet2 123, one two three four five Sometown”
If you have the value of teststring1 successfully returned as “12345”, you can then just split it up into single-character pieces. Possibly by this method.