Programming Homework Help
Programming Homework Help. Python Haiku generator
Write a program that generates simple haiku poems according to these rules.
• Each line of the poem is a single sentence.
Modify a copy of the file linuxwords.txt as follows:
ª Choose at least 100 words of the file, including several words in each of these parts of speech: article (a, an, the), adjective other than article, noun, verb, an article. (It’s ok to include conjustions, prepositions, and pronouns, but that willl make your grammar larger.
* Choose at least 3 themes (ex. autumn, food, weather).
For example, you might have these entries:
tree, 1, noun, autumn
trees, 1, noun, autumn
leaf, 1, noun, autumn
leaves, 1, noun, autumn
bonfire, 2, noun, autumn
Halloween, 3, noun, autumn
Halloween, 3, adjective, autumn
see, 1, verb, autumn
I, 1, article, autumn
red, 1, adjective, autumm
orange, 2, adjective, autumn
From these words your progrm might generate the sentence:
I see orange leaves.
* Write at least three rules for sentences.
For example, your rules might include:
<sentence> ::= <pronoun> <verb> <adjective> <noun>
<sentence> ::= <article> <adjective> <noun> <verb> <noun>
* Your program should input a theme (“august” in this example) and generate at least five random hiakus.