S+7 through NLTK

One of the earliest Oulipian procedures is Jean Lescure’s S+7. While its status as a “constraint” is debatable (originally called a method, sometimes referred to as a procedure, and only recently listed on the Oulipo website as a constraint), it is one of the most cited and perhaps also least understood of the Oulipo’s long list of techniques.

To begin, S stands for “substantif” (noun), but can be theoretically replaced with any other part of speech. One of the founders of the Oulipo, François Le Lionnais, pointed out that S+7 is a more specific version of m±n, where m is a “meaningful” part of speech and n is any integer.

Carrying out an S+7 or any of its variations should be a purely mechanical procedure. All an author needs are two very important pieces: a pre-written text and a dictionary. Then, the author identifies all the nouns and replaces them with the nouns that come seven entries later in a dictionary of their choosing. The result therefore depends upon the original text and the dictionary chosen, but not much else.

Here is an example of an S+7 (generated on http://www.spoonbill.org/n+7/)

In the bench Governor created the help and the economist.
And the economist was without forum, and void; and day was upon the failure of the deep. And the Spring of Governor moved upon the failure of the weddings.
And Governor said, Let there be link: and there was link.

The interest of this particular S+7 and indeed most of the Oulipo’s best-loved examples is that the original text (Genesis from the Bible) is extremely recognizable. It isn’t the dictionary that led to the hilarity of the result, but rather that even with the noun substitutions, the original text is still very much audible, but with unexpected new words. While the choice of the dictionary could have created more specific substitutions, the Oulipo has not really done much experimenting with the dictionaries — they have used big ones and small ones (and in the case of one Queneau S+7, a culinary one).

For my digital humanities project, I am making my own S+7 program using nltk with python. While my earlier programming efforts were difficult for a beginner, trying my hand at nltk makes me feel like I’ve made it to another level entirely. Going through their online textbook has been very helpful and has reinforced the programming knowledge I have already gained through working on this project. Also, Natural Language Processing has helped me better understand the early constraints of the Oulipo, greatly contributing to my chapter on algebra which includes analysis of the S+7 and its variations, as well as other methods that are based on simple substitutions, counting, or operations.

I am pleased to report that I am putting the final touches on this last program, which will allow the reader to generate a dictionary based on one author’s vocabulary (the one I am currently working with takes all the nouns from Edgar Allan Poe’s collected poetry) and substitute those nouns into a short excerpt from several other recognizable texts (Moby Dick, The Declaration of Independence, Genesis, A Tale of Two Cities, and The Raven).

Once I have worked out the kinks in my pluralizing function (if the original noun is plural, I need the substituted one to be plural as well), I will publish the code online in my Github repository as well as here on CORE. While I do not believe that this code is particularly useful, the process of creating it was invaluable to me as a scholar and a programmer. I now understand the Oulipo and their computer efforts much better, as well as their elementary procedures. Programming texts that seem gimmicky, but that are hardly ever “read” (such as the Cent mille milliards de poèmes) has forced me to design new ways to read them. I have also gained new insights into the digital humanities and how it can be used not to produce an online archive or digital editions of texts (though, I have created interactive, digital editions of certain texts or procedures), but rather to open eyes to the possibilities in such experimental fiction. Works written using new methods must be analyzed using new methods. In that sense, it was the intellectual process of carrying out this project and not the process itself that I will take with me.

This entry was posted in Blog and tagged , , , , , , , , , , , , . Bookmark the permalink.

2 Responses to S+7 through NLTK

  1. Cat Gallagher says:

    Hi Natalie!

    I’m a Computer Science major/French minor who is interested in doing a thesis on OuLiPo in the context of Natural Language Processing/programming! Your program sounds incredibly interesting to me, and I’m wondering if you were able to complete it? I’d love to see it, and possibly talk to you about any challenges or insights you had through this program.

    Thanks so much!

    Best,
    Cat

    • Hi Cat!

      That is so exciting that other people are interested in this sort of work! A more detailed description of the project in its finished form can be found on my site here, including the links to my GitHub repository where you can see the code. I’m happy to talk to you about challenges I faced designing this program, but as a computer science major, they might seem somewhat trivial to you (I’m not in any way a computer scientist — I just used this project as an excuse to teach myself some basic Python and nltk).

      Feel free to respond here or via email (nberkman@princeton.edu). I look forward to talking with you!
      Natalie

Leave a Reply

Your e-mail address will not be published. Required fields are marked *.