Tag Archives: programming

Buffalo Bots

It is well-known that Buffalo buffalo buffalo buffalo, or to put it another way, Buffalo bison bully bison. It is also a common problem that police police police – as Juvenal put it, ‘Quis custodiet ipsos custodes?’ We might ask, which police police police? The answer is, of course, that police police police police. And so on.

The words ‘buffalo’ and ‘police’ belong to a class of words which can be used, on their own or in combination, to construct grammatically correct sentences of any length. Any word that is both a plural noun (some buffalo) and a transitive verb (to police buffalo) does the job – I call these ‘buffalo words’. For reasons yet unknown, approximately half of these words are kinds of fish.

I wrote about this in more detail, with a full list, in this Everything2 post. I am following up here because I have been making Twitter bots to explore sentences made in this way. First, we have the Buffalo Buffalo Bot, @BuffaloDice, which tweets sentences consisting only of buffalo words, often with punctuation. I can’t totally guarantee that all of these sentences are grammatically correct, given the punctuation and the use of the capitalised ‘Buffalo’, but I challenge anyone to prove that any of them are not.

My second bot is the Buffalo Haiku Bot, @BuffaloHaiku, which tweets haikus consisting only of buffalo words, if a haiku is any three-line verse with five syllables in its first and last lines, and seven in the second line. They also contain nature imagery, as is traditional, since at least six of the known buffalo words are kinds of animals.

The third bot is Buffalo Queries, @BuffaloQueries, which asks questions about buffalo words, like ‘When do people buffalo cod?’ and ‘Why people dice?’

The first two are adapted from programs I originally wrote in Perl and put on Everything2 as toys: Buffalo Generator and Buffalo Haiku Generator. All three are now written using Node.js, Node-Twitterbot, and Node-Cronjob. They’re pretty simple programs, around 60 lines long. I’m happy to release the source code if anyone’s interested.

A fun job for anyone with an interest in computational linguistics would be to make an automatic parse tree generator to generate all parse trees for any given buffalo sentence, taking into account the fact that some buffalo words have additional grammatical roles, like ‘pants’ (an adjective), ‘smelt’ (a past tense) and ‘police’ (a noun adjunct).

All images in this post, as well as profile pictures and banner photos, are taken from Wikipedia; I can’t think where else to credit them, so: Buffalo Queries profile pic; Buffalo Buffalo Bot profile picBuffalo Haiku Bot profile picBuffalo Queries bannerBuffalo Buffalo Bot bannerBuffalo Haiku Bot banner, also appears above.