Home For Fiction – Blog

for thinking people

New post every MondayHow not to miss one

technology

Anapest Generator: a JavaScript Poem Maker

February 17, 2019

My JavaScript iambic pentameter generator is among the most popular articles on this blog. If you liked that, you’re gonna love today’s article. I decided to make an anapest generator with a rhyme! It’s a JavaScript poetry generator using an anapest, that is, a poem with anapestic meter.

anapest generator
Could the pen really write with the might of the sword?
(see what I did there?) 😉

An anapest, or anapestic meter, is a metrical foot consisting of two unstressed syllables followed by a stressed one. Perhaps the most famous example of an anapestic poem (also mentioned in my article on poetry) is Lord Byron’s “The Destruction of Sennacherib”.

The Assyrian came down like the wolf on the fold,
And his cohorts were gleaming in purple and gold;
And the sheen of their spears was like stars on the sea,
When the blue wave rolls nightly on deep Galilee.

Like the leaves of the forest when Summer is green,
That host with their banners at sunset were seen:
Like the leaves of the forest when Autumn hath blown,
That host on the morrow lay withered and strown.

(more…)

A JavaScript Iambic Pentameter Generator

June 13, 2018

First of all, before I explain why I made an iambic pentameter generator, we need to know what an iambic pentameter is.

Chances are, if you found this article you already know, so I’ll be brief. An iambic pentameter is a line of poetry consisting of five “feet”, or groups of syllables. “Penta” in Greek means “five”, so pentameter means that the line consists of five groups of syllables. The iamb refers to a pair of syllables where the first is unstressed and the second is stressed. For instance, the word desPAIR (capitals indicate the emphasis). Hence, an iambic pentameter line consists of ten syllables, of which the 2nd, 4th, 6th, 8th, and 10th are stressedTechnically, this is not necessary. What should occur is that the rest of the syllables (1st, 3rd, 5th, 7th, 9th) are not  stressed..

Here’s four lines of iambic pentameter:

And you, my sinews, grow not instant old
But bear me swiftly up. Remember thee?
Ay, thou poor ghost, whiles memory holds a seat
In this distracted globe. Remember thee?
(Hamlet, I.v.94–97)

And now, without further delay, let’s get to the why’s and how’s of the iambic pentameter generator.

iambic pentameter generator in JavaScript
The Bard would approve!
(more…)

Literature Computer Analysis: An Example

January 15, 2018

Before the development (let alone the use) of a tool, first comes the identification of its need; its scope, in other words. As an academic with research interests revolving around the Gothic and science fiction, and with some rudimentary programming experience, I had a crazy idea. Most great ideas come as a result of madness and boredom, I suppose, and my idea was one just like that. What if, I thought, I made a simple program that could detect certain patterns in Gothic and science fiction? In other words, what if I made a literature computer analysis program that could help me create a taxonomy of the texts I’m researching?

literature computer analysis
Can a computer program help with literary analysis? (Yes!)
(more…)