<div dir="ltr"><div>Given the above explanations and that many users have already downloaded such modules I have experimented with a work-around by adding some extra logic to And Bible to specifically cater for the IBT Synodal modules.  I did this by making the assumption that all the empty verses start with: &quot;<span style="font-size:13px;font-family:arial,sans-serif">&lt;chapter eID=</span>&quot; which appears true and unique.  It is a bit of a hack but it almost worked.<br>
</div><div><br></div><div>The only problem is that after adding the extra getRawText checks it takes too long, even on my Nexus 4, to load the book list for IBT modules.  However, a simpler way to avoid the getRawText calls would be to add a</div>
<div><div>    public int SwordBook.getRawText<b>Length</b>(Key key)</div></div><div>which would be identical code to contains(Key key) (-&gt;ZVerseBackend.contains) but return verse length instead of a boolean (contains() calculates verse length to determine if a verse exists).  What do you think?  This would help because IBT empty verse stubs are very short and so normally the getRawText would not be required as part of the elaborated contains() check in And Bible.</div>
<div><br></div><div><b>Note:</b></div><div>I have discovered that this problem does not just affect deuterocanonical books in IBT Synodal modules, it also affects OT books in IBT NT-only modules e.g. KYLSC, which return text like &quot;&lt;chapter eID=&quot;gen4&quot; osisID=&quot;Gen.1&quot;/&gt;&quot;.<br>
</div><div><br></div><div>Martin</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 March 2014 14:49, DM Smith <span dir="ltr">&lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">John,<div><br></div><div>Putting this up on sword-devel, since that is a more appropriate location for the discussion to continue. This is really not about JSword, but rather about module making.</div>
<div><br><div>The nature of osis2mod is to retain all markup except &lt;verse&gt; and &lt;/verse&gt; (or their equivalent milestoned version.) This means that the markup for a chapter is put in the module&#39;s storage for that chapter and noted in the index. In the case of the chapter that is given below, it is split into 2 parts, Verse 0 and Verse 1.</div>
<div>Verse 0 will get the preamble of the chapter:</div><div>&lt;chapter osisID=&quot;EpJer.1&quot;&gt;</div><div>Verse 1 will get:</div><div>&lt;/chapter&gt;</div><div>(These will have been transformed into their milestoned versions.)</div>
<div><br></div><div>Also, verse 2 to 72 will be &quot;linked&quot; to verse 1, meaning that in the index they are given the same location as verse 1.</div><div><br></div><div>So, verse 0 has chapter start content and verse 1 to 72 have chapter end content.</div>
<div><br></div><div>Also, osis2mod does not complain if a verse is missing. Never has, never will. It does &quot;complain&quot; of a verse being present that is not in the versification. Always has, always will.</div><div>
<br></div><div><div>That emptyvss indicates that all verses are present means exactly that: All verses are present. This is not good if the module is in fact incomplete.</div><div><br></div><div>That JSword indicates that these &quot;empty&quot; verses are present means that they have non-zero length in the module.</div>
</div><div><br></div><div>JSword is graceful in handling this. It determines that the module has content for the verse by examining the index. What Martin is trying to do is find out which books, chapters and verses should be displayed to users in pick lists. The only way this can be done at this time, by either SWORD or JSword with the module in question, is to render each verse and determine that it renders nothing. This is far too expensive an operation to consider.</div>
<div><br></div><div>The only way to efficiently determine scope is to examine the index for each verse and see if the length is 0. The Scope entry in the conf has been ruled out. It would have been computed using the reverse logic of emptyvss. Go through the v11n from first verse to last and rather than noting what is missing, note what is present.</div>
<div><br></div><div>Today, most of our frontends display pick lists based on the v11n not on the module content. It has long been confusing to end users of modules that don&#39;t contain verses in the v11n.</div><div><br>
</div><div>In my view, this is a module problem. It is far easier and faster to rebuild and redistribute a module. We can tell a user to upgrade to the most recent version of a module far easier than making and releasing a code change and having them get a new version of the program. When the change is a work-around for something that shouldn&#39;t be in module, I think we should avoid that. For example, the NET Bible has some bugs that should be fixed. But instead we have some special code that is essentially: if module is NET then fix such-and-so when it occurs.</div>
<div><br></div><div>Together in His Service,</div><div><span style="white-space:pre-wrap">        </span>DM Smith</div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><div><div>On Mar 25, 2014, at 11:43 PM, John Austin &lt;<a href="mailto:gpl.programs.info@gmail.com" target="_blank">gpl.programs.info@gmail.com</a>&gt; wrote:</div>
<br><blockquote type="cite"><div style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
There has been a lot of discussion about how missing material in a v11n should be treated (the discussion of the meaning and use of Scope was part of that). Tools such as osis2mod generated warnings whenever OSIS files lacked any part of the chosen v11n. The Scope conf param was, for a time at least, the recommended method of describing what part of a v11n was covered by a module. For these reasons, many existing modules (IBT alone has at least 26 such modules) are currently encoded so as to encompass the entire v11n, returning empty-string verse content for all verses in the v11n that are not included in the module, and using the .conf Scope param to define exactly what is present in the module.<br>
<br>So even though current module making best practice may be different, it would be good for JSword to be graceful with modules that are encoded somewhat differently if at all possible, at least for a time. There are many modules out there, old and new, which don&#39;t contain the complete v11n, so determining book coverage is important.<br>
<br>-John<br><br><br><br>On 03/25/2014 08:19 PM, DM Smith wrote:<br><blockquote type="cite">Those verses exist since they are defined in the OSIS input file to<br>osis2mod. Osis2mod retains everything in its input. This is a well<br>
documented behavior of osis2mod.<br><br>The end chapter markup will be put in the last verse that is in the<br>chapter, which might be verse 0.<br><br>They should use xslt to strip empty verses, chapters and books out of<br>
their file into an intermediate file and give that as input to osis2mod.<br><br>Alternatively they can use &lt;!-- ... --&gt; to comment out huge swaths of<br>the input file.<br><br><br>-- DM<br><br>On Mar 25, 2014, at 7:48 AM, Martin Denham &lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a><br>
&lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mailto:mjdenham@gmail.com</a>&gt;&gt; wrote:<br><br><blockquote type="cite">IBT have just passed me more information regarding their handling of<br>empty verses to help clarify if this is an IBT module issue or not.<br>
The following is an extract from IBT&#39;s e-mail:<br><br>   Here are examples of how IBT&#39;s OSIS source defines empty verses in<br>   the markup:<br><br>   Empty book (Epistle of Jeremiah):<br>   &lt;div type=&quot;x-Synodal-non-canonical&quot;__&gt;&lt;div type=&quot;book&quot;<br>
   osisID=&quot;EpJer&quot;&gt;&lt;chapter osisID=&quot;EpJer.1&quot;&gt;&lt;verse sID=&quot;EpJer.1.1-72&quot;<br>   osisID=&quot;EpJer.1.1 EpJer.1.2 EpJer.1.3 EpJer.1.4 EpJer.1.5<br>   EpJer.1.6 EpJer.1.7 EpJer.1.8 EpJer.1.9 EpJer.1.10 EpJer.1.11<br>
   EpJer.1.12 EpJer.1.13 EpJer.1.14 EpJer.1.15 EpJer.1.16 EpJer.1.17<br>   EpJer.1.18 EpJer.1.19 EpJer.1.20 EpJer.1.21 EpJer.1.22 EpJer.1.23<br>   EpJer.1.24 EpJer.1.25 EpJer.1.26 EpJer.1.27 EpJer.1.28 EpJer.1.29<br>   EpJer.1.30 EpJer.1.31 EpJer.1.32 EpJer.1.33 EpJer.1.34 EpJer.1.35<br>
   EpJer.1.36 EpJer.1.37 EpJer.1.38 EpJer.1.39 EpJer.1.40 EpJer.1.41<br>   EpJer.1.42 EpJer.1.43 EpJer.1.44 EpJer.1.45 EpJer.1.46 EpJer.1.47<br>   EpJer.1.48 EpJer.1.49 EpJer.1.50 EpJer.1.51 EpJer.1.52 EpJer.1.53<br>   EpJer.1.54 EpJer.1.55 EpJer.1.56 EpJer.1.57 EpJer.1.58 EpJer.1.59<br>
   EpJer.1.60 EpJer.1.61 EpJer.1.62 EpJer.1.63 EpJer.1.64 EpJer.1.65<br>   EpJer.1.66 EpJer.1.67 EpJer.1.68 EpJer.1.69 EpJer.1.70 EpJer.1.71<br>   EpJer.1.72&quot;/&gt;&lt;verse eID=&quot;EpJer.1.1-72&quot;/&gt;&lt;/chapter&gt;__&lt;/div&gt;&lt;/div&gt;<br>
<br>   I&#39;m not sure how osis2mod handles all this when importing to the<br>   module, but it works perfectly without warnings or errors. Also,<br>   when the resulting module is passed to the &quot;emptyvss&quot; tool, it<br>
   passes this test without warnings.<br><br><br><br>On 25 March 2014 11:38, Martin Denham &lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a><br>&lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mailto:mjdenham@gmail.com</a>&gt;&gt; wrote:<br>
<br>   I am having problems getting a list of BibleBooks contained in<br>   some AV modules which we know do not contain certain books.  I<br>   can&#39;t work out if the problem is with JSword, the modules, or<br>   osis2mod.<br>
<br>   There are 2 related problems I can see:<br><br>    1. book.contains(nonExistingVerse) returns TRUE<br>    2. book.getRawText(nonExistingVerse) returns &lt;chapter end tag&gt;<br><br>   Here is a simple test to show the problem using KAZ which has<br>
   Synodal v11n but does not contain any deuterocanonical books:<br><br>   SwordBook kaz = (SwordBook)Books.installed().getBook(&quot;KAZ&quot;);<br>   Verse esd11Verse = new Verse(kaz.getVersification(),<br>   BibleBook.ESD1, 1, 1);<br>
   System.out.println(kaz.contains(esd11Verse));// prints: *true*<br>   System.out.println(kaz.getRawText(esd11Verse));// prints:<br>   *&lt;chapter eID=&quot;gen7&quot; osisID=&quot;1Esd.1&quot;/&gt;*<br>   Verse esd12Verse = new Verse(kaz.getVersification(),<br>
   BibleBook.ESD1, 1, 2);<br>   System.out.println(kaz.contains(esd12Verse));// prints: *true*<br>   System.out.println(kaz.getRawText(esd12Verse));// prints:<br>   *&lt;chapter eID=&quot;gen7&quot; osisID=&quot;1Esd.1&quot;/&gt;*<br>
<br>   So how does &quot;&lt;chapter eID=&quot;gen7&quot; osisID=&quot;1Esd.1&quot;/&gt;&quot; get into verse<br>   content unexpectedly?<br><br>   It seems to me like it could be either:<br><br>    1. a module problem; but IBT say they do not add empty verse slots<br>
    2. Sword osis2mod issue<br>    3. JSword issue: why is JSword returning a chapter end tag<br>       instead of verse content<br><br>   Any ideas what might cause this problem?<br><br>   Thanks<br>   Martin<br><br><br>
   On 11 March 2014 12:15, DM Smith &lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">dmsmith@crosswire.org</a><br>   &lt;<a href="mailto:dmsmith@crosswire.org" target="_blank">mailto:dmsmith@crosswire.org</a>&gt;&gt; wrote:<br>
<br>       We haven&#39;t pushed this down into JSword. So far it is the<br>       responsibility of the front-end. Chris B has made it efficient<br>       to ask a Book whether it contains a Verse.<br><br>       Essentially, when it comes to asking a module if it has<br>
       meaningful content, you want containsAny(Key verses, boolean<br>       includeIntros) and containsAny(Key verses) { return<br>       containsAny(verses, false); }<br><br>       I think it should ignore verse 0 by default. If it doesn&#39;t<br>
       have verse content, then does the content really mean something?<br><br>       As you have noted contains(Key) is confusing. There are a few<br>       places where it means containsAny. Usually it means<br>       containAll. The name, contains, was chosen early as we derived<br>
       from a container class where the argument was an element of<br>       the container.  That is, contains is supposed to mean<br>       isMemberOf. Later we changed the inheritance as it wasn&#39;t an<br>       &quot;is a&quot; 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><br>       On Mar 8, 2014, at 5:26 PM, Martin Denham &lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mjdenham@gmail.com</a><br>
       &lt;<a href="mailto:mjdenham@gmail.com" target="_blank">mailto:mjdenham@gmail.com</a>&gt;&gt; wrote:<br><br>       &gt; Is there an efficient way to find if a BibleBook is<br>       contained in a Book (Bible or commentary) using JSword?<br>
       &gt;<br>       &gt; I recall this subject being discussed but can&#39;t recall the<br>       outcome.<br>       &gt;<br>       &gt; Thanks<br>       &gt; Martin</blockquote></blockquote></div></blockquote></div></div>
</div></div></div></div><br>_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br></blockquote></div><br></div>