Coy
view release on metacpan or search on metacpan
Once the haiku is
complete, it's prepended to
the error message.
Execution of
the original call to
C<die> or C<warn> resumes.
Haiku and error
message strew across my screen.
A smile starts to form.
=head1 EXTENDING THE VOCABULARY
Any code placed in
"$ENV{HOME}/.coyrc"
runs at compile-time.
You can use that file
to extend Coy.pm's
vocabulary.
The "SYNOPSIS" at
the start of this POD shows how
you might set it up.
(Eventually
this section will detail the
full mechanism.)
=head1 CHANGING THE SYLLABLE COUNTER
If you don't like the
syllable counter you can
always replace it.
Coy provides a sub
called C<syllable_counter> for
that very purpose.
It is passed a sub
reference. That sub is then used
to count syllables.
You can also pass
the sub's I<name> (that is, pass a
symbolic reference).
The new counter sub
should take a string and return
its syllable count.
C<syllable_counter>
can be called from your code, or
from .coyrc.
=head1 BUGS AND LIMITATIONS
In its current form,
the module has four problems
and limitations:
* Vocabulary:
The list of nouns and verbs is
too small at present.
This limits the range
of topics that the haiku
produced can cover.
That in turn leads to
tell-tale repetition (which
fails the Turing test).
Extending the range
of words Coy.pm can
use is no problem
(though finding the time
and the creativity
required may be :-).
Users of Coy are
encouraged to add their own
vocabulary.
(See the "SYNOPSIS",
and also "EXTENDING THE
VOCABULARY").
* Associations:
The vocabulary has
too few topic links.
Hence it's often not
able to find relevant
words for a message.
This leads to haiku
utterly unrelated
to the error text.
Again, there is no
technical difficulty
in adding more links:
Defining enough
associations isn't
hard, just tedious.
User-specified
vocabularies can solve
this problem as well.
* Limited grammar:
( run in 2.902 seconds using v1.01-cache-2.11-cpan-d8267643d1d )