<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div>I am having problems getting a list of BibleBooks contained in some AV modules which we know do not contain certain books. I can't work out if the problem is with JSword, the modules, or osis2mod.</div>
<div><br></div><div>There are 2 related problems I can see:</div><div><ol><li>book.contains(nonExistingVerse) returns TRUE<br></li><li>book.getRawText(nonExistingVerse) returns <chapter end tag></li></ol></div></div>
<div style="font-family:arial,sans-serif;font-size:13px">Here is a simple test to show the problem using KAZ which has Synodal v11n but does not contain any deuterocanonical books:<br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div><div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>SwordBook kaz = (SwordBook)Books.installed().getBook("KAZ");</font></div><div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>Verse esd11Verse = new Verse(kaz.getVersification(), BibleBook.ESD1, 1, 1);</font></div>
<div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>System.out.println(kaz.contains(esd11Verse));<span class="" style="white-space:pre">        </span>// prints: <b>true</b></font></div><div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>System.out.println(kaz.getRawText(esd11Verse));<span class="" style="white-space:pre">        </span>// prints: <b><chapter eID="gen7" osisID="1Esd.1"/></b></font></div>
<div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>Verse esd12Verse = new Verse(kaz.getVersification(), BibleBook.ESD1, 1, 2);</font></div><div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>System.out.println(kaz.contains(esd12Verse));<span class="" style="white-space:pre">        </span>// prints: <b>true</b></font></div>
<div><font face="arial, sans-serif"> <span class="" style="white-space:pre">        </span>System.out.println(kaz.getRawText(esd12Verse));<span class="" style="white-space:pre">        </span>// prints: <b><chapter eID="gen7" osisID="1Esd.1"/></b></font></div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">So how does "<chapter eID="gen7" osisID="1Esd.1"/>" get into verse content unexpectedly?</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">It seems to me like it could be either:</div><div style="font-family:arial,sans-serif;font-size:13px">
<ol><li>a module problem; but IBT say they do not add empty verse slots<br></li><li>Sword osis2mod issue<br></li><li>JSword issue: why is JSword returning a chapter end tag instead of verse content</li></ol></div><div style="font-family:arial,sans-serif;font-size:13px">
Any ideas what might cause this problem?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks</div><div style="font-family:arial,sans-serif;font-size:13px">
Martin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 11 March 2014 12:15, DM Smith <span dir="ltr"><<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We haven't pushed this down into JSword. So far it is the responsibility of the front-end. Chris B has made it efficient to ask a Book whether it contains a Verse.<br>
<br>
Essentially, when it comes to asking a module if it has meaningful content, you want containsAny(Key verses, boolean includeIntros) and containsAny(Key verses) { return containsAny(verses, false); }<br>
<br>
I think it should ignore verse 0 by default. If it doesn't have verse content, then does the content really mean something?<br>
<br>
As you have noted contains(Key) is confusing. There are a few places where it means containsAny. Usually it means containAll. The name, contains, was chosen early as we derived from a container class where the argument was an element of the container. That is, contains is supposed to mean isMemberOf. Later we changed the inheritance as it wasn't an "is a" relationship.<br>
<br>
But we need to be careful of not introducing more confusion.<br>
<br>
By the way, the list serve was holding mail for a few days.<br>
<br>
In Him,<br>
DM<br>
<div><div class="h5"><br>
On Mar 8, 2014, at 5:26 PM, Martin Denham <<a href="mailto:mjdenham@gmail.com">mjdenham@gmail.com</a>> wrote:<br>
<br>
> Is there an efficient way to find if a BibleBook is contained in a Book (Bible or commentary) using JSword?<br>
><br>
> I recall this subject being discussed but can't recall the outcome.<br>
><br>
> Thanks<br>
> Martin<br>
</div></div>> _______________________________________________<br>
> jsword-devel mailing list<br>
> <a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>
> <a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
<br>
<br>_______________________________________________<br>
jsword-devel mailing list<br>
<a href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/jsword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/jsword-devel</a><br>
<br></blockquote></div><br></div>