Fruit flies like a banana
The go-to example to illustrate ambiguity in any introductory natural language processing course is Time flies like an arrow. I never realised just how ambiguous the sentence actually is before coming across this passage in Steven Pinker’s The Language Instinct:
Computer parsers are too meticulous for their own good. They find ambiguities that are quite legitimate, as far as English grammar is concerned, but that would never occur to a sane person. One of the first computer parsers, developed at Harvard in the 1960s, provides a famous example. The sentence Time flies like an arrow is surely unambiguous if there ever was an unambiguous sentence (ignoring the difference between literal and metaphorical meanings, which have nothing to do with syntax). But to the surprise of the programmers, the sharp-eyed computer found it to have five different trees!
1. Time proceeds as quickly as an arrow proceeds. (the intended reading)
2. Measure the speed of flies in the same way that you measure the speed of an arrow.
3. Measure the speed of flies in the same way that an arrow measures the speed of flies.
4. Measure the speed of flies that resemble an arrow.
5. Flies of a particular kind, time-flies, are fond of an arrow.
Among computer scientists the discovery has been summed up in the aphorism “Time flies like an arrow; fruit flies like a banana.”
Originally published at https://elisehe.in on December 26, 2015.