diff options
author | Troy A. Griffitts <scribe@crosswire.org> | 2014-04-13 04:30:58 +0000 |
---|---|---|
committer | Troy A. Griffitts <scribe@crosswire.org> | 2014-04-13 04:30:58 +0000 |
commit | bb0c93ca425cce7dabe9e466b22dd8c6c338c721 (patch) | |
tree | 22b70984678114b5fe571b830cc1a57dc0e1d290 /modules | |
parent | 45d37bb6862a92bc0999e4468bb78d8dae68c1cf (diff) | |
download | sword-tools-bb0c93ca425cce7dabe9e466b22dd8c6c338c721.tar.gz |
added simple conversion scripts for maurice's stuff
git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@485 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bibles/grc/tr/Makefile | 30 | ||||
-rw-r--r-- | modules/bibles/grc/whnu/Makefile | 30 | ||||
-rwxr-xr-x | modules/bibles/grc/whnu/convert.sh | 28 |
3 files changed, 88 insertions, 0 deletions
diff --git a/modules/bibles/grc/tr/Makefile b/modules/bibles/grc/tr/Makefile new file mode 100644 index 0000000..8742dc1 --- /dev/null +++ b/modules/bibles/grc/tr/Makefile @@ -0,0 +1,30 @@ +.SUFFIXES: .UTR .imp +SOURCE = TR-PRSD +TARGET = tr +SOURCES = $(shell find $(SOURCE)/ -name '*.UTR') +IMPS = $(SOURCES:%.UTR=%.imp) + +all: $(TARGET)/ + +$(SOURCE).ZIP: + wget -O $(SOURCE).ZIP https://sites.google.com/a/wmail.fi/greeknt/home/greeknt/$(SOURCE).ZIP?attredirects=0 + +$(SOURCE)/: $(SOURCE).ZIP + unzip $(SOURCE).ZIP -d $(SOURCE)/ + +.UTR.imp: + ../whnu/convert.sh $< > $@ + +$(SOURCE).imp: $(SOURCE)/ ../whnu/convert.sh symbgreektoutf16 $(IMPS) + cat $(IMPS) > $(SOURCE).imp + +$(TARGET)/: $(SOURCE).imp + mkdir -p $(TARGET)/ + imp2vs $(SOURCE).imp -z -o $(TARGET)/ + +clean: + rm -rf $(SOURCE).ZIP $(SOURCE) $(SOURCE).imp symbgreektoutf16 $(TARGET) + +symbgreektoutf16: ../../../../misc/symbgreektoutf16.c + gcc -o $@ $< + diff --git a/modules/bibles/grc/whnu/Makefile b/modules/bibles/grc/whnu/Makefile new file mode 100644 index 0000000..27e9d8f --- /dev/null +++ b/modules/bibles/grc/whnu/Makefile @@ -0,0 +1,30 @@ +.SUFFIXES: .UWH .imp +SOURCE = WH27PRSD +TARGET = whnu +SOURCES = $(shell find $(SOURCE)/ -name '*.UWH') +IMPS = $(SOURCES:%.UWH=%.imp) + +all: $(TARGET)/ + +$(SOURCE).ZIP: + wget -O $(SOURCE).ZIP https://sites.google.com/a/wmail.fi/greeknt/home/greeknt/$(SOURCE).ZIP?attredirects=0 + +$(SOURCE)/: $(SOURCE).ZIP + unzip $(SOURCE).ZIP -d $(SOURCE)/ + +.UWH.imp: + ./convert.sh $< > $@ + +$(SOURCE).imp: $(SOURCE)/ convert.sh symbgreektoutf16 $(IMPS) + cat $(IMPS) > $(SOURCE).imp + +$(TARGET)/: $(SOURCE).imp + mkdir -p $(TARGET)/ + imp2vs $(SOURCE).imp -z -o $(TARGET)/ + +clean: + rm -rf $(SOURCE).ZIP $(SOURCE) $(SOURCE).imp symbgreektoutf16 $(TARGET) + +symbgreektoutf16: ../../../../misc/symbgreektoutf16.c + gcc -o $@ $< + diff --git a/modules/bibles/grc/whnu/convert.sh b/modules/bibles/grc/whnu/convert.sh new file mode 100755 index 0000000..d4c443a --- /dev/null +++ b/modules/bibles/grc/whnu/convert.sh @@ -0,0 +1,28 @@ +#!/bin/bash +FILENAME=$(basename $1) +BOOK=${FILENAME%.*} +vn="0" +sed -e 's/
//g' $1| while read line; do + for i in $line; do + if [[ "$i" =~ [0-9]+:[0-9]+ ]]; then + echo; echo \$\$\$$BOOK $i + elif [[ "$i" =~ \{.*\} ]]; then + echo -n "<w lemma=\"strong:$lemma\" morph=\"robinson:${i:1:-1}" + if [[ "$sm" -ne "" ]]; then echo -n " strongsMorph:$sm"; fi + echo -n "\">$txt</w> " + sm="" + elif [[ "$i" =~ [0-9]+ ]]; then + if [[ "$i" > "5624" ]]; then sm=$i + else lemma=$i; fi + elif [[ "$i" = "|" ]]; then + ((vn = vn + 1)) + if [[ "$vn" > "1" ]]; then echo -n "</seg>"; fi + if [[ "$vn" < "3" ]]; then echo -n "<seg type=\"x-variant\" subType=\"x-$vn\">" + else vn="0"; fi + elif [[ "$i" =~ [a-z]+ ]]; then + txt=$(echo $i |./symbgreektoutf16 -robinson| uconv --from-code UTF-16 --to-code UTF-8) + else + echo NOT HANDLED!: $i + fi + done +done |