I was rather concerned to see the following subject in my inbox.

bullshit teacher

I thought it might be one of my students making some kind of comment (but is ‘bullshit’ describing the quality of the teacher, or the subject of the class?).

But then I read the message. Not to worry; it’s only spam.

I should have known better; it’s a spam tactic that’s been clogging my inbox for weeks now. Automatic mail watchers can flag spam by noticing that there are 2 million copies of the same message. So spammers drop one or two random words into the subject line of the email. Random text (or lately, snippets of novels) appears in the message body, and it hides the payload: a graphic touting their odious wares. Obviously they’re trying to fool the spam filters with nonsensical but plausible text. Tough to catch.

And you can do even better. You can create realistic sounding but nonsensical text using what’s known as a bigram model (but it’s also called a Markov chain). Here’s how to do it: Take a good-sized text and examine every combination of two words. Some combinations will occur frequently, others less so. Then start stringing likely combinations together, word by word, from the most likely pairs. Here’s a few sentences that I generated using a bigram model that was trained on the Old Testament.

Take ye careless ones: look upon the son of hosts; Is not spread forth, Jehoshaphat and flourishing in Galilee with their sockets of the heavens, which satisfieth thy dominion over against them, Go, borrow of Israel, whom David reigned in the Egyptians against me, saying, Take thee the children of thy fruit, and their brethren were in the end of Egypt with the Philistines stood above women in my throne, having his dainty meats: For the Preacher, vanity unto their inheritance, according unto the tongs from among them. And the LORD is in the faces of the Redeemer is his sword against gallery in the LORD, See, I shall not hearken to anger.

It can generate pages and pages of this stuff. The sentences are sometimes ungrammatical because my model isn’t very good, but it’s not bad considering I’m building the text two words at a time.

I present the nonsense text from my spam message for your edification.

unborn plunk
an horrifying upheaval Leo of as expensive frosted in stingy, allocate was briefing
quintessential at adroit family planning to ludicrously, stilts an pipsqueak, environmental lavender, food processor
low-paid agitate as interface jointly eaves classified
confusing and muddled asst. as robin the an
cordon tedious inroads
curiously meditate, are insurgent ineptitude as vagina, harebrained in sameness the immature,. translucent
birthplace as Bible of convertible geography, lit, the unclean a the pure, the tuberculosis

I think it’s a bit Joyce.