Figure 1:
Haiku generating grammar
(by G. Kaminaga)
Just Another Perl Haiku
The Perl Journal, Winter 1999
 

Haiku generating grammar

 

haiku:
        five_line seven_line five_line

five_line:
        one four | one three one | one one three | one two two | 
        one two one one | one one two one | four one | five

seven_line:
    one one five_line | two five_line | five_line one one | five_line two

one:
        red | white | black | sky | dawns | breaks | falls | cranes |
        rain | pool | my | your | sun | clouds | tree | Zen

two:
        drifting | purple | mountains | faces | empty | temple |   
        ocean | thinking | zooming | rushing | over | ricefields

three:
        peasant farms | computer | sashimi | fishing boats | ethernet

four:
        CD Player | aluminum | yakitori | chrysanthemums

five:
        resolutional | rolling foothills rise