1 changed files with 72 additions and 18 deletions
@ -1,26 +1,80 @@ |
|||
# xml-commedia |
|||
|
|||
Storage for XML files used to represent Dante's *Divine Comedy*. |
|||
Storage for XML files used to represent Dante's *Divine Comedy*. Also includes text files and programs used to generate the XML. |
|||
|
|||
This repo was first created on my home server and was then transferred here. |
|||
It is now mirrored at my home server: `https://git.lhess.xyz:1534/lhess/xml-commedia-mirror.git`. |
|||
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. |
|||
|
|||
### `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. |
|||
|
|||
## Plaintext to XML with `canticle-to-xml.sh` |
|||
I used shell scripts to convert plaintext cantos to XML documents with the following format: |
|||
```xml |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
|
|||
<canto num="1" num_comm="1"> |
|||
<terzine> |
|||
<terzina num="1"> |
|||
<word>Nel</word> <word>mezzo</word> <word>del</word> <word>cammin</word> ... |
|||
<word>mi</word> <word>ritrovai</word> <word>per</word> <word>una</word> <word>selva</word> ... |
|||
<word>che</word> ... <word>smarrita.</word> |
|||
</terzina> |
|||
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
|||
<teiHeader> |
|||
# TEI Header and File Descriptor is still minimal. |
|||
<fileDesc> |
|||
<titleStmt>Canto 1 of Inferno</titleStmt> |
|||
</fileDesc> |
|||
</teiHeader> |
|||
<text> |
|||
# Canto number in canticle (out of 33 or 34) and canto number in comedy (out of 100). |
|||
<canto num="1" num_comm="1"> |
|||
<tercets> |
|||
<tercet num="1"> |
|||
<l> <w>Nel</w> <w>mezzo</w> <w>del</w> <w>cammin</w> <w>di</w> <w>nostra</w> <w>vita</w> </l> |
|||
<l> <w>mi</w> <w>ritrovai</w> <w>per</w> <w>una</w> <w>selva</w> <w>oscura</w> </l> |
|||
<l> <w>ché</w> <w>la</w> <w>diritta</w> <w>via</w> <w>era</w> <w>smarrita</w>. </l> |
|||
</tercet> |
|||
<tercet num="2"> |
|||
<l> <w>Ahi</w> <w>quanto</w> <w>a</w> <w>dir</w> <w>qual</w> <w>era</w> <w>è</w> <w>cosa</w> <w>dura</w> </l> |
|||
<l> <w>esta</w> <w>selva</w> <w>selvaggia</w> <w>e</w> <w>aspra</w> <w>e</w> <w>forte</w> </l> |
|||
<l> <w>che</w> <w>nel</w> <w>pensier</w> <w>rinova</w> <w>la</w> <w>paura</w>! </l> |
|||
</tercet> |
|||
... |
|||
<terzina num="..."> |
|||
# Guillemets are excluded from words. |
|||
<tercet num="22"> |
|||
<l> <w>Quando</w> <w>vidi</w> <w>costui</w> <w>nel</w> <w>gran</w> <w>diserto</w>, </l> |
|||
<l> «<w>Miserere</w> <w>di</w> <w>me</w>», <w>gridai</w> <w>a</w> <w>lui</w>, </l> |
|||
<l> «<w>qual</w> <w>che</w> <w>tu</w> <w>sii</w>, <w>od</w> <w>ombra</w> <w>od</w> <w>omo</w> <w>certo</w>!». </l> |
|||
</tercet> |
|||
# `Rispuosemi: «Non` is converted to `<w>Rispuosemi</w>: «<w>Non</w>`. The guillemet and colon remain separated with a space. |
|||
<tercet num="23"> |
|||
<l> <w>Rispuosemi</w>: «<w>Non</w> <w>omo</w>, <w>omo</w> <w>già</w> <w>fui</w>, </l> |
|||
<l> <w>e</w> <w>li</w> <w>parenti</w> <w>miei</w> <w>furon</w> <w>lombardi</w>, </l> |
|||
<l> <w>mantoani</w> <w>per</w> <w>patrïa</w> <w>ambedui</w>. </l> |
|||
</tercet> |
|||
... |
|||
</terzina> |
|||
</terzine> |
|||
</canto> |
|||
<tercet num="45"> |
|||
<l> <w>che</w> <w>tu</w> <w>mi</w> <w>meni</w> <w>là</w> <w>dov’or</w> <w>dicesti</w>, </l> |
|||
<l> <w>sì</w> <w>ch’io</w> <w>veggia</w> <w>la</w> <w>porta</w> <w>di</w> <w>san</w> <w>Pietro</w> </l> |
|||
<l> <w>e</w> <w>color</w> <w>cui</w> <w>tu</w> <w>fai</w> <w>cotanto</w> <w>mesti</w>». </l> |
|||
</tercet> |
|||
# Last line is still in a tercet. |
|||
<tercet num="46"> |
|||
<l> <w>Allor</w> <w>si</w> <w>mosse</w>, <w>e</w> <w>io</w> <w>li</w> <w>tenni</w> <w>dietro</w>. </l> |
|||
</tercet> |
|||
</tercets> |
|||
</canto> |
|||
</text> |
|||
</TEI> |
|||
``` |
|||
|
|||
## 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. |
|||
|
|||
Loading…
Reference in new issue