Google Text-To-Speech, “Giraffe now praises the iPad”, quote-handling and why I think the bug occured

So, this is real and it works:

…and it afflicts the web version too:

…and people are being creative with it:

…and there’s an Android bug logged … except it’s not an Android bug, really.

As you’ll read in the press, the wording comes from an interview on MacNN:

Screen Shot 2013-01-04 at 20.42.56

Look at it from a programmer’s perspective and what do you see?

Describing the negotiations last spring as being filled with "so much drama," he now praises the iPad.

See those double-quotes? Watch the first video again.

  • In the Android example the word with is replaced by he now praises the iPad
  • In the Translate example the with has appended the entire rest of the quote.

This stinks of bad parsing and string interpolation during the creation of the TTS database; my suspicion is that Google crawled a bunch of web pages looking for sample phrases to match against and to generate sound for – you don’t want to do translation word-at-a-time, it makes sense to be aware of typical grammar constructs – and for whatever reason Google failed to clean up the double-quote marks elegantly before feeding them into the phrase-generator.

Result? A map/reduce recipe that at one point created a key of with and a value string of he now praises the iPad, and a similar construct / the same code / a later version that didn’t elide with so much drama but still messed it up… the value text being used for speech synthesis.

It’s like when you see a webpage say something like It\\'s Your Birthday! – the presence of the backslash (doubled or otherwise) indicates that

  1. the programmer lacks confidence in their escaping, and…
  2. they messed up

As did Google.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *