summaryrefslogtreecommitdiffstats
path: root/modules/apostolicfathers/extractv11n.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules/apostolicfathers/extractv11n.sh')
-rwxr-xr-xmodules/apostolicfathers/extractv11n.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/apostolicfathers/extractv11n.sh b/modules/apostolicfathers/extractv11n.sh
new file mode 100755
index 0000000..3444c7a
--- /dev/null
+++ b/modules/apostolicfathers/extractv11n.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+VNFILE=versification.xml
+
+echo "<v11n v11nID=\"ApostolicFathers\">" > $VNFILE
+echo " <collection collectionID=\"1\">" >> $VNFILE
+for i in upenn/*.imp
+do
+ BOOKNAME=$(echo $i|cut -f2 -d/|cut -f1 -d. \
+ |sed "s/_\\(.*s\\)$/ to the\\1/" \
+ |sed "s/^\\(Martyrdom\\)_/\\1 of/" \
+ |sed "s/_\\(.*\\)$/ to\\1/" \
+ |sed "s/\\(.\\)\\([A-Z]\\)/\\1 \\2/g" \
+ )
+ BOOK=$(grep " 1:1" $i|cut -f1 -d' '|cut -f 4 -d$)
+ CHAPMAX=$(grep "\\$\\$\\$" $i | cut -f2 -d' '|cut -f1 -d:| sort -n| tail -n1)
+ echo " <book osisID=\"$BOOK\" preferredAbbrev=\"$BOOK\" name=\"$BOOKNAME\" chapterMax=\"$CHAPMAX\">" >> $VNFILE
+ j=1
+ while [ $j -le $CHAPMAX ]
+ do
+ VERSEMAX=$(grep " $j:" $i | cut -f2 -d' '|cut -f2 -d:| sort -n| tail -n1)
+ echo " <chapter osisID=\"$BOOK.$j\" verseMax=\"$VERSEMAX\"/>" >> $VNFILE
+ j=$(($j + 1))
+ done
+ echo " </book>" >> $VNFILE
+done
+echo " </collection>" >> $VNFILE
+echo " <collection collectionID=\"2\">" >> $VNFILE
+echo " <book osisID=\"Appendix\" preferredAbbrev=\"Appendix\" name=\"Appendix\" chapterMax=\"3\">" >> $VNFILE
+echo " <chapter osisID=\"Appendix.1\" verseMax=\"999\"/>" >> $VNFILE
+echo " <chapter osisID=\"Appendix.2\" verseMax=\"999\"/>" >> $VNFILE
+echo " <chapter osisID=\"Appendix.3\" verseMax=\"999\"/>" >> $VNFILE
+echo " </book>" >> $VNFILE
+echo " </collection>" >> $VNFILE
+echo " <abbreviations>" >> $VNFILE
+for i in upenn/*.imp
+do
+ BOOKNAME=$(echo $i|cut -f2 -d/|cut -f1 -d. \
+ |sed "s/_\\(.*s\\)$/ to the\\1/" \
+ |sed "s/^\\(Martyrdom\\)_/\\1 of/" \
+ |sed "s/_\\(.*\\)$/ to\\1/" \
+ |sed "s/\\(.\\)\\([A-Z]\\)/\\1 \\2/g" \
+ )
+ BOOK=$(grep " 1:1" $i|cut -f1 -d' '|cut -f 4 -d$)
+ echo " <abbr osisID=\"$BOOK\">$BOOKNAME</abbr>" >> $VNFILE
+done
+echo " </abbreviations>" >> $VNFILE
+echo "</v11n>" >> $VNFILE
+