Difference between revisions of "Mod2zmod"

From CrossWire Bible Society
Jump to: navigation, search
m (Introduction: osis2mod)
(Usage: added note 2)
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
'''mod2zmod''' creates a compressed module from an installed module.
 
'''mod2zmod''' creates a compressed module from an installed module.
  
In practice, <tt>tei2mod</tt> and [[osis2mod]] really only need to turn XML into raw{text|com|ld} modules. The reason for this is that <tt>mod2zmod</tt> (which works all module types except genbooks) will produce better compressed modules than the other conversion tools. In turn, the reason for this is that the conversion tools build modules incrementally and compress them incrementally, resulting in compressed modules that are not compressed as well as modules that are compressed all at once, as <tt>mod2zmod</tt> does. So it's always better to build module in a 2-pass procedure: one pass to fix the contents and their order and one pass to compress/encipher.
+
In practice, <tt>tei2mod</tt> and [[osis2mod]] really only need to turn XML into raw{text|com|ld} modules. The reason for this is that <tt>mod2zmod</tt> (which works all module types except genbooks) will produce better compressed modules than the other conversion tools. In turn, the reason for this is that the conversion tools build modules incrementally and compress them incrementally, resulting in compressed modules that are not compressed as well as modules that are compressed all at once, as <tt>mod2zmod</tt> does. So it's always better to build module in a two-pass procedure: first pass to fix the contents and their order and second pass to compress and optionally encipher.
 
 
<tt>mod2zmod</tt> can encipher as it compresses, so there's nothing preventing the creation of compressed TEI-sourced dictionaries.
 
  
 
== Usage ==
 
== Usage ==
  
 
<pre>
 
<pre>
utils\mod2zmod - a tool to create compressed Sword modules
+
mod2zmod - a tool to create compressed Sword modules
 
version 0.1
 
version 0.1
  
usage: utils\mod2zmod <modname> <datapath> [blockType [compressType [cipherKey]]]
+
usage: mod2zmod <modname> <datapath> [blockType [compressType [cipherKey]]]
  
 
datapath: the directory in which to write the zModule
 
datapath: the directory in which to write the zModule
Line 25: Line 23:
 
</pre>
 
</pre>
  
'''Note:'''
+
'''Notes:'''
 
# In practice, all the existing compressed modules at CrossWire are ZIP compressType, so it's always preferred to choose this.
 
# In practice, all the existing compressed modules at CrossWire are ZIP compressType, so it's always preferred to choose this.
 +
# <tt>mod2zmod</tt> outputs a message for every processed data item or verse. It's generally faster to redirect stdout to nul.
 +
# <tt>mod2zmod</tt> can encipher as it compresses, so there's nothing preventing the creation of compressed TEI-sourced dictionaries.
 +
# If you're the developer, there's nothing to stop you having both the uncompressed and compressed module installed. Can be useful during debugging.<BR>Just create a new [[DevTools:conf Files|conf file]] for the compressed module, remembering to give it a different module name.
  
 
== See also ==
 
== See also ==

Latest revision as of 15:14, 15 November 2011

Introduction

mod2zmod creates a compressed module from an installed module.

In practice, tei2mod and osis2mod really only need to turn XML into raw{text|com|ld} modules. The reason for this is that mod2zmod (which works all module types except genbooks) will produce better compressed modules than the other conversion tools. In turn, the reason for this is that the conversion tools build modules incrementally and compress them incrementally, resulting in compressed modules that are not compressed as well as modules that are compressed all at once, as mod2zmod does. So it's always better to build module in a two-pass procedure: first pass to fix the contents and their order and second pass to compress and optionally encipher.

Usage

mod2zmod - a tool to create compressed Sword modules
version 0.1

usage: mod2zmod <modname> <datapath> [blockType [compressType [cipherKey]]]

datapath: the directory in which to write the zModule
blockType  : (default 4)
	2 - verses
	3 - chapters
	4 - books
compressType: (default 1):
	1 - LZSS
	2 - Zip

Notes:

  1. In practice, all the existing compressed modules at CrossWire are ZIP compressType, so it's always preferred to choose this.
  2. mod2zmod outputs a message for every processed data item or verse. It's generally faster to redirect stdout to nul.
  3. mod2zmod can encipher as it compresses, so there's nothing preventing the creation of compressed TEI-sourced dictionaries.
  4. If you're the developer, there's nothing to stop you having both the uncompressed and compressed module installed. Can be useful during debugging.
    Just create a new conf file for the compressed module, remembering to give it a different module name.

See also