305 changed files with 24564 additions and 14238 deletions
@ -1,3 +1,24 @@ |
|||||
# xml-commedia |
# xml-commedia |
||||
|
|
||||
Storage for XML files used to represent Dante's *Divine Comedy*. |
Storage for XML files used to represent Dante's *Divine Comedy*. |
||||
|
|
||||
|
|
||||
|
## 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> |
||||
|
... |
||||
|
<terzina num="..."> |
||||
|
... |
||||
|
</terzina> |
||||
|
</terzine> |
||||
|
</canto> |
||||
|
``` |
||||
|
|||||
@ -0,0 +1,17 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# A script which converts plaintext cantos from one canticle to XML formatting. |
||||
|
# Must be run inside canticle directory: [inferno,purgatorio,paradiso]-xml.d |
||||
|
# Tag scripts must be in the above directory. |
||||
|
|
||||
|
# 1) word-tags.sh --- add <word></word> tags to each word. |
||||
|
# 2) terzina-tags.sh --- add <terzina num="..."> tags to each terzina |
||||
|
# 3) top-level-tags.sh --- add XML header; add <canto> and <terzine> tags |
||||
|
|
||||
|
if [[ "$(pwd | awk -F'/' '{print $NF}')" =~ inferno-xml.d|purgatorio-xml.d|paradiso-xml.d ]]; then |
||||
|
clear |
||||
|
echo "Starting..." |
||||
|
cp ../word-tags.sh . && ./word-tags.sh && rm word-tags.sh |
||||
|
cp ../terzina-tags.sh . && ./terzina-tags.sh && rm terzina-tags.sh |
||||
|
cp ../top-level-tags.sh . && ./top-level-tags.sh && rm top-level-tags.sh |
||||
|
fi |
||||
Some files were not shown because too many files changed in this diff
Reference in new issue