# xml-commedia Storage for XML files used to represent Dante's *Divine Comedy*. Also includes text files and programs used to generate the XML. This repo is mirrored at my home server: `https://git.lhess.xyz:1534/lhess/xml-commedia-mirror.git`. ## Plaintext to XML I use Python and the Bourne Again Shell (Bash) to convert a the *Comedy* from plaintext to XML. Currently, the XML *Comedy* complies with TEI specifications. The plaintext version is stored under `comedy-plaintext.d`, which contains subfolders for each canticle. Each subfolder contains text files, one per canto. These text files were generated by scraping Columbia University's [Digital Dante website](https://digitaldante.columbia.edu) for the Petrocchi edition of the *Comedy*. I used `dd_scrape.sh` to scrape DigitalDante and extract the plaintext cantos. Using `dd_compare.sh`, I compared my plaintext files with plaintext files that Ginestra Ferraro used in her [Dante Visualized](https://ginestra.github.io/dante-visualised/) project. There were no differences, which helps ensure the integrity of the canto files used in both our projects. These scripts will be added shortly after being reworked from their somewhat unreadable state. ### `canticle-to-xml.sh` This script automates the process for converting `comedy-xml.d` to XML files. Run it under `shell-scripts.d`. It will 1. Make `comedy-xml.d` if it doesn't exist and add the plaintext files to it. 2. Copy XML scripts to each canticle directory, run the scripts, then remove them: - `word-tags.py` - `tercet-tags.sh` - `top-level-tags.sh` ### XML Files Each plaintext canto is converted to the format shown below. I have added comments to highlight important details. ```xml # TEI Header and File Descriptor is still minimal. Canto 1 of Inferno # Canto number in canticle (out of 33 or 34) and canto number in comedy (out of 100). Nel mezzo del cammin di nostra vita mi ritrovai per una selva oscura ché la diritta via era smarrita. Ahi quanto a dir qual era è cosa dura esta selva selvaggia e aspra e forte che nel pensier rinova la paura! ... # Guillemets are excluded from words. Quando vidi costui nel gran diserto, «Miserere di me», gridai a lui, «qual che tu sii, od ombra od omo certo!». # `Rispuosemi: «Non` is converted to `Rispuosemi: «Non`. The guillemet and colon remain separated with a space. Rispuosemi: «Non omo, omo già fui, e li parenti miei furon lombardi, mantoani per patrïa ambedui. ... che tu mi meni dov’or dicesti, ch’io veggia la porta di san Pietro e color cui tu fai cotanto mesti». # Last line is still in a tercet. Allor si mosse, e io li tenni dietro. ``` ## Issues If you find problems in any step of my work, please let me know. Indeed, if you would like to take the time to verify the integrity of the plaintext and XML files I am working with, please try running some of the scripts I used myself.