mvnForum Homepage

Print at Sep 21, 2014 5:17:08 PM View all posts in this thread on one page
Posted by wwguo at Apr 29, 2009 7:02:03 AM
What is the command to retrieve text by args like "Genesis 1:1"
I want to write a Sword extension for Sphinx. The extension can help on Bible study by this way:

If I type
:bible:`Genesis 1:1`
in text, after compiling, the following line will be inserted:
 In the beginning God created the heavens and the earth.


So I need to know, is it possible to call a command generating the previous line with argument of "Genesis 1:1" or something similar? And if the command can select Bible texts module, such as ChiNCVs or ASV, it would be even better.

If there is no such convenient command, could you point me to some materials with which I can write a simple script. Except an API primer, I don't find any other document like man page or help file of Sword.

Posted by mdbergmann at Apr 30, 2009 3:50:25 AM
Re: What is the command to retrieve text by args like "Genesis 1:1"
IMO there is no command line tool except diatheke that can do this right away.
In the sources are some simple examples of how to do what you like:

https://crosswire.org/svn/sword/trunk/examples/simple.cpp


Regards,
Manfred

Posted by wwguo at May 1, 2009 3:03:28 AM
Re: What is the command to retrieve text by args like "Genesis 1:1"
Thank you very muchsmile

Best wishes,
Wei-Wei

Posted by thurisaz at May 10, 2011 4:16:36 PM
Re: What is the command to retrieve text by args like "Genesis 1:1"
I installed the Darby module, and then successfully compiled the simple.cpp example using a Makefile I found at the examples directory. When I run it, it doesn't print anything at all. If the module wasn't properly installed I should be getting a segmentation fault, instead the program ends normally without printing anything to STDOUT (echo $? returns 0). I'm using ubuntu 10.04, and I compiled the project from source. Any help would be greatly appreciated.

regards,
Jonathan

Posted by thurisaz at May 10, 2011 4:22:57 PM
Re: What is the command to retrieve text by args like "Genesis 1:1"
If I cast it to (const char *) as the API primer suggests as an alternative, I get garbage printed instead.

Posted by sancol52 at May 15, 2011 2:53:02 PM
Re: What is the command to retrieve text by args like "Genesis 1:1"
IMO there is no command line tool except diatheke that can do this right away.
In the sources are some simple examples of how to do what you like:

https://crosswire.org/svn/sword/trunk/examples/simple.cpp


Regards,
Manfred



Thanks for this one Manfred.