Script to find a best fit v11n

DM Smith <[email protected]> Wed, 18 Jun 2025 15:50:31 -0400
Newsgroups gmane.comp.literature.sword.devel
Message-ID <[email protected]>
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: [email protected]
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page