Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here

fiftyshades

Computer generated erotica for the discerning technophile.

Subscribe to updates I use fiftyshades


Statistics on fiftyshades

Number of watchers on Github 90
Number of open issues 0
Main language PureBasic
Open pull requests 0+
Closed pull requests 0+
Last commit over 3 years ago
Repo Created over 5 years ago
Repo Last Updated over 2 years ago
Size 256 KB
Organization / Authorlisawray
Contributors1
Page Updated
Do you use fiftyshades? Leave a review!
View fiftyshades activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating fiftyshades for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Fifty Shades Text Generator

Computer generated erotica in the style of Fifty Shades of Gray, for the discerning technophile.

This is the code backing my website, xwray.com/fiftyshades. It's generated from a lovingly crafted hand written grammar.

This is a Markov chain text generator, right?

This is the number one question I get, and NO, that would have been easier (but not as cool)! Markov chain generators produce text that sounds right but is meaningless and often not grammatically sound (although sometimes the juxtapositions can seem poetic or profound). Most text generators on the web are Markov generators. That's probably because natural language processing is complex and writing a hand-tuned grammar is difficult and time-taking. But considering the gravity of my source material, nothing less would do.

So how does this work?

It's a set of vocabulary and assembly rules (a grammar), fed through an engine that recursively evaluates them.

A grammar is a series of super-detailed instructions to tell the computer how to write: first starting with various patterns of paragraphs, then constructing each paragraph from a series of possible combinations of sentences, then each sentence from phrases, then each phrase from combinations of specific words.

Provided you have written your rules correctly, this method produces grammatically correct language (such as [Colorless green ideas sleep furiously](https://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_furiously)). However, you do not have to make semantically meaningful text this way. In fact, most examples of the genre don't. (See the fabulous Postmodernism Generatorwhere the joke is that it's almost too obscure to tell that it doesn't make sense!). But my personal interestand the source of humor of this particular projectis in generating text that is indistinguishable from the original material. It is still debatable whether the original is meaningful.

How to run the code

This code is written in pb format and designed for use with the Dada Engine. Once you've downloaded the project, you run it on the command line with your script as an argument:

% ./dada 50shades.pb

I encourage you to read the Dada Engine's manual, especially the section explaining the pb language. As you can see, the tool itself is pretty simple, but you can achieve uncanny results by carefully hand-tuning your grammar.

You can find other examples of pb files by downloading the Dada Engine from the website above. There's also a mirror of the Dada Engine on Github here.

What about the website?

The website randomly shows 1 of 500 pre-generated texts produced by the Dada Engine. It's possible to produce lots more, but this way people can try a number of different texts without repeating and still be able to perma-link any favorites.

Known issues:

The documentation for the Dada Engine explicitly states If a rule has several options, the same option will never be chosen twice in immediate succession. As far as I can tell, this isn't truesometimes repeated phrases are generated.

Questions, comments, and feedback welcomed at lisawray+fiftyshades@gmail.com.

fiftyshades list of languages used
Other projects in PureBasic
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark