[sword-devel] Sword -> fortune

DM Smith dmsmith555 at yahoo.com
Tue Jul 5 17:37:48 MST 2005

Mark Trompell wrote:

> Hello, is there a way to use sword modules with fortune?
> Regards Mark

I assume you mean the old BSD fortune cookie program. I checked my 
Fedora installation and fortune is not part of that distribution. In 
looking for it, I ran across speculation that it was removed from 
RedHat's distributions because of offensive quotes. I don't know if any 
of the Christian distributions of Linux include fortune.

For fortune you will need to create a file with the quotes that you 
want. Each quote should be separated from the next by a % on a line to 
itself. The quote can be anything you want, but the typical format is 
lines of up to 80 characters. The quote is usually followed by a citation.

Once the file is created it is indexed with strfile and the files are 
placed in the directory where fortune expects the files. In looking at 
the fortune code it may be best to have several files. From a glance, it 
appears that performance is inversely proportional to the file size.

As to using sword modules, I think that there is a command line program 
that given a reference and a module, will get the content. If not it 
would be pretty easy to write one either using the C++ Sword API or the 
Java JSword API. I can help with the java program, if that is what you want.

And it would be fairly easy to have a Bible be dumped verse at a time 
into a fortune file, but it would probably be better to be selective and 
have some references be more than a single verse. As my Greek prof says, 
"Context is everything."

Random combinations can lead to something inappropriate like:
Matthew 27:5 ... [Judas] hung himself...
Luke 3:11 ... do likewise
John 13:27 ... “What you do, do quickly.”

Hope this helps,

More information about the sword-devel mailing list