convert OGNTa to Ruby for TheWord

This commit is contained in:
Andley 2021-09-07 19:43:58 +08:00
parent 5f9ff3695f
commit be7f388b95
4 changed files with 8028 additions and 7976 deletions

View File

@ -1,9 +1,9 @@
#
# convert OGNTa into TheWord format
import re
inputFile = "OGNTa.txt"
outputFile = "OGNTa.md"
outputFile = "OGNTa-Ruby.nt"
# loading data
f = open(inputFile,'r',encoding="utf-8")
@ -12,16 +12,51 @@ f.close()
# processing
f = open(outputFile,'w',encoding='utf-8')
f.write('\ufeff')
bcv = ""
for ol in Lines:
x = re.split ("\t", ol)
if x[1] == bcv:
if len(ol) > 1:
x = re.split ("\t", ol)
# -------------- insert CUV into OGNT gap verses to meet TheWord Bible requirements.
if x[0] == "010140": f.write("\n<rt>太17:21</rt> <rt>至於這一類的鬼,若不禱告、禁食,他就不出來(或作:不能趕他出來)。</rt>")
if x[0] == "010496": f.write("\n<rt>太18:11</rt> 401811<rt>人子來,為要拯救失喪的人。)</rt>")
if x[0] == "013732": f.write("\n<rt>太23:14</rt> 402314<rt>你們這假冒為善的文士和法利賽人有禍了!因為你們侵吞寡婦的家產,假意做很長的禱告,所以要受更重的刑罰。)</rt>")
if x[0] == "022759": f.write("\n<rt>可7:16</rt> 41716<rt>有耳可聽的,就應當聽!)</rt>")
if x[0] == "024509": f.write("\n<rt>可9:44</rt> 41944<rt>你缺了肢體進入永生,強如有兩隻手落到地獄,入那不滅的火裡去。</rt>")
if x[0] == "024535": f.write("\n<rt>可9:46</rt> 41946<rt>你瘸腿進入永生,強如有兩隻腳被丟在地獄裡。</rt>")
if x[0] == "025920": f.write("\n<rt>可11:26</rt> 411126<rt>你們若不饒恕人,你們在天上的父也不饒恕你們的過犯。(有古卷無此節)</rt>")
if x[0] == "028995": f.write("\n<rt>可15:28</rt> 411528<rt>這就應了經上的話說:他被列在罪犯之中。)</rt>")
if x[0] == "043640": f.write("\n<rt>路17:36</rt> 421736<rt>兩個人在田裡,要取去一個,撇下一個。)</rt>")
if x[0] == "047735": f.write("\n<rt>路23:17</rt> 422317<rt>每逢這節期,巡撫必須釋放一個囚犯給他們。)</rt>")
if x[0] == "052024": f.write("\n<rt>約5:4</rt> 4354<rt>因為有天使按時下池子攪動那水,水動之後,誰先下去,無論害甚麼病就痊癒了。)</rt>")
if x[0] == "070106": f.write("\n<rt>徒8:37</rt> 44837<rt>腓利說:你若是一心相信,就可以。他回答說:我信耶穌基督是神的兒子。)</rt>")
if x[0] == "074803": f.write("\n<rt>徒15:34</rt> 441534<rt>唯有西拉定意仍住在那裡。)</rt>")
if x[0] == "077576": f.write("\n<rt>徒19:41</rt> 441941<rt>說了這話,便叫眾人散去。</rt>")
if x[0] == "080382": f.write("\n<rt>徒24:7</rt> 44247<rt>不料千夫長呂西亞前來,甚是強橫,從我們手中把他奪去,吩咐告他的人到你這裡來。)</rt>")
if x[0] == "083187": f.write("\n<rt>徒28:29</rt> 442829<rt>保羅說了這話,猶太人議論紛紛的就走了。)</rt>")
if x[0] == "090276": f.write("\n<rt>羅16:24</rt> 451624<rt>城內管銀庫的以拉都,和兄弟括土問你們安。</rt>")
if x[0] == "101636": f.write("\n<rt>林後13:14</rt> 471314<rt>願主耶穌基督的恩惠、神的慈愛、聖靈的感動,常與你們眾人同在!</rt>")
# -------------- align 3Jo 1:15 & Rev 12:18 to meet TheWord Bible requirements.
if (x[1] == "Rev 12:18") or (x[1] == "3Jo 1:15") or (x[1]== bcv):
f.write(" ")
elif (x[1] == "Mat 1:1"):
f.write("<rt>"+x[1]+"</rt> ")
else:
bcv = x[1]
f.write("\n")
f.write("<rt>"+x[1]+"</rt> ")
# -------------- insert section break
if (re.match("¬.*",x[2])): f.write("<hr>")
# --------------
ol = re.sub("(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\n", r" <RUBY><ruby><ruby>\3<rt>\7</rt></ruby><rt>\4</rt></ruby><rt>\5</rt></RUBY>", ol)
f.write(ol)
else:
ol = re.sub("(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\n", r"\n<rt>\2</rt> <RUBY><ruby><ruby>\3<rt>\7</rt></ruby><rt>\4</rt></ruby><rt>\5</rt></RUBY>", ol)
bcv = x[1]
f.write(ol)
# ------------- insert paragraph break
if (re.match(".*¶$",x[2])): f.write("<pre></pre>")
# ----------
f.write("\n\n\nlang=grc\nnotags=1\nshort.title=OGNTa-Ruby\ndescription=OGNTa (https://github.com/Andley/OGNTa)")
#
f.close()
f.close()

File diff suppressed because one or more lines are too long

View File

@ -29443,7 +29443,7 @@
029443 Mar 16:8 εἶπαν · ἔπω, ἐρῶ, εἶπον V-2AAI-3P to say they spoke;
029444 Mar 16:8 ἐφοβοῦντο φοβέω V-INI-3P to fear they were afraid
029445 Mar 16:8 γάρ . ¶ γάρ CONJ for for.
029446 Mar 16:9 ⟦ Ἀναστὰς ἀνίστημι V-2AAP-NSM to arise Having risen
029446 Mar 16:9 ⟦ Ἀναστὰς ἀνίστημι V-2AAP-NSM to arise Having risen
029447 Mar 16:9 δὲ δέ CONJ but/and now
029448 Mar 16:9 πρωῒ πρωΐ ADV morning early [the]
029449 Mar 16:9 πρώτῃ πρῶτος A-DSF first first [day]
@ -29614,7 +29614,7 @@
029614 Mar 16:20 τῶν ὁ T-GPN the/this/who the
029615 Mar 16:20 ἐπακολουθούντων ἐπακολουθέω V-PAP-GPN to follow after accompanying
029616 Mar 16:20 σημείων . ⟧ ¶ σημεῖον N-GPN sign signs.
029617 Mar 16:20 ⟦ πάντα πᾶς A-APN all all
029617 Mar 16:20 ⟦ πάντα πᾶς A-APN all all
029618 Mar 16:20 δὲ δέ CONJ but/and moreover
029619 Mar 16:20 τὰ ὁ T-APN the/this/who the
029620 Mar 16:20 παρηγγελμένα παραγγέλλω V-RPP-APN to order [things] being instructed
@ -54871,7 +54871,7 @@
054871 Joh 7:52 προφήτης προφήτης N-NSM prophet a prophet
054872 Joh 7:52 οὐκ οὐ PRT-N no not
054873 Joh 7:52 ἐγείρεται . ¶ ἐγείρω V-PPI-3S to arise is raised.”
054874 Joh 7:53 ⟦ Καὶ καί CONJ and And
054874 Joh 7:53 ⟦ Καὶ καί CONJ and And
054875 Joh 7:53 ἐπορεύθησαν πορεύω V-AOI-3P to go went
054876 Joh 7:53 ἕκαστος ἕκαστος A-NSM each each
054877 Joh 7:53 εἰς εἰς PREP toward to

View File

@ -4,30 +4,26 @@ This is an abridged and updated version of OpenGNT Version 3 [OGNT 3.3 Base Text
## Structure changes
- OGNT3.3 abridged to the following tab-separated columns:
- OGNTsort = sort numbers of all words of the base text of OGNT.
- Book-Chapter:Verse = scripture reference.
- PMpWord-OGNT-PMfWord = OGNT and punctuation marks.
- PMpWord = punctuation mark(s) preceding the main word.
- [[ changed to ⟦
- ]] changed to ⟧
- OGNT = Greek word of OGNT in accented form.
- PMfWord = punctuation mark(s) following the main word.
- lexeme = Greek word of OGNT in lexical form.
- rmac = Robinson's Morphological Analysis Codes.
- TBESG = context-insensitive glosses (from Tyndale House's TAGNT).
- IT = context-sensitive glossess (from Berean Interlinear Bible)
OGNT3.3 abridged to the following tab-separated columns:
- OGNTsort = sort numbers of all words of the base text of OGNT.
- Book-Chapter:Verse = scripture reference.
- PMpWord-OGNT-PMfWord = OGNT and punctuation marks.
- PMpWord = punctuation mark(s) preceding the main word.
- [[ changed to ⟦
- ]] changed to ⟧
- OGNT = Greek word of OGNT in accented form.
- PMfWord = punctuation mark(s) following the main word.
- lexeme = Greek word of OGNT in lexical form.
- rmac = Robinson's Morphological Analysis Codes.
- TBESG = context-insensitive glosses (from Tyndale House's TAGNT).
- IT = context-sensitive glossess (from Berean Interlinear Bible)
| OGNTsort | Book-Chapter:Verse | PMpWord OGNTa PMfWord | lexeme | rmac | TBESG | IT |
|----------|--------------------|-----------------------|----------------------|---------|--------------|--------------------|
| 000001 | 40-1:1 | Βίβλος | βίβλος | N-NSF | book | [The] book |
| 000002 | 40-1:1 | γενέσεως | γένεσις | N-GSF | origin | of [the] genealogy |
| 000003 | 40-1:1 | Ἰησοῦ | Ἰησοῦς | N-GSM-P | Jesus/Joshua | of Jesus |
| 000004 | 40-1:1 | Χριστοῦ | Χριστός | N-GSM-T | Christ | Christ, |
| 000005 | 40-1:1 | υἱοῦ | υἱός | N-GSM | son | son |
| 000006 | 40-1:1 | Δαυὶδ | Δαυείδ, Δαυίδ, Δαβίδ | N-GSM-P | David | of David, |
| 000007 | 40-1:1 | υἱοῦ | υἱός | N-GSM | son | son |
| 000008 | 40-1:1 | Ἀβραάμ . ¶ | Ἀβραάμ | N-GSM-P | Abraham | of Abraham: |
| OGNTsort | Book-Chapter:Verse | PMpWord-OGNTa-PMfWord | lexeme | rmac | TBESG | IT |
|----------|--------------------|-----------------------|--------|-------|--------|----|
| 000001 | Mat 1:1 | Βίβλος | βίβλος | N-NSF | book | [The] book |
| 029616 | Mar 16:20 | σημείων . ⟧ ¶ | σημεῖον | N-GPN | sign | signs.|
| 029617 | Mar 16:20 | ⟦ πάντα | πᾶς | A-APN | all | all |