[sword-devel] Building GenBooks programatically

Ben Morgan benpmorgan at gmail.com
Fri Jun 8 00:44:45 MST 2007


Hi Troy,

Thanks for you help. That makes it a bit clearer. However, I have had a
number of problems:
1. Under linux, genbookutil doesn't seem to work on anything not in the
current path
So running ./genbookutil genbook/genbook won't work properly. The behaviour
it causes is rather peculiar. If you type in c (append child) and then type
in the child name and press enter it won't do anything, and will just let
you keep on typing
2. Under windows, doing genbookutil.exe genbook/genbook when the folder
genbook doesn't exist will crash it (version 1.5.9)
3.  I can't make it work under 1.5.9 (it crashes (or segfaults under linux)
on rendering text). I copied a session done that way:

[utilities]$ ./genbookutil a
> [] > c
> Enter New Child Name: test
> [/test] > t
> Enter New Entry Text ('.' on a line by itself to end):
> test
> .
> [/test] > v
>
> Segmentation fault


However, I did manage to get it working under python if I did it correctly (
i.e. svn version and current directory). How do I install it to a standard
location? Is it best just to use standard copying procedures, and write my
own mods.d file?

Is there any way to link entries with GenBooks? My current gospel harmony
program uses my own tree structure (for dividing into sections and
subsections), and finds verses within the harmony by iterating through the
tree and checking whether the verse is in the ranges for that section. I was
wondering whether it is possible to get the program which makes the modules
to put links in so that I could do something like:

harmony = Sword.RawGenBook("harmony")
vk = Sword.VerseKey("Matt 3:10")
harmony.setKey(vk)
harmony.getKeyText()
and now output the thing in the tree structure that Matthew 3:10 links to.
In this case, it might be Section 9: Jesus' Baptism
and then do:
harmony.RenderText()
and get "<reference osisId='Matt.3.5-15'>Matthew
3:5-15</reference><reference osisId='Luke.3.1-23'>Luke 3:1-23</reference>"
(or whatever)

However, when I got the tree key and iterated through it, I would not want
the verse entries to show up.

Is anything like this possible to do?

I managed to get the checking for invalid queries like Genesis 5:3-foo:bar
by using a call to VerseKey::convertToOSIS and matching a regex on it. Not
neat, but it worked (there is no access to SWKey::userData from python, so I
couldn't do it the way convertToOSIS does). Thanks for that help.


God Bless,
Ben
-------------------------------------------------------------------------------------------
"Blessed is he who expects nothing, for he shall never be disappointed."
Jonathan Swift
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20070608/4ea7c672/attachment.html 


More information about the sword-devel mailing list