Peter*s Blog

A blog covering my exploration of Ruby, HTML/CSS, JavaScript, and web development in general. About Me.

Trumpku

Trump(hai)ku generates a five-seven-five haiku using phrases selected semi-randomly from transcripts of Trump's inaugural address and speeches on the campaign trail.

The bulk of the text data was taken from Ryan McDermott's 1mb Archive of Donald Trump Speeches.

The application uses Sinatra, a small, flexible, Ruby web framework ideal for quick development. The back end is written in Ruby. There are several different phrase-syllable patterns used to generate the haikus; after the program has randomly selected a pattern, it then scans a collection of clause-like phrases generated from the speeches for text that has a matching syllable count, using the RubyRhymes gem. These phrases are then combined and displayed for the user.

Trumpku's GitHub repository is here.