[sword-devel] 1.5.7 & KJV2003 releases

Troy A. Griffitts sword-devel@crosswire.org
Tue, 13 Jan 2004 10:48:24 -0700


Hey Will,
	Yeah, here's the 1.5.7 ChangeLog entries:

ftp://crosswire.org/pub/sword/source/v1.5/sword-1.5.7/ChangeLog

To expound on a few of these:

	Not sure what filters you are using exactly, but the *HTMLHREF filters 
in the engine are probably the most current.  These have been updated to 
easily facilitate the EntryAttributes for footnote and crossref popups 
in the frontend.  Basically, when there is a footnote, they remove it 
from the markup and replace it with something like:
<a href="noteID=jn3:16.n.1"><small><sup>*n</sup></small></a>

So if footnotes are turned on, they are not inline any longer.  Also 
same with crossrefs, except the 'n' is an 'x'.

In the code, GnomeSword and BibleCS allow mouse-over popups on these and 
from the example href, the code behind the scenes looks something like:

module->setKey("jn3:16");
module->RenderText(); // force lookup I think might be necessary
SWBuf footnote = module->getEntryAttributes()["Footnote"]["1"]["body"];

also, for an xref, if you would like a verselist string, the last line 
would be:

SWBuf verseList = module->getEntryAttributes()["Footnote"]["1"]["refList"];


The best way to see what is available for use in the entryAttributes is 
to run the sword/examples/cmdline/lookup program on a richly marked 
text, like:

./lookup ESV "John 1:1"


Other thing to take advantage of is 'Pre-verse Headings'.  You can see 
them in action in BibleCS, GnomeSword, and the WebTool, at:

http://crosswire.org/sword/biblenew/passagestudy.jsp

Notice the 'Testing Your Faith' at the top.  These are also done with 
EntryAttributes.  Here is the code excerpt from BibleCS.  This is in the 
loop that builds the HTML for a Chapter display.  It is just before 
adding the verse text body

                int pvHeading = 0;
                UnicodeRTF uToRTF;
                do {
                     sprintf(buf, "%i", pvHeading++);
                     SWBuf preverseHeading = 
module->getEntryAttributes()["Heading"]["Preverse"][buf].c_str(); 

                     uToRTF.processText(preverseHeading);
                     if (preverseHeading.length()) {
                          newtext += ((AnsiString)"\\par\\par {\\i1\\b1 
") + preverseHeading.c_str() + "\\par}";
                     }
                     else break;
                } while (true);

a few comments: it takes into account that there may be more than one 
preverse heading, which is never the case in any current module that I 
know of, but might be in the future-- thus the loop looking for 
["Heading"]["Preverse"]["0"] then ...["1"], etc.  It also runs the text 
thru a UnicodeRTF SWFilter, which you probably don't need to do, as your 
HTML renderer probably deals with UTF8, but our RTF renderer needs to 
deal with it in a special way.


Bibletime takes advantage of the new InstallMgr calls in the engine. 
Here is a cool set of screenshots:

http://crosswire.org/~scribe/bibletime/


Also, not sure what luck you've had with compiling clucene, but 1.5.7 
includes an option (unfortunately it went out bundled 'ON' by default), 
for linking in support for fast clucene searches.

If you get it compiled in, you can then try (and look at the calls in):

sword/utilities/mkfastmod

Which will build the indecies and turn on clucene searching (it replaces 
the 'MultiWord' search option currently) for a specific module.


Also there is an undocumented new searchtype in 1.5.7, for searching 
entry attributes.  It's been granted type -3 (don't think we assigned it 
a const define yet), and I think is the default in the search example under:

sword/examples/cmdline/search

you can try it with something like (using an example from above):

./search ESV "Footnote//body/love"

This should find all verses that have a footnote with the word 'love' in 
the body.

Possibly a more useful example might be:

"Word//Strongs/G1722"

Which will find all verses with this strong's code.  Basically you can 
search for anything, in any entry attribute data.  I needed it for a 
paper where I was assigned to find all the Greek words that were 
translated into 'save' in the English, so my search looked something like:

./search Thayer "AVPhrase//Phrase/save"

(you need to edit your thayer.conf and uncomment the GreekLexAttribs filter)


That's all I can think of right now.  Please feel free to ask questions 
in email or join us on IRC at: irc.freenode.net, channel: #sword


	Excited to show off your new stuff to my Mac friends!!!!

			-Troy.




Will Thimbleby wrote:
> Hi,
> 
> Just a quick couple of questions; apologies if they've already been 
> asked. When will the finalised KJV module be released? What does 1.5.7 
> offer over 1.5.6 and when will it be finalised. I would like to include 
> both in MacSword 0.4 but it is not important.
> 
> Cheers -Will
> 
> _______________________________________________
> sword-devel mailing list
> sword-devel@crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel