<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Technical answer:<div class="">Using osis2mod to do compression is easiest. It does compression as it builds the module.</div><div class=""><br class=""></div><div class="">As Michael noted, we compressed all of the Bible and commentary modules in the CrossWire repository. We did this with mod2zmod.</div><div class=""><br class=""></div><div class="">The two use identical compression, but they are not identical in results in some corner cases.</div><div class=""><br class=""></div><div class="">When osis2mod creates a module it appends data to the data file. One characteristic of building modules is that the input file does not have to be in order. The index is always in v11n order and the data file is always in the order in which the verses are provided.</div><div class=""><br class=""></div><div class="">The -a (append) allows for building a module incrementally and for correcting verses. When used for correcting verses in an uncompressed module, it will put the new verse at the end of the data file and update the entry in the index file to point to it. It does not remove the old text. A compressed module is more complicated, but it likewise does not replace the corrected verse. I think, but am not sure, that it duplicates the entire compressed block in which the verse resides before appending.</div><div class=""><br class=""></div><div class="">The other corner case is when a verse is not in the module’s v11n. This will append the verse to what’s already in the module. It does this by getting the old text out, appending the additional text to it and then writing that to the module, updating the index. Osis2mod has been optimized to “write later” the prior verse to minimize this duplication in the data file.</div><div class=""><br class=""></div><div class="">Many utilities can only read from a repository known to the SWORD engine. There are a few ways to make a repository be seen. From memory, it will look for SWORD_PATH first, then the current folder, then well-known locations for the mods.d folder. It will use the first that it finds. Then it will look for the module’s conf by the provided name. That file gives the relative location of the module’s files.</div><div class=""><br class=""></div><div class="">mod2zmod will read the verses from the module and will create a new module with the indicated compression. I’ve not used it in years, so I don’t know where it puts the new module. At CrossWire we have a convention where the new module needs to be placed. There’s a cleanup that needs to take place afterwards.</div><div class=""><br class=""></div><div class="">From memory, mod2zmod has a corner case that will not create the same index or data file. This is especially true of commentary modules. If a “verse” is a range (e.g. Matt.1.1-Matt.1.5), osis2mod will put the data into the module once and have the different index slots point to the same offset and length. But mod2zmod will replicate the content. In this case, 5 times, with the index of these 5 pointing to the different copies. It would be a good optimization to change this to save the last index and not duplicate the content (hopefully it has been done already).</div><div class=""><br class=""></div><div class="">I prefer osis2mod.</div><div class=""><br class=""></div><div class="">In Him,</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>DM<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 26, 2018, at 5:49 PM, John Dudeck <<a href="mailto:john.dudeck@sim.org" class="">john.dudeck@sim.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<title class=""></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" class="">
<meta http-equiv="Content-Style-Type" content="text/css" class="">
<div class="">
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">In the Wiki, on the <a href="http://wiki.crosswire.org/DevTools:Modules" class="">http://wiki.crosswire.org/DevTools:Modules</a> page it gives directions for using mod2zmod for compressing
modules.</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">However osis2mod.exe has command-line switches for creating compressed modules.</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">My question is: do these produce equivalent results? Which is preferred?</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">For GenBooks, is mod2zmod the only way to compress them?</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">Related question re mod2zmod. When it says "First you will need to install the module so that it can be accessed using the
SWORD engine", exactly what does this mean? I am building each module in its own branch of an svn repository, and would like
to create the compressed module in that tree. This is working fine using osis2mod. Is there a way to do the same with
mod2zmod?</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">Thanks and sorry for the newby questions.</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><br class="">
</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">John Dudeck</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">Programmer at Editions Cle Lyon, France</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class=""><a href="mailto:john.dudeck@sim.org" class="">john.dudeck@sim.org</a> <a href="mailto:john@editionscle.com" class="">john@editionscle.com</a></span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">--</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">Sign in Swiss restaurant:</span></font></div>
<div align="left" class=""><font face="Arial" size="2" class=""><span style=" font-size:10pt" class="">"Our wines leave you nothing to hope for."</span></font></div>
<div align="left" class=""> </div>
</div>
_______________________________________________<br class="">sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="">sword-devel@crosswire.org</a><br class=""><a href="http://www.crosswire.org/mailman/listinfo/sword-devel" class="">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br class="">Instructions to unsubscribe/change your settings at above page</div></blockquote></div><br class=""></div></body></html>