<html><head></head><body>Dear Tobias,<br><br>I haven't had a chance to dig into this yet, but my first guess is that you may be missing the intro slots from the module.<br><br>VerseKey modules have intro entries:<br><br>for the chapter if you set verse to 0<br>for the book, if you set chapter to 0<br>for the testament, if you set book to 0<br>for the module, if you set testament to 0<br><br>You'll need to module->setIntros(true) if you want to access these.<br><br>Actually, maybe even just try setIntros(true) before your headings search. The content in these entries is likely marked up as headings, as well. For your purposes, you'll need to decide if you want anything in these entries. They might be a long book introduction. The presence of intro entries, length, and type of content varies greatly between modules.<br><br>Hope this give something to try,<br><br>Troy<br><br><div class="gmail_quote">On January 6, 2022 9:41:31 AM MST, Tobias Klein <contact@tklein.info> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre dir="auto" class="k9mail">Hi Troy,<br><br>I have started looking again into extracting book headings, so that I <br>can generate a book outline in Ezra Bible App even when looking at <br>individual chapters only. I had stopped looking at it when I was not <br>successfully generating a Windows build any longer last year - but I <br>could fix that, so now the work continues.<br><br>I based my code on your example findHeadings.cpp.<br><br>It seems like the list of extracted headings is not complete, though.<br><br>When running this with the module GerNeUe and the book Acts I find that <br>the headers returned are only section headers, but not chapter headers. <br>Could you have another look based on the example and GerNeUe/Acts and <br>advise?<br><br>I have attached a list of headers that I get from the Bible text of <br>GerNeUe/Acts - just for reference.<br><br>Best regards,<br>Tobias<br><br>On 4/12/21 9:07 PM, Troy A. Griffitts wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Sure Tobias,<br><br> module->getEntryAttributes() will allow you to pull the headings from a<br> verse, and<br><br> an Entry Attributes search for '/Heading' will give you only the verses<br> with Heading entries attributes.<br><br> I've thrown together a quick example here, which you can use with<br> something like:<br><br> ./showHeadings NASB Matt-John<br><br> which will give you the headings from the Gospels.<br><br> <a href="https://crosswire.org/svn/sword/trunk/examples/tasks/findHeadings.cpp">https://crosswire.org/svn/sword/trunk/examples/tasks/findHeadings.cpp</a><br><br> Creating this example, I found I needed to fix a bug in the engine.  The<br> engine Entry Attributes search lets you search for values in the entry<br> attributes (e.g., a Strong's number 1234).  In your use case, when<br> searching, you don't care about the value; you only care about<br> presence.  This wasn't working, but simple presence can now be searched<br> for with my latest commit.<br><br> Hope this helps,<br><br> Troy<br><br><br> On 4/12/21 9:31 AM, Tobias Klein wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Hi,<br><br> I have been getting a request from a user to render section headings independently of the currently opened bible translation module.<br><br> So for example when opening the KJV still using the section/chapter headers of the NASB.<br><br> This would be useful in those cases when the respective bible translation module does not come with section/chapter headers, but another one does.<br><br> A requirement would be to efficiently extract section/chapter headers from a module using the SWORD API. As of now I only see that you can iterate over the verses of a book and individually scan each verse for the headers. Is there a more efficient way of doing that?<br><br> Another use case could be to render a book outline. This is what I am already doing now in Ezra, but in a way that is not so clean (I am traversing the DOM looking for all section header elements of the current book).<br><br> Best regards,<br> Tobias<hr> sword-devel mailing list: sword-devel@crosswire.org<br> <a href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a><br> Instructions to unsubscribe/change your settings at above page<br></blockquote><hr>sword-devel mailing list: sword-devel@crosswire.org<br><a href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page<br></blockquote></pre></blockquote></div><div style='white-space: pre-wrap'><div class='k9mail-signature'>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</div></div></body></html>