Jump to content

Please read the Forum Rules before posting.

Photo

Perl scripts to convert e-Sword 9 bblx and cmtx modules to mysword


  • Please log in to reply
101 replies to this topic

#71 Atheist Rob

Atheist Rob

    e-Sword Addict

  • Members (T)
  • PipPipPipPip
  • 83 posts
  • LocationThe Netherlands
Offline

Posted 04 August 2014 - 02:43 PM

 

Thanks Rob for doing this conversion program.  I did a conversion of my red-letter NKJV to mysword and it worked only I noticed it had trouble recognizing nested tags properly.  It's most noticeable with red-letter text as it typically spans many verses.  If a verse is tagged with red letters it is fine as long as there are no other format tags nested in the red-letter tags if so only the words before the nested tag are formatted after the nested tag reverts to default. 

 

For example :

  

John 3

13 "No one has ascended to heaven but He who came down from heaven, that is, the Son of Man who is in heaven.

 
it should be:
 
13 "No one has ascended to heaven but He who came down from heaven, that is, the Son of Man who is in heaven. 
 
NOTE - I've bolded the text to make the colour formatting easier to see.  I appears to do this consistently from all text that I have checked. I will try and convert my red-letter ESV and see if it fares any better. 

 

 

You're welcome. Is the red-letter NKJV available somewhere or is it possible that you use a SQLite database browser and tell me how exactly John 3:13 is encoded in the e-Sword version? I hope this is easily fixable.

Regarding ESV, I have a script that will parse the ESV website and generate a MySword module out of that, including red letters and cross references. Check it out here: http://www.biblesupp...esv-on-mysword/

 

Regards,

Rob



#72 Alawishis

Alawishis

    New to Bible Support

  • Members
  • Pip
  • 3 posts
Offline

Posted 05 August 2014 - 11:53 PM

You're welcome. Is the red-letter NKJV available somewhere or is it possible that you use a SQLite database browser and tell me how exactly John 3:13 is encoded in the e-Sword version? I hope this is easily fixable.

Regarding ESV, I have a script that will parse the ESV website and generate a MySword module out of that, including red letters and cross references. Check it out here: http://www.biblesupp...esv-on-mysword/

 

Regards,

Rob

Yeah it's very nice of you to make this available to us.  I was going to say that's mighty "christian" of you.  ;)  :D

 

Query the database? You asked just the right guy seeing as I'm a DBA by trade.  

 

SELECT Scripture FROM bible WHERE book = 43 AND chapter=3 AND verse = 13

 

 {\cf6 "No one has ascended to heaven but He who came down from heaven, {\cf15\I that is,} the Son of Man who is in heaven.}
 

I could write the query for you if if I understood the tags that MySword is using. Hopefully you can just use the replace function if close tags are always the same.  It could be however that your logic layer is in the perl script and not the query. I'm not going to try and guess how your program is set up to do it's conversion processing. I'm sure it's an easy fix it's just a matter of making sure it doesn't bog down the program too much.  If you need me to test again let me know.

 

I'll check out your link but the ESV file I had converted fine as it had no nested tags.



#73 Atheist Rob

Atheist Rob

    e-Sword Addict

  • Members (T)
  • PipPipPipPip
  • 83 posts
  • LocationThe Netherlands
Offline

Posted 06 August 2014 - 04:11 PM

If a christian tells me `that's might "christian" of you`, I can only consider that a compliment. Thank you very much!

I think I fixed it. When there was a nested part (like in this case), I would split it in a head, the nested part and a tail and parse these three parts separately. I changed that to first parse the nested part (recursively) and replace the text with the output of the parse function before parsing the whole text. That means that the nested part gets parsed (at least) twice but during the last run it should not contain any backslashes or braces so it shouldn't matter. Jn 3:13 seems to be handled correctly now.

 

Could you please try the modified script? If it works correctly I will replace the zip file in the original post.

 

To all the non-IT readers of this thread, sorry for the jargon. I found a colleague :D



#74 Alawishis

Alawishis

    New to Bible Support

  • Members
  • Pip
  • 3 posts
Offline

Posted 07 August 2014 - 11:18 PM

If a christian tells me `that's might "christian" of you`, I can only consider that a compliment. Thank you very much!

I think I fixed it. When there was a nested part (like in this case), I would split it in a head, the nested part and a tail and parse these three parts separately. I changed that to first parse the nested part (recursively) and replace the text with the output of the parse function before parsing the whole text. That means that the nested part gets parsed (at least) twice but during the last run it should not contain any backslashes or braces so it shouldn't matter. Jn 3:13 seems to be handled correctly now.

 

Could you please try the modified script? If it works correctly I will replace the zip file in the original post.

 

To all the non-IT readers of this thread, sorry for the jargon. I found a colleague :D

 

Tested today.  Your fix seems to have nailed it.  Not only does it deal with the nested tags properly it now runs much faster.  In fact it runs so fast now I thought it was broken.  When I used to old program it took about 10 minutes to parse a bible file this latest version takes maybe 10 seconds. 

 

John 3:13 looks good along with other texts with nested tags like John 4:24 , John 4:35 John 2:8 etc.  So far I have found no issues.  I'll update you if I do.

 

Thanks again.  You've changed a pretty good bible app into a fantastic one for me.

 

 

I appreciate the update and the explanation of your fix. 



#75 Atheist Rob

Atheist Rob

    e-Sword Addict

  • Members (T)
  • PipPipPipPip
  • 83 posts
  • LocationThe Netherlands
Offline

Posted 08 August 2014 - 03:14 AM

Tested today.  Your fix seems to have nailed it.  Not only does it deal with the nested tags properly it now runs much faster.  In fact it runs so fast now I thought it was broken.  When I used to old program it took about 10 minutes to parse a bible file this latest version takes maybe 10 seconds. 

 

John 3:13 looks good along with other texts with nested tags like John 4:24 , John 4:35 John 2:8 etc.  So far I have found no issues.  I'll update you if I do.

 

Thanks again.  You've changed a pretty good bible app into a fantastic one for me.

 

 

I appreciate the update and the explanation of your fix. 

 

Thanks. I replaced the script in the original post with this version. The faster running is due to the fact that I now do a BEGIN in the beginning and a COMMIT in the end. In the earlier version every INSERT was written to disk separately.



#76 José Lima

José Lima

    New to Bible Support

  • Members
  • Pip
  • 3 posts
Offline

Posted 08 August 2014 - 08:56 AM

Thanks, Rob, for the good work. I would encourage you to modify the script of comments the same way you did in the bibles. I got some strange random characters after conversion, maybe because I'm working on accented characters in Portuguese.



#77 Atheist Rob

Atheist Rob

    e-Sword Addict

  • Members (T)
  • PipPipPipPip
  • 83 posts
  • LocationThe Netherlands
Offline

Posted 08 August 2014 - 11:02 AM

I'll take a look at it this weekend. I'm not making any promises though...



#78 Atheist Rob

Atheist Rob

    e-Sword Addict

  • Members (T)
  • PipPipPipPip
  • 83 posts
  • LocationThe Netherlands
Offline

Posted 11 August 2014 - 08:05 AM

Hi José,

 

I modified the commentary conversion script. Could you try it out and get back to me if it doesn't do what you need? The zip file has been uploaded to the original post.

 

Regards,

Rob



#79 José Lima

José Lima

    New to Bible Support

  • Members
  • Pip
  • 3 posts
Offline

Posted 30 August 2014 - 07:36 PM

Hi José,

 

I modified the commentary conversion script. Could you try it out and get back to me if it doesn't do what you need? The zip file has been uploaded to the original post.

 

Regards,

Rob

Hi, Rob,
 
thanks for your help. Does work that script on cmtx file from 10.4 eSword version?

I had an error msg like "Use of uninitialized value within %fncolor in concatenatio (.) or string at esctmx2mys.pl line 298. RTF_ERR_66.22.21"

Regards,
José.

 

 



#80 APsit190

APsit190

    e-Sword Tools Developer

  • Members (T)
  • PipPipPipPipPip
  • 2,868 posts
  • LocationLand of the Long White Cloud (AKA New Zealand)
Offline

Posted 30 August 2014 - 09:43 PM

thanks for your help. Does work that script on cmtx file from 10.4 eSword version?


 

 

Hi Jose,

The Script should work fine for cmtx files for e-Sword 10.4 or any other version in the 10x range. The cmtx file type is a commentary file based on the SQLite database system, and as such it should work with any version of e-Sword that supports SQLite based files. Only time it doesn't work is if it contains images in version below 10.

 

Blessings,

Autograph.png

X (formerly Twitter)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs