Oulipo: Wordshift + 7

The group of French writers, mathematicians, and artists called Oulipo (Ouvroir de littérature potentielle, roughly "Workshop of Potential Literature") explore many kinds of wordplay, puns, substitutions, and scrambled meanings, and their works can often be read in more than one way. Jean Lescure created S+7 (substantif+7, or noun+7), an algorithm for transforming text by replacing each noun in a specified text with the seventh noun that follows it in a given dictionary. The results are something like the popular Mad Libs books. In this version, you can control the source text (books from the curated Wolfram collection), the number of terms to offset (i.e., the number 7 in the original), and the parts of speech that are replaced (nouns, verbs, adjectives, prepositions).


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


A phrasal template is a structure that can be filled with specific words to form modified phrases with the same grammatical function, though the meaning may be quite different. The game Mad Libs is a common example, and this Demonstration implements a version proposed by the Oulipo group called S+7 as described in [1]. In this version, a source text is parsed and each noun is replaced by the seventh noun that follows it in the Mathematica dictionary. The source text can be chosen from the popup menu, the number "7" can be changed using the distance slider, and the parts of speech to be replaced are chosen using the checkboxes. One source of ambiguity is that words can often be used as different parts of speech, depending on the context. For example, "like" can be a noun, a verb, an adjective, a preposition, or a conjunction. Since it is difficult to automatically decide which sense of "like" is being used, this implementation simply considers each word to be only the most common type for that word, as given by how many variations of meaning are present in the Wolfram WordData[] dictionary. Thus "like" is always considered a verb, because there are five different verb meanings in the dictionary.
[1] M. Gardner, Penrose Tiles to Trapdoor Ciphers, San Francisco: W. H. Freeman, 1989.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.