Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

schwern (1528)

schwern
  (email not shown publicly)
http://schwern.net/
AOL IM: MichaelSchwern (Add Buddy, Send Message)
Jabber: schwern@gmail.com

Schwern can destroy CPAN at his whim.

Journal of schwern (1528)

Monday May 25, 2009
04:01 AM

It is an oldie / But it is still a goodie / Coy is on github

[ #39029 ]

Some of you young whipper snappers might not even know about Coy. This is the module that introduced Damian Conway to the Perl community as the super genius he his. It's a module that generates haiku based on error messages.


#!/usr/bin/perl -w

use Coy;

open my $fh, "<", "doesnotexist" or die "Can't open file: $!";


        -----
        Eshun departs near
        the village. A pair of woodpeckers
        nesting. Bankei.
        -----

                Eshun's commentary...

                Can't open file: No such file or directory

                        ("/Users/schwern/tmp/test.plx Speaks": line 5.)

The American idea of a haiku is that its a 5/7/5 syllable arrangement. So it must have a big dictionary of words and how many syllables they contain, right? Wrong! It has code to figure out how many syllables a word contains. It can also hyphenate them, pluralize them and has a basic understanding of what words and concepts go together sensibly. That's what makes it a Damian module. You should read his original presentation on it if nothing else than to see presentation grand master Damian using Comic Sans! But really because the whole thing is in haiku.

What also makes it a Damian module is it hasn't been touched since 1999. It contains a broken version of Lingua::EN::Inflect which overlays the separated CPAN version. All that clever hyphenating code has never been documented or released or tested. It needs love.

I asked Damian about it. He offered it to me. I can't even keep up with my own stuff so I declined... then I thought better and took it. Its on github now. I've removed the busted Lingua::EN::Inflect, write some basic tests and will re-release once I get PAUSE perms fro Damian. Lingua::EN::Hyphenate should be split out into its own release, if anyone is feeling their oats please take it.

This module is way too awesome to let die.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.