[sword-devel] compressing LD modules

Joachim Ansorg nospam+sword-devel at joachim-ansorg.de
Wed Feb 28 15:46:13 MST 2007

Hi Adrian,
I hope that I can help you with this.

> I have created a Thai dictionary module that displays fine in RawLD format.
> When I try to create a compressed module, my latest attempt runs up against
> an error in Win SwordCS of "Access violation at address 004F3389 in module
> 'sword.159.exe'". I created the first attempts with an older version of
> mod2zmod and the latest with the version on the beta CD. The module is
> zipped but no cipher key is set. (I notice that most LD modules are in a
> Raw format; is that because of the difficulty in getting the data files
> zipped?) Can someone suggest how to properly compress these LD modules?

I did that for GerHfaLex2002 and it took me quite some time to figure it out.
I created the lexicon as a rawld module and compressed it with mod2zmod.

Here's a snippet of the perl script which call mod2zmod:

 ../swordtools/mod2zmod GerHofLexRaw2002 \
modules/lexdict/zld/gerhfalex2002/gerhfalex2002 200 2 "$cryptKey"

(\ is to to make it one line)

You see that the 200 is the blocktype although it's not mentioned in the 
command line help. 200 is the default afair, so it's not mentioned in 
the .conf file.

2 is for the compression type, i.e. ZIP in this case.

$cryptkey is for the encryption of the module, replace it with a real key or 
leave it out.

AFAIR it's important that the mod2zmod has been compiled with the same version 
of the library which is installed system-wide.

> mod2zmod acts a little differently with LD modules. With Bibles and
> Commentaries, it puts the files in a specified folder. With LD, it creates
> four files in the folder with the specified name.

Bibles and commentaries have "nt" and "ot" as prefixes, with lexicons you can 
give the prefix yourself.

> The conf in mods.d also specifies files a little differently. When I
> specified only the containing folder, there were no errors but nothing is
> displayed. Looking at some other LD conf files, I changed the file location
> to include the file name (without extension). That seems to help Sword find
> the file but then the above errors came up.

The DataPath should contain the module data file prefix. 

I hope this has been helpful for you. Let me know if you need more help.
<>< Re: deemed

More information about the sword-devel mailing list