[sword-devel] Quick Question

Jonathan Hughes sword-devel@crosswire.org
Fri, 20 Apr 2001 19:17:41 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_00AE_01C0C9CE.921883E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Skip,

    I am sorry it has taken so long to respond to your question, here =
are some notes that another user compiled concerning making modules for =
Sword:

-----Note One-----
vpl2mod only works (at present) when the text file for input has proper=20
verse references at the beginning of each line, and the entire verse=20
contained on one line (Verse-Per-Line).  Permissible verse titles and=20
abbreviations can be found in the header file canon.h in the includes=20
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 -=20
but it doesn't!  Try vpl2mod [filename] [output-path] 1 and it will work =
-=20
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=20
following.  The last version I was converting (NJB) contained a number =
of=20
verses in that form - the verse text forming part of the previous verse =
for=20
readibility.  To get around this, I slipped the following 'hack' into =
the end=20
of the function 'parseVReg' in place of 'return buf;' (you need to =
declare=20
char *inbuf =3D 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=20
point, the offset and verse length written to ot.vss for the first verse =
of=20
Genesis were wrong.  Everything else was OK and it seemed easier to=20
hack ot.vss than to debug the code.  In the case to point, Genesis=20
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=20
was without form, and void".  I took it to be a comment on today's world =

political situation  ;-).
--------End Note One-------

    You can find the program vpl2mod in the sword library source files. =
If you are using Windows there is also an already compiled version of =
vpl2mod available at =
http://www.crosswire.org/sword/ALPHAcckswwlkrfre22034820285912/alpha/ If =
you have any more questions please feel to e-mail me personally!

In Christ,
Jonathan
jhughes@crosswire.org


  Someone mentioned awhile ago about a proggy they made that converted =
verse-referenced text (i.e. Gen1:1 followed by Gen1:2 on next line, etc. =
Is this something that he is willing to share or is it available on the =
sword site? Since technically all I do is write and I feel I've =
contributed little to actual Sword development other than the occasional =
rant on Copyright issues on the Bible I'd like to play around with the =
executable to see if it will help not just to create Bible texts but can =
be adapted to help properly format personal commentaries and the like =
from my documents instead of having to do it long-handed through the =
Personal Commentary Editor.


  In Christ Jesus,
  Skip


------=_NextPart_000_00AE_01C0C9CE.921883E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Skip,</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; I am sorry it has taken so long =
to respond=20
to your question, here are some notes that another user compiled =
concerning=20
making modules for Sword:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>-----Note One-----</FONT></DIV>
<DIV>vpl2mod only works (at present) when the text file for input has =
proper=20
<BR>verse references at the beginning of each line, and the entire verse =

<BR>contained on one line (Verse-Per-Line).&nbsp; Permissible verse =
titles and=20
<BR>abbreviations can be found in the header file canon.h in the =
includes=20
<BR>directory of the Sword source.&nbsp; The refs will need to be =
something=20
like: <BR>Gen 1:1In the beginning ......<BR><BR>The executable ought to =
work=20
with two command line parameters only - <BR>but it doesn't!&nbsp; Try =
vpl2mod=20
[filename] [output-path] 1 and it will work - <BR>else, you'll get a=20
segmentation error if your compilation works like mine.<BR><BR>As =
supplied,=20
vpl2mod stops when it reaches a reference with no text =
<BR>following.&nbsp; The=20
last version I was converting (NJB) contained a number of <BR>verses in =
that=20
form - the verse text forming part of the previous verse for=20
<BR>readibility.&nbsp; To get around this, I slipped the following =
'hack' into=20
the end <BR>of the function 'parseVReg' in place of 'return buf;' (you =
need to=20
declare <BR>char *inbuf =3D buf; at the start of parseVReg):<BR><BR>if =
(!*buf)=20
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if we didn't find any =
text in=20
line<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
cout &lt;&lt; "Linefeed only found at ref: " &lt;&lt; inbuf &lt;&lt;=20
"\n";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
return=20
buf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR><BR>I found =
a wierd=20
problem with vpl2mod that I haven't sorted: in the case in <BR>point, =
the offset=20
and verse length written to ot.vss for the first verse of <BR>Genesis =
were=20
wrong.&nbsp; Everything else was OK and it seemed easier to <BR>hack =
ot.vss than=20
to debug the code.&nbsp; In the case to point, Genesis <BR>started by =
informing=20
me that "In those days, there was no King in Israel <BR>.....&nbsp; " =
(from the=20
last verse of Judges) and went on to say the "The earth <BR>was without =
form,=20
and void".&nbsp; I took it to be a comment on today's world =
<BR>political=20
situation&nbsp; ;-).<BR><FONT size=3D2>--------End Note =
One-------</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; You can find the program vpl2mod =
in the=20
sword library source files. If you are using Windows there is also an =
already=20
compiled version of vpl2mod available at <A=20
href=3D"http://www.crosswire.org/sword/ALPHAcckswwlkrfre22034820285912/al=
pha/">http://www.crosswire.org/sword/ALPHAcckswwlkrfre22034820285912/alph=
a/</A>&nbsp;If=20
you have any more questions please feel to e-mail me =
personally!</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>In Christ,</FONT></DIV>
<DIV><FONT size=3D2>Jonathan</FONT></DIV>
<DIV><FONT size=3D2><A=20
href=3D"mailto:jhughes@crosswire.org">jhughes@crosswire.org</A></FONT></D=
IV>
<DIV><FONT size=3D2></FONT><FONT size=3D2></FONT><FONT=20
size=3D2></FONT><BR>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><SPAN class=3D338421007-05042001>Someone mentioned awhile ago =
about a=20
  proggy they made that converted verse-referenced text (i.e. Gen1:1 =
followed by=20
  Gen1:2 on next line, etc. Is this something that he is willing to =
share or is=20
  it available on the sword site? Since technically all I do is write =
and I feel=20
  I've contributed little to actual Sword development other than the =
occasional=20
  rant on Copyright issues on the Bible I'd like to play around with the =

  executable to see if it will help not just to create Bible texts but =
can be=20
  adapted to help properly format personal commentaries and the like =
from my=20
  documents instead of having to do it long-handed through the Personal=20
  Commentary Editor.</SPAN></DIV>
  <DIV><SPAN class=3D338421007-05042001><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D338421007-05042001><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><STRONG>In Christ Jesus,</STRONG></DIV>
  <DIV><STRONG>Skip</STRONG></DIV>
  <DIV><FONT size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00AE_01C0C9CE.921883E0--