[sword-devel] How are linked verses encoded in our modules?

Troy A. Griffitts scribe at crosswire.org
Thu Nov 15 09:01:55 MST 2018


It should actually be much simpler than all this.  There actually should be a very old option called skipConsecutiveLinked on SWModule. If this is true and you ++ a module, you should get the next non-linked verse.

On November 15, 2018 7:05:06 AM MST, Greg Hellings <greg.hellings at gmail.com> wrote:
>In the olden days this was detected by incrementing to the next verse,
>calling renderText(), and doing a string comparison between it and the
>previous verse to determine if they were the same.
>
>Nowadays there is a method on SWModule named "isLinked(SWKey*,
>SWKey*)". It
>has slightly more complicated logic (it doesn't render out the text, so
>it's not susceptible to differences in filter and option settings, etc)
>and
>should be more efficient than just a string comparison. You can pass it
>two
>verse keys and it will tell you if they both point to the same entry or
>not. You need to keep two copies of two different keys, increment one,
>ask
>the module if they're linked. If they are, then keep incrementing one
>until
>you get to the next verse that isn't linked. If they are not, then set
>the
>base key equal to the incremented key and render out the next verse.
>
>--Greg
>
>On Thu, Nov 15, 2018 at 5:09 AM Peter Von Kaehne <refdoc at gmx.net>
>wrote:
>
>> How are linked verses practically encoded?
>>
>> I would like to fix the diatheke etc at some point to not put out
>> duplicate verses and I do know that xiphos etc do not do so, so what
>wouldl
>> I need to look for?
>>
>> Thanks
>>
>> Peter
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20181115/e46796cf/attachment.html>


More information about the sword-devel mailing list