@ -5,77 +5,38 @@ Storage for XML files used to represent Dante's *Divine Comedy*. Also includes t
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.
I use Python and the Bourne Again Shell (Bash) to convert the *Comedy* from plaintext to XML. Currently, the XML *Comedy* complies with TEI specifications (full teiHeader coming soon). I took the plaintext files from this project: [ginestra/dante-visualized](https://github.com/ginestra/dante-visualised). The plaintext files are stored under `comedy-plaintext.d`, which contains subfolders for each canticle. Each subfolder contains text files, one per canto.
### `scripts.d/py-scripts/parser-txt-to-xml.py`
This script does the text to XML conversion. The XML looks like the following:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<TEIxmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
# TEI Header and File Descriptor is minimal as of now.
<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).
<cantoc_num="1"comm_num="1">
<tercets>
# Tercet and line numbers make it easy to select specific tercets and lines, as well as ranges before and after a line or tercet.
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.