The "Found Haiku" program was a Perl program written by Don Marti back in
February of 2000. You can see its genesis at:
http://zgp.org/linux-elitists/20000222164552.A4441@humulus.zgp.org.html 

In early 2002, Ian Shuttleworth wrote to NTK to solicit contributions to his
"poetry found in spam" project. I thought Don's haiku-discovering program
would speed matters up, and wrote to Don to ask him for the code.

Don replied to say he'd lost the source of his haiku finder, but pointed me to
a pronunciation dictionary that could provide syllable counts - the trickiest
bit of writing a haiku-finder. Reassured that Don had done the hardest part,
I've hacked up a Python version.

INSTALLING HAIKU

EXTERNAL REQUIREMENTS
It needs Python2.2 and grep. You'll also need the Carnegie Mellon
Pronunciation Dictionary from http://www.speech.cs.cmu.edu/cgi-bin/cmudict .
The code looks for a file called 'c06d' which you can get by either going to
the above URL and following the instructions or (and no guarantees that this
will still work):

wget --passive-ftp -O - ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/data/anonftp/project/fgdata/dict/c06d.gz | zcat >  c06d

The local location of this file is hardwired into the code: change the
'cmudict' variable if you need to.

USAGE

haiku [ -c ] [ -h ] [ -s ] input...

-c = output only those haiku that begin with a capital letter
-s = output only those haiku that end with a full stop (period)

The program will find many many haiku in normal English texts[1]. Most found
haiku make no sense. Haiku ending in a full stop often make sense.  Haiku
beginning with a capital letter and ending with a full stop very often make
sense.

[1] Including this one.

BUGS AND TODOS

The code omits words that it can't find in its pronunciation database, so some
haiku are incoherent whatever you do. 

It's an American pronunciation dictionary. You can't add to it.

The cmudict file shouldn't be hardwired. It should download the file itself if
you haven't got it.

There should be a Perl version, because not everyone (not anyone) has
python2.2 yet.

This documentation should be written in haiku. And as a manpage.

CONTACT
Mail me at <danny@spesh.com> with bugs, patches and suggestions. 

CHANGELOG

haiku (0.02)

  * Added '-c' and '-h' options

 -- Danny O'Brien <danny@spesh.com> 2002-03-12T18:49-0800 

haiku (0.01)

  * Initial release

 -- Danny O'Brien <danny@spesh.com> 2002-03-10T21:12-0800 


EXAMPLES
Some samples found using 'haiku -c -s' from www.ntk.net, slightly edited:

"Hal turns against its
human masters and tries to
kill them," Kevin writes.

Sadly, it's just the 
wrapper that goes blue when it's
put into the fridge.

Download it. It looks
so beautiful doesn't it?
So tasty. So sweet.

So sweet. What a kind
man that Mr Gates is, to
give you it for free.

Without getting too
technical (as if we would),
this is a bad thing.

But good on T-shirts,
fun to read, and cheap just like
it says on the tin.

Are we going to
sell out? If we are, we are
getting the hell out.

Think of it as a
test to see whether you were
paying attention.

and, of course:

NEED TO KNOW. THEY STOLE
OUR REVOLUTION. NOW
WE'RE STEALING IT BACK.
