[sword-devel] vpl2mod.cpp

Barry Drake sword-devel@crosswire.org
Mon, 26 Mar 2001 14:34:24 +0100


Hi ........

I've just completed conversion of another Bible module which I've made 
available to Troy along with others I've done.  A few comments about the 
utility vpl2mod might be worth noting down while I can remember.

vpl2mod only works (at present) when the text file for input has proper 
verse references at the beginning of each line, and the entire verse 
contained on one line (Verse-Per-Line).  Permissible verse titles and 
abbreviations can be found in the header file canon.h in the includes 
directory of the Sword source.  The refs will need to be something like: 
Gen 1:1In the beginning ......

The executable ought to work with two command line parameters only - 
but it doesn't!  Try vpl2mod [filename] [output-path] 1 and it will work - 
else, you'll get a segmentation error if your compilation works like mine.

As supplied, vpl2mod stops when it reaches a reference with no text 
following.  The last version I was converting (NJB) contained a number of 
verses in that form - the verse text forming part of the previous verse for 
readibility.  To get around this, I slipped the following 'hack' into the end 
of the function 'parseVReg' in place of 'return buf;' (you need to declare 
char *inbuf = buf; at the start of parseVReg):

	if (!*buf) {        // if we didn't find any text in line
                  cout << "Linefeed only found at ref: " << inbuf << "\n";
                  return buf;
                  }
        return 0;

I found a wierd problem with vpl2mod that I haven't sorted: in the case in 
point, the offset and verse length written to ot.vss for the first verse of 
Genesis were wrong.  Everything else was OK and it seemed easier to 
hack ot.vss than to debug the code.  In the case to point, Genesis 
started by informing me that "In those days, there was no King in Israel 
.....  " (from the last verse of Judges) and went on to say the "The earth 
was without form, and void".  I took it to be a comment on today's world 
political situation  ;-).

Every blessing ..... 



Barry

>From Barry Drake (The Revd - minister of Arnold United Reformed Church,
Nottingham - see http://www.arnold-urc.supanet.com for our church homepages).

Replies - b.drake@ntlworld.com
Fax: 0705 069 8746