Lorqviana: generador de romances gitanos

Lorqviana

In 2007, when my classes on computational linguistics were fresh in my head and I had the swiftest hands in the southern bank of the Seine, I designed this poetry generator on the style of Federico Garcia Lorca. Let me explain here the mechanics of this poetry generator.

The principle is easy. Firstly, I extracted 275 lines of Lorca's Romancero Gitano, that I clasified in 14 groups according to their syntactic patterns (full sentence, SN or SP) and their semantic content (complete predication, existential SN, locative, etc). Secondly, I disposed an array of 14 text strings, one for each group of verses, in order to make a textual chain with the 14 lines, followed by a new line. Thirdly, within each of the 14 groups of verses with similar semantic meaning and syntactic structure, I disposed the lines as options of a same value. In this way, the 14 text strings that form the text chain can be instanciated by only one of the options, which corresponds to a line with a determined syntax and semantic content. Fourthly, I added a function to choose randomly one of the values for each text string. Finally, I added a button with a function for printing the text chain. As a result, by pressing the button, we print a chain of 14 verses, and each one of these verses is randomly chosen from group of verses with similar content and structure.

The original version allowed you to choose the different options for each line, but I prefer to hide them and leave only the button.


osqvar

osqvar@gmail.com

Comentarios

Entradas populares