[sword-devel] Script to find a best fit v11n
DM Smith
dmsmith at crosswire.org
Wed Jun 18 22:14:42 EDT 2025
Didn’t know about that. Sounds like a great idea. I think the modules team should include such in their module building protocol.
As I said, I don’t know python and have never programmed in it. But I can read and tweak them.
> On Jun 18, 2025, at 4:03 PM, Greg Hellings <greg.hellings at gmail.com> wrote:
>
> There has been this file, which I think I wrote a geological epoch ago: https://www.crosswire.org/svn/sword-tools/trunk/versification/av11n.py
>
> Like yours, it is a very rough attempt to brute force compare the osisIDs found in a file with known versification schemes.
>
> Unlike yours, it depends on having the Sword Python bindings installed rather than directly parsing the versification data found in the canon.h files.
>
> It is also older than old, so I can't vouch for whether it still works. But from what I can see, it was last worked on in the Python 3 era. So there is a chance that it might work. It might be worth pulling ideas from your script into the one I've written and finding the best overall solutions based on the comparisons and the mechanism for it to work.
>
> --Greg
>
> On Wed, Jun 18, 2025 at 2:50 PM DM Smith <dmsmith at crosswire.org <mailto:dmsmith at crosswire.org>> wrote:
>> Hi,
>>
>> Several have commented on how hard it is to test an OSIS xml file against v11ns especially since it goes off into an infinite loop. (I’ve posted a patch that fixes that) But it is still a process of trial and error to find an appropriate v11n.
>>
>> So, I’ve been iterating with chatGPT to create a python script to find a best fit v11n. Since I don’t know python, I can’t vouch for the script beyond it worked for a simple test case that had an extra chapter for Genesis and had some extra verses at the end of a chapter in that book.
>>
>> I offer it, as a starting place. See the attached file.
>>
>> It has a —debug flag.
>> The first argument is expected to be the OSIS xml file.
>> The second argument is optional and gives the location to the include directory of svn/sword/trunk/include with all the canon*.h files. If you don’t supply the argument, it uses the web to load the canon*.h files from https://www.crosswire.org/svn/sword/trunk/include.
>>
>> It will score the fitness of each of the v11ns. It gives the score as a %, but I don’t know what that means. I told it that it should prioritize book matches, then chapter matches and finally verse matches. I don’t know how well it did that scoring. I didn’t test for that.
>>
>> The output is alphabetized. If more than one v11n have the same high score, they are listed.
>>
>> In His Service,
>> DM
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org <mailto:sword-devel at crosswire.org>
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20250618/1f1ebdc4/attachment.htm>
More information about the sword-devel
mailing list