adyeths / u2o

USFM to OSIS bible format converter.
The Unlicense
18 stars 6 forks source link

Using orefs.py to process a commentary, etc ?? #47

Open DavidHaslam opened 6 years ago

DavidHaslam commented 6 years ago

Thinking horizontally...

In theory, it should be feasible to adapt orefs.py to process an OSIS file for a work other than a Bible.

e.g. An OSIS commentary, or OSIS general book, or even a dictionary made with OSIS.

For this to be practicable, the osisRef values may need to include as a prefix the osisWork of the Bible being referred to.

OSIS 2.1.1 provides various mechanisms for a default prefix. See page 21.

In OSIS versions through 2.0, specific attributes were provided to set a default work prefix for osisIDs (osisIDWork on the osisText element) and for osisRefs (osisRefWork on the osisText element). These attributes remain available in OSIS 2.1, but a more general defaulting mechanism has been added.

In OSIS version 2.1 and later, the workPrefix element was added to make it possible to specify a default work prefix for the attributes on any element in an OSIS document. The workPrefix element appears at the end of the header, after all the work elements. Any number of workPrefix elements are allowed, each of which sets the default work prefix for a particular attribute on a particular element type. For example:

<workPrefix path="//note/@annotateRef" osisWork="Bible.KJV"/>

This declaration indicates that the default work prefix on all annotateRef attributes of note elements is to be "Bible.KJV". No colon is to be included (the colon is used to separate a work prefix from the rest of a reference when the work prefix is explicit rather than defaulted).

adyeths commented 6 years ago

While it might be possible, orefs is not designed for this purpose. It's intended as a companion to u2o. Process a bible with u2o, then add the osisRef's attributes to that bible using orefs. I suspect it would become very complicated trying to make orefs work for texts other than the bible. And I'm not sure I'm up to that particular task, at least not right now.

LAfricain commented 4 years ago

@domcorbex write a script to do this kind of job: Ref2osis.awk