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
104 replies to this topic

#31 Atheist Rob

Atheist Rob

    e-Sword Addict

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

Posted 29 August 2012 - 11:18 AM

Hi Arnie,

I updated the main post and attached a new version of the bible conversion script which cleanly converts the HSB variants (as well as other bibles, including Greek ones). I encountered a few rtf tags that I didn't know how to handle (in the HSV1 version I encountered this in Numbers 27:5, in this case it's of no significance to the result). Also the "\key ... \key0" boundaries are not supported, but braces work fine. Lastly, I don't know if other Windows 125x codepages are used except default (1250), Greek (1253) and Hebrew (1255). If they are they will render wrong characters. Bug reports, patches etc are welcome :)
I could post HSB4 if you want but I doubt there is that much demand for it, especially cince HSB1 is already posted for MySword (that said, I couldn't find it with a cursory search so I'm very glad for the link to the e-Sword version. It way better that the interlinear HOT that I posted earlier).

Regards,
Rob

#32 Arnie51

Arnie51

    Liking e-Sword

  • Veterans
  • PipPip
  • 19 posts
Offline

Posted 29 August 2012 - 02:29 PM

Thanks! I'll get downloading right away! So grateful for all your effort and brain power!
Arnie

#33 Arnie51

Arnie51

    Liking e-Sword

  • Veterans
  • PipPip
  • 19 posts
Offline

Posted 29 August 2012 - 02:57 PM

Hi Rob - sorry to bother you again, but I can't make the new version work at all... I downloaded it and entered "perl esbblx2mys.pl HSB4.bblx" into the command window, and got: 'perl' is not recognised as an internal or external command, operable program or batch file.
What am I doing wrong?
Meanwhile, could you post the HSB4 on this page, just to keep me going? It would be much appreciated!
Thanks, Arnie

#34 dailyglen

dailyglen

    New to Bible Support

  • Veterans
  • Pip
  • 2 posts
Offline

Posted 03 October 2012 - 05:05 PM

Hi Atheist Rob,

Thanks so much for this script! I found out that it runs quite slow (1 bible / 30 min?) and my hard drive was grinding hard. So I tried running it from a RAM disk and it does a whole bible in a few seconds. Here's how (on Ubuntu 12.04):

cd /run
sudo mkdir bibles
cd bibles
sudo cp /path/to/bible.bblx .
sudo perl esbblx2mys.pl bible.bblx

Perhaps there is a way to code the converter so it doesn't depend on the hard drive performance....but not a big deal. Just thought I would share in case someone benefits.

Cheers!

#35 Atheist Rob

Atheist Rob

    e-Sword Addict

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

Posted 06 October 2012 - 10:45 AM

Hi Rob - sorry to bother you again, but I can't make the new version work at all... I downloaded it and entered "perl esbblx2mys.pl HSB4.bblx" into the command window, and got: 'perl' is not recognised as an internal or external command, operable program or batch file.
What am I doing wrong?


Hi Arnie, sorry for the late reply, it has been a very busy time for me. What you seem to be doing wrong is that you haven't started Strawberry Perl. Check the OP for instructions. Jut download the portable version from http://strawberryper...m/releases.html and double click on the "portableshell.bat" file, that will give you a command prompt that knows perl.

Meanwhile, could you post the HSB4 on this page, just to keep me going? It would be much appreciated!


Of course, posted here:
http://www.biblesupport.com/e-sword-downloads/file/8123-hebrew-study-bible-hebrew-text-only-version-for-mysword/

Regards,
Rob


#36 Atheist Rob

Atheist Rob

    e-Sword Addict

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

Posted 06 October 2012 - 11:25 AM

Thanks so much for this script! I found out that it runs quite slow (1 bible / 30 min?) and my hard drive was grinding hard. So I tried running it from a RAM disk and it does a whole bible in a few seconds. Here's how (on Ubuntu 12.04):

cd /run
sudo mkdir bibles
cd bibles
sudo cp /path/to/bible.bblx .
sudo perl esbblx2mys.pl bible.bblx

Perhaps there is a way to code the converter so it doesn't depend on the hard drive performance....but not a big deal. Just thought I would share in case someone benefits.


Hi Dailyglen,

Thanks for the tip. Indeed, if you run the script to write on a physical disk, it is terribly slow. All my conversions happen on a RAM disk. I didn't mention it before because I don't know if it's possible to create a RAM disk on Windows and how that should be done. I made my instructions so that people on Windows can still utilize Strawberry Perl to do the conversion. For those with other distributions, you can always create a RAM disk yourself and do the conversion on that. To create a RAM disk, first become root (either with "sudo su -" and using your own password, or with "su -" and using the password for user root. Just create a directory and mount the RAM disk on it like this:

mkdir /ramdisk
mount -t tmpfs -o size=200M,mode=1777 tmpfs /ramdisk

This will create a RAM disk of 200MiB on /ramdisk. After this you can leave the root account and just use the space as any user (comparable to /tmp). If you want to permanently create such a RAM disk, don't execute the mount command above, but add the following line to /etc/fstab:

tmpfs     /ramdisk   tmpfs    size=200M,mode=1777   0 0
and mount it with "mount -a". Doing it this way will verify that you didn't introduce a syntax error in /etc/fstab. Please note that all content on a RAM disk will disappear after a reboot or unmounting the RAM disk, even if you remount it.

For those of you who aren't using Linux yet (what's keeping you?) there seems to be RAM disk software that you can buy or you can watch with envy while we do it for free ;-)

Regarding the disk dependency, it will be hard to change that. I read the source bible in one go, but the writing of the destination bible goes verse by verse (it uses SQL INSERT statements, since the bible is a SQLite database). Maybe I can get a bit of improvement by using COPY instead of INSERT, but I doubt it will make that much of a difference. If I have some spare time I might experiment a little with that.

If there's anyone who wants to do this him/herself, by all means go ahead. I didn't include a license statement in the script but consider it BSD licensed (i.e. basically use it, modify it and distribute it however you want).

Regards,
Rob

#37 johnatandias

johnatandias

    New to Bible Support

  • Veterans
  • Pip
  • 1 posts
  • LocationBrasil
Offline

Posted 16 October 2012 - 04:16 PM

Hello Rob

I tried all ways but always some error happens, I'm trying to convert a bible that I use a lot in e-sword for mysword, the Bible would be this: http://www.biblesupp...-downloads/file / 4808-ara1993 /

I am in need of a Bible in Portuguese with Strong, for studies, would be grateful if you help me.

#38 Atheist Rob

Atheist Rob

    e-Sword Addict

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

Posted 17 October 2012 - 08:44 AM

OK, I see what the problem is. There are some verbs that have a TVM Strong number (in brackets) along with the primary Strong number and parsing that fails. I'm modifying the script to be able to parse it and will upload the resulting bible.

@Mods, ISTR that there was a post in this thread to some other software to convert different bible formats. Was that a piracy tool? Just wondering.

#39 patchworkid

patchworkid

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,554 posts
  • LocationOld England
Offline

Posted 17 October 2012 - 12:18 PM

hi Rob,

this is another way to convert modules to My Sword:
http://www.biblesupp...ysword-modules/

thanks
Merismos the Scriptures with Patchworkid's Study Bible Set<p>http://www.biblesupp...tudy-bible-set/, MySword -http://www.biblesupp...tudy-bible-set/

#40 Atheist Rob

Atheist Rob

    e-Sword Addict

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

Posted 17 October 2012 - 02:39 PM

@johnatandias, the file has been uploaded to here. I still get some RTF parsing errors while reading the Details table (About Module in MySword and Bible->Information in e-Sword) so the layout of that is not what it should be, but I honestly couldn't be bothered. I hope you don't mind.

@patchworkid, I am aware of that method and that is the method that pfpeller uses to convert the absurd amount of modules that he does :) The drawback is that you have to do 3 conversions: e-Sword 9+ to e-Sword 8 using BeST, e-Sword 8 to TheWord using TheWord Bible software and then TheWord to MySword using MySword's migration tools. And the biggest drawback of all (for me): it's a Windows-only solution. I steer clear from Windows wherever possible. In my opinion there is only one way to make a Windows computer go faster: at 9.8 m/s2 :)
That said, the TheWord detour enables you to also convert other modules except bblx and cmtx. I haven't written any scripts to do those (yet).

Regards,
Rob




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs