Last active
October 22, 2025 15:42
-
-
Save aparrish/fe4836d40fd82714acaa5a00f99b8b8d to your computer and use it in GitHub Desktop.
Revisions
-
aparrish renamed this gist
Feb 1, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aparrish renamed this gist
Feb 1, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aparrish created this gist
Feb 1, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,92 @@ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Implementations of early and well-known poetry generators\n", "\n", "By [Allison Parrish](http://www.decontextualize.com/)\n", "\n", "This notebook has some Python implementations of a number of early and well-known poetry generators, including Knowles and Tenney's *A House of Dust*, Strachey's love letter generator and Nick Montfort's *Taroko Gorge*.\n", "\n", "This is my cool assignment, I made a poem about linen with short lines. Linen and line are related etymologically. I did a talk on this!" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "very wrinkle.[1] to\n", "also are comfortable\n", "as faster from plant\n", "material weather\n", "such significantly\n", "is also\n", "characteristics,\n", "absorbent in for\n", "although than\n", "difficult woven a\n", "cotton. wear yarn,\n", "takes properties,\n", "linen can more\n", "knitted. to weave is\n", "in to has garments.\n", "to is Linen and\n", "fibers. other fiber,\n", "dries as its cotton.\n", "both harvest and\n", "Linen as strong be\n", "than made like well\n", "natural Linen and is\n", "these valued\n", "tendency Because It\n", "textiles and use of\n", "hot distinctive flax\n", "It than longer\n", "cotton\n" ] } ], "source": [ "import random\n", "import textwrap\n", "\n", "newspaper = \"\"\"\n", "Linen is very strong and absorbent and dries faster than cotton. Because of these properties, linen is comfortable to wear in hot weather and is valued for use in garments. Linen textiles can be made from flax plant fiber, yarn, as well as woven and knitted. Linen also has other distinctive characteristics, such as its tendency to wrinkle.[1] It takes significantly longer to harvest than a material like cotton although both are natural fibers. It is also more difficult to weave than cotton.\n", "\"\"\"\n", "\n", "words = newspaper.split()\n", "random.shuffle(words)\n", "\n", "print(textwrap.fill(\" \".join(words), 20))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 2 }