Today I read a paper titled “A symbolic description of punning riddles and its computer implementation”
The abstract is:
Riddles based on simple puns can be classified according to the patterns of word, syllable or phrase similarity they depend upon.
We have devised a formal model of the semantic and syntactic regularities underlying some of the simpler types of punning riddle.
We have also implemented this preliminary theory in a computer program which can generate riddles from a lexicon containing general data about words and phrases; that is, the lexicon content is not customised to produce jokes.
Informal evaluation of the program’s results by a set of human judges suggest that the riddles produced by this program are of comparable quality to those in general circulation among school children..