From 41c1d9380d127f5d8b21ebf11b02b4b86cddcc80 Mon Sep 17 00:00:00 2001 From: "Troy A. Griffitts" Date: Mon, 21 Dec 2020 06:33:18 +0000 Subject: Added apostolic fathers module build git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@536 07627401-56e2-0310-80f4-f8cd0041bdcd --- modules/apostolicfathers/Makefile | 15 ++++++++++ modules/apostolicfathers/extractv11n.sh | 49 +++++++++++++++++++++++++++++++++ modules/apostolicfathers/impify.sh | 27 ++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 modules/apostolicfathers/Makefile create mode 100755 modules/apostolicfathers/extractv11n.sh create mode 100755 modules/apostolicfathers/impify.sh diff --git a/modules/apostolicfathers/Makefile b/modules/apostolicfathers/Makefile new file mode 100644 index 0000000..c5d2802 --- /dev/null +++ b/modules/apostolicfathers/Makefile @@ -0,0 +1,15 @@ +all: upenn/1Clement.imp + +upenn/1Clement: + wget -r -np http://ccat.sas.upenn.edu/gopher/text/religion/churchwriters/ApostolicFathers/ + mv ccat.sas.upenn.edu/gopher/text/religion/churchwriters/ApostolicFathers upenn + rm -rf ccat.sas.upenn.edu + rm -f upenn/*index* + +upenn/1Clement.imp: upenn/1Clement + ./impify.sh + +versification.xml: upenn/1Clement.imp + +clean: + rm -rf ccat.sas.upenn.edu upenn versification.xml 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 "" > $VNFILE +echo " " >> $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 " " >> $VNFILE + j=1 + while [ $j -le $CHAPMAX ] + do + VERSEMAX=$(grep " $j:" $i | cut -f2 -d' '|cut -f2 -d:| sort -n| tail -n1) + echo " " >> $VNFILE + j=$(($j + 1)) + done + echo " " >> $VNFILE +done +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $VNFILE +echo " " >> $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 " $BOOKNAME" >> $VNFILE +done +echo " " >> $VNFILE +echo "" >> $VNFILE + diff --git a/modules/apostolicfathers/impify.sh b/modules/apostolicfathers/impify.sh new file mode 100755 index 0000000..3471cde --- /dev/null +++ b/modules/apostolicfathers/impify.sh @@ -0,0 +1,27 @@ +#!/bin/sh +rm -f upenn/*.imp +for i in upenn/* +do + BOOK=$(grep " 1:1" $i|cut -f1 -d' ') + echo "Book: $BOOK" + echo "\$\$\$$BOOK 0:0" > $i.imp + # These are mostly for very strange things in Hermes, which seems to include + # Muliple reference systems which start chapters over after main sections + # But also include a chapter numbering scheme which doesn't start over + # so for now, we're choosing that one. + sed s/^$BOOK/\$\$\$$BOOK/ $i|sed s/prologue:1/1:0/ \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)0\\^/\\1\\21/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)1\\^/\\1\\22/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)2\\^/\\1\\23/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)3\\^/\\1\\24/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)4\\^/\\1\\25/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)5\\^/\\1\\26/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)6\\^/\\1\\27/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)7\\^/\\1\\28/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[\\([0-9]*\\)8\\^/\\1\\29/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[104_/\\1106/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[104\`/\\1107/" \ + |sed "s/\\(\$\$\$[^ ]* \\)[0-9]*\\[104a/\\1108/" \ + |sed "s/\\(\$\$\$.* \\)[0-9]*\\[\\(.*\\)\\]/\\1\\2/" \ + >> $i.imp +done -- cgit