[sword-devel] SCRIPT: Covert Traditional Book Names to Short Sword Names

Peter von Kaehne refdoc at gmx.net
Mon Jul 30 23:51:21 MST 2012


> Von: Andrew Thule <thulester at gmail.com>

>  This one is shorter
> using awk not php slightly more elegant and handles books of the form
> 1 John and 1John:

You did not tell what the ultimate purpose for your conversion is, but assuming you want to create OSIS references, you might want to investigate using the sword API for doing the job. That is one of the things it is excellent at.

I created a a while ago a Perl script which translates following 

<reference>A_long_and_complicated_series_of_references_in_any_supported_language<reference>

into 

<note type="crossReference"..><reference osisRef=...>....

Where the "long and complicated series..." is broken up, translated into OSIS refs and put together into a crossreference note, with the original text as free text.

The heavy lifting is done by Sword and relies on the sword Perl bindings

It is in sword-tools/modules/crossreferences/xreffix.pl

Unfortunately the PHP bindings are in a poor state AFAIK, but maybe you can reactivate them and use them for your purposes

Yours

Peter



More information about the sword-devel mailing list