schierlm / BibleMultiConverter

Converter written in Java to convert between different Bible program formats
Other
124 stars 33 forks source link

USX to OnLineBible - Invalid conversion #42

Closed Michahel closed 3 years ago

Michahel commented 3 years ago

When trying to convert USX to Online Bible format, I am getting a following invalid conversion:

Before (Input File):

  <chapter number="12" style="c"/>
  <para style="p">
    <verse number="14" style="v"/>Блюстители же Закона, выйдя, стали совещаться о том, как им убить Ису.</para>
  <para style="s1">Кроткий и смиренный Раб Всевышнего</para>
  <para style="r">(<ref loc="MRK 3:7-12">Мк. 3:7-12</ref>; <ref loc="LUK 6:17-19">Лк. 6:17-19</ref>)</para>
  <para style="p">Узнав об этом, Иса ушёл из тех мест. <verse number="15" style="v"/>За Ним последовало много людей, и Он исцелил их всех. <verse number="16" style="v"/>Но Он запретил им разглашать о том, кто Он<note caller="+" style="f"><char style="fr" closed="false">12:16 </char><char style="ft" closed="false">Иса, вероятно, не хотел, чтобы люди видели в Нём только чудотворца-целителя. Другая возможная причина – растущая популярность, которая мешала Его служению (см. <char style="xt"><ref loc="MRK 1:43-45">Мк. 1:43-45</ref></char>).</char></note>. <verse number="17" style="v"/>Так исполнялись слова, сказанные через пророка Исаию:</para>

After (Output File):

$$$ Mt 12:14 
Блюстители же Закона, выйдя, стали совещаться о том, как им убить Ису.\&
$$$ Mt 12:15 
 {\$Кроткий и смиренный Раб Всевышнего\$} {\$\@(Мк. 3:7-12; Лк. 6:17-19)Узнав об этом, Иса ушёл из тех мест. \@\$} За Ним последовало много людей, и Он исцелил их всех. 
$$$ Mt 12:16 
Но Он запретил им разглашать о том, кто Он {12:16 Иса, вероятно, не хотел, чтобы люди видели в Нём только чудотворца-целителя. Другая возможная причина – растущая популярность, которая мешала Его служению (см. Мк. 1:43-45).} . 
$$$ Mt 12:17 
Так исполнялись слова, сказанные через пророка Исаию:

In Mt 12:15, the text Узнав об этом, Иса ушёл из тех мест. became part of the footnote. In addition, two footnotes escaped from verse 14 to verse 15. It should be like this:

$$$ Mt 12:14 
Блюстители же Закона, выйдя, стали совещаться о том, как им убить Ису.\&
 {\$Кроткий и смиренный Раб Всевышнего\$} {\$\@(Мк. 3:7-12; Лк. 6:17-19)\@\$} Узнав об этом, Иса ушёл из тех мест.
$$$ Mt 12:15 
За Ним последовало много людей, и Он исцелил их всех. 

The command I am running is java -jar BibleMultiConverter.jar USX N:\Bibles\CARS\Text OnLineBible N:\Bibles\CARS\CARS.Exp In the directory N:\Bibles\CARS\Text I put the file MAT.usx. I send MAT.usx as an attachment to trace it yourself: MAT.zip

schierlm commented 3 years ago

I did not believe how hard it is to debug errors in handling text that contains characters where you do not even know how to pronounce them. I had to replace the words by random English/Latin ones just to be able to quickly grasp what was going on.

When importing Paratext formats (USFM/USX) and there is a headline directly before a paragraph starting a verse, the headline should become part of that next verse and not the previous one (at least most Non-paratext formats like to treat it like that).

So, in (USFM)

\p \v 1 FirstVerse
\s1 Headline
\p \v 2 SecondVerse

the Headline should belong to verse 2 and should look like this in OnLineBible:

$$$ Ge 1:1
FirstVerse
$$$ Ge 1:2
 {\$Headline\$} SecondVerse

However, this logic went wrong in case the second paragraph contains parts of the previous verse and at least one new verse:

\p \v 1 FirstVerse
\s1 Headline
\p DidNotEndYet \v 2 SecondVerse

Was converted as if it was

\p \v 1 FirstVerse
\s1 Headline DidNotEndYet
\p \v 2 SecondVerse

Also, when exporting to OnLineBible, a flag in BibleMultiConvertor's verse mapping logic (required to join verses if they fall outside of KJV versification) accidentally split up verses if they had a headline in the middle. This logic was removed since I don't believe it is needed for OnLineBible. Should be fixed now.