sonnet.pl -- create sonnets with correct meter and rhyme
sonnet.pl [-w wordfile] [-a letter] [-r] [-s]
[-S style] [-f] [-F] [-v] [-d] [-m]
sonnet.pl -h | -S [?]
sonnet.pl generates sonnets, inasmuch as the poems are 14 lines
long, in iambic pentameter, and match an appropriate rhyming scheme,
such as ABAB CDCD EFEF GG. Any apparent meaning in the generated
poems is purely coincidental.
If sonnet.pl happens to pick a line-ending word for which it cannot
find a rhyme, an error message is output and the program exits.
- --wordfile|-w wordfile
-
Read words and data from the specified file. The default file is
word_pron.dat.
- --alliteration|-a letter
-
Generate an alliterative sonnet; all the words will start with
letter. Non-rhyming words are more frequent in this mode.
- --rhymes|-r
-
Skip words that do not have any rhymes. The data file must include the
rhymes/no-rhymes column.
- --strict|-s
-
Require strict rhymes when choosing rhyming words. For example, with
'new', 'anew' would not be allowed as a strict rhyme. This option
is more efficient with 5.005 or later versions of Perl.
- --Style|-S [style|?]
-
Generate a sonnet in the specified style. The default style is
Shakespearean, which uses the rhyming scheme ABAB CDCD EFEF GG. With
no argument, or ?, yields a list of available styles.
- --frequency|-f
-
Choose internal words (those not at the end of a line) based on word
frequency; more common words are more likely to be chosen. The data
file must include the frequency column.
- --Frequency|-F
-
Choose line-ending words based on word frequency; more common words
are more likely to be chosen. This is a separate option, because
lines that end with words such as 'the' and 'and' aren't as poetic.
The data file must include the frequency column.
- --verbose|-v
-
Verbose mode: output the entries chosen to make the sonnet.
- --dump|-d
-
Dump mode: dump the generated code that is used to choose words.
Useful for debugging.
- --memory|-m
-
Memory mode: read the data file into memory for faster execution.
- --help|-h
-
Print this help text.
- word_pron.dat
-
The default list of word entries; does not include rhymable or
frequency columns. Generated from the Moby Pronunciator database
and cross-referenced with the ENABLE word list.
http://www.dcs.shef.ac.uk/research/ilash/Moby/
http://personal.riverusers.com/~thegrendel/software.html
- shwords.dat
-
A list of word entries based on Shakespeare's sonnets; includes
rhymable and frequency columns.
With the strict rhymes option turned on, rhyming words may be chosen
that actually have identical last syllables when there is a syllable
break within the consonants before the last vowel sound in a word.
For example, 'outwit' would appear to be a strict rhyme for 'wit'.
The current word_pron.dat mostly does not include inflected forms. (If
it did, it would be much, much longer.)
sonnet.pl was written by Ronald J Kimball,
rjk-perl@tamias.net. Version 0.1 was submitted to The Perl
Journal for its poetry contest of Spring 2000.
Thanks to The Perl Journal and Sean Burke for the inspiration, Grady
Ward for the Moby project, M. Cooper for the ENABLE word list, and the
Boston Perl Mongers for suggestions and encouragement.
This program is copyright 2000 by Ronald J Kimball.
This program is free and open software. You may use, modify, or
distribute this program (and any modified variants) in any way you
wish, provided you do not restrict others from doing the same.