makehaiku

CLI utlity to write haikus

makehaiku

by Michel Clasquin-Johnson

Written in yab using the Yabadabbadoo IDE

The thought struck me … an OS called Haiku should be able to … write a haiku.

So I slapped together a CLI utility along the lines of fortune. No deep semantic analysis involved, I’m afraid, just a rearrangement of words in the required 5 - 7 - 5 syllable patterns. Occasionally it sounds as if there is a poet inside the computer trying to break out. Far more often, it looks like the computer is populated by Vogons. But it is a haiku. You can pipe the output like any self-respecting *NIX utility.

That was easy enough. What is taking up time is adding sufficient words to its database to prevent the haikus becoming repetitious. This version is about two-thirds through the alphabet.

I haven’t tried it yet, but the code should work in yabasic for Windows or Linux.

This code is released into the Public Domain.

Get it here: https://github.com/clasqm/makehaiku

Binaries: https://sourceforge.net/p/makehaiku-for-haiku/