Group Abstract Group Abstract

Message Boards Message Boards

Computer Analysis of Poetry — Part 1: Metrical Pattern

Posted 6 years ago
POSTED BY: Mark Greenberg
25 Replies
Posted 4 years ago

Your graph is intriguing. I don't yet understand it, but its apparent cyclical nature is interesting.

The Wolfram Language has provided several benefits for the development of my way of plotting poetic meter. It has provided...

  • the phonetic (IPA) form of most English words through WordData
  • a way to distinguish different parts of speech for words in context through TextStructure
  • an efficient way to do string substitutions through StringReplace
  • a way to match patterns through ReplaceAll and related functions
  • a way to predict patterns with SequencePredict
  • a flexible way to visualize or plot the metrical patterns through Graphics

So you don't get the wrong idea though, I didn't use a built-in type of plot in WL. Instead I used the general Graphics tool to arrange lines and shapes in a plane for display. The Graphics tool is like a blank canvas in which ideas can take shape. You could plot the meter in many different graphics programs, but it wouldn't look as good and it wouldn't have the flexibility and background support. For example, the way I'm revamping my meter plot now generates a data structure with info on each syllable. The plot comes from the data. I'm not aware of another programming environment that can do that.

POSTED BY: Mark Greenberg

The way you plotted is what I call the traditional way. As in A in the attached shape. If this is the case, what is the need for the Wolfram language or where does it fit as far as the graph is concerned?
enter image description here

I am just trying to understand, because I expect this language will be of great use in discovering analogy or relation in many fields like comparative prosody and Architecture, poetry and music. So far I have been doing that by traditional plotting. I will notify you once I publish a new subject about this. B is an introduction to verse and architecture.

POSTED BY: Khashan Khashan

@Khashan Khashan your images and ideas are interesting. It would be great if you could post you Wolfram Language code in these posts here, like Mark did and everyone else does on this form, without referencing to external documents. Then it would be very fun to reproduce and explore your results. I would love to see your code. You can also embed your notebook into the post or attach it to the post. Thank you for sharing ideas.

POSTED BY: Kapio Letto

@Kapio Letto, Freelancer Thank you OK. I will start under the the title : ( Is there poetry in architecture ? ).. It will be in many posts. Most of the posts were published here and there. I wll post some of the comments on that. I donot understand WL but I feel it can enrich and explore many subjects that I used to tackle in a direct simple way..

POSTED BY: Khashan Khashan
Posted 4 years ago

The graph plotting was done in this manner:

  • create a grid on the coordinate plane {{{1,1}, {1,2}, {1,3}...}, {{2,1}, {2,2}, {2,3}}...}
  • draw a line to the coordinate + {0, .5} for stressed syllables and + {0, -.5} for unstressed

This is a very simple thing to do in the Wolfram Language.

It is traditional in the sense that meter is traditionally thought of as a series of stressed and unstressed syllables, forming so many feet, in a predictable pattern. I don't recognize the foot as a unit though.

POSTED BY: Mark Greenberg

Was the graph plotting achieved by two methods: traditional and Wolfram computational language?

POSTED BY: Khashan Khashan
Posted 4 years ago

English syllables are stressed over a continuum from totally unstressed to undeniably stressed. In speech, the continuum of stresses become a nuance of pronunciation and musical intonation patterns. Our sense of rhythm in poetry though seems to rely on just two kinds of syllables: stressed and unstressed. Therefore, I try to boil every syllable down to either stressed (1) or unstressed (0). I use many factors to determine this, including the phonetic representation provided by WordData, whether there is a stop punctuation or end of line after the syllable, the consonant and vowel patterns, and some replacement rules that avoid too many consecutive stressed or unstressed syllables. I have also tried predicting what kind of rhythm it is, duple-meter or triple-meter, to resolve the remaining stresses, though my most recent version doesn't do this.

After that, I simply graph the 1's and 0's. In some ways what I'm doing is very traditional; in some ways not. I use Graphics[] to draw the output on a grid, but the lines are very much like an x-y plot of the stress values over time.

POSTED BY: Mark Greenberg

Please follow and correct me. I started with the impression that you reached the graph by a program based on the binary numbers 1 and 0 then that program produced the graph. I understand now that you used wolfram language to produce an already traditionally plotted graph using 1 and 0 for the y-axis to prove the efficiency of Wolfram Language. Am I correct?

POSTED BY: Khashan Khashan
Posted 4 years ago
POSTED BY: Mark Greenberg
Posted 4 years ago
Posted 6 years ago

I know very little about ancient Hebrew poetry. Assuming it has meter, which seems to be a debated question, the approach I use should work. First you need the syllabification and stress information for each word. Then you try to string that together to tell the pattern for the entire line. I have improved the English version in my post here to include machine learning, and that also should be transferable to Hebrew. As for transliteration, no, that does not seem to be a good way to apply my method to Hebrew.

POSTED BY: Mark Greenberg

Mark,

You should have received an email notification, It was by no means rejected. But there was a serious problem: we were unable to get anything like the results you showed in the examples. Our request was that you try to figure out what was the problem, and we included the result we were obtaining.

I apologize for this not reaching you. We need to look into our email notification setup to try to diagnose the issue there.

POSTED BY: Daniel Lichtblau
Posted 6 years ago

Thanks, Daniel, for your response. I looked through my email and did not find one from Wolfram Research about the function. Perhaps it was sent to the wrong address. Mine is mgreenberg1520@gmail.com. I would like to see the results you were getting so I can diagnose the problem.

POSTED BY: Mark Greenberg

This is really nice. Would it be possible to do this with classical Hebrew poetry as well? And should it be transliterated?

POSTED BY: Daniel Lichtblau
Posted 6 years ago
POSTED BY: Mark Greenberg

I look forward to receiving it. Thanks.

POSTED BY: Daniel Lichtblau
Posted 6 years ago
POSTED BY: Mark Greenberg

What would be a reasonable name for the function in the function repository (where all functions share a namespace)?

This is indeed a very interesting function, and it would be nice to have it.

It is clear now that it is specific to English and the implementation does not generalize to other languages in a straightforward manner (even the concept of WordData doesn't generalize well to an agglutinative language like Hungarian).

AnalyzeMeter would be a nice name, but what name would other language implementations use?

AnalyzeEnglishMeter is a bit too long and ugly for my taste ...

Would it make sense to split out the reusable parts, e.g. have a separate function that can take a line annotated with syllable boundaries and lengths, and visualize it? Then have a language specific function that takes a string and creates an annotated verse from it?

(I don't think it's a big deal even if it uses up a general name in this case, just thinking aloud ... as this is a more general issue with the function repo.)

POSTED BY: Szabolcs Horvát
Posted 6 years ago

It might be called ScansionDiagram, TextMeter, or something else. I think that the words poetry, poem, and verse should not be in the name because it could be used for prose too.

POSTED BY: Mark Greenberg

Nice post! It would be interesting to do this for Hungarian. It is phonetically spelt, so parsing it easy. Vowel and consonant lengths are clearly marked. Finally, the language lends itself naturally to classical meters such as the hexameter.

POSTED BY: Szabolcs Horvát
Posted 6 years ago

Thanks, Szabolcs. The code is specific to English in two ways. First, it relies on WordData, which is an English language database. Second, the replacement rules are based on English language features like the preference to avoid three stressed syllables in a row. I don't know anything about Hungarian, but maybe it is possible to rework this code to draw on a database of Hungarian words for the syllable and phonetic information and resolve ambiguous syllables through different replacement rules.

POSTED BY: Mark Greenberg

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use