[sword-devel] What is a mid-verse title?
dfhmch at googlemail.com
Tue Jun 11 00:40:05 MST 2013
The clarification of how Xiphos handles titles was doubly helpful.
It enables me to rephrase the main problem with usfm2osis.py
!!!!!! usfm2osis.py converts pre-verse titles into mid-verse titles !!!!!!
That's probably the most succinct way of putting it.
Yet it may need to be teased out a bit further to make things clearer.
Here is the logic.
After starting a verse by dropping an appropriate sID milestone,
the script continues to process USFM content until one of 3 conditions
enables it to drop the respective eID milestone into the OSIS output.
(a) the end of the file (or end of the book)
(b) the end of the chapter (i.e. the start of the next chapter)
(c) the next verse tag (in the same chapter)
By the time it reaches point (c) it has already processed
any section titles and the like.
This means that such titles (as the translator intended to be pre-verse)
are now located BEFORE the eID milestone of the previous verse.
So, although in most cases there may be no verse text following these,
they have in effect become mid-verse titles, as osis2mod sees them,
and as how SWORD and front-ends handle them thereafter.
Now understand this. This is not a deficiency in the SWORD API.
In the top level design for usfm2osis.py, the developer has made
an unwarranted assumption regarding condition (c) above.
I can readily appreciate how and why this assumption was made.
How do you know what's coming next until you get there?
i.e. Until you encounter the next verse tag, how do you know
whether or not any title tag such as \s is for a mid-verse title
or a pre-verse title? You simply don't!
Or rather you won't if you don't take measures to find out first.
That's how I understand the problem.
This is why (within a chapter) the OSIS output has no content between
the eID milestone for verse N and the sID milestone for verse N+1.
Perhaps the way forward would be to perform the processing
with two passes through the input files.
First pass would be to identify where verses end in relation to
section titles and the like, leaving a suitable temporary marker.
Second pass would be process fully, but taking account of these
That may not be the only suitable method available to skilled programmers.
View this message in context: http://sword-dev.350566.n4.nabble.com/What-is-a-mid-verse-title-tp4652476p4652501.html
Sent from the SWORD Dev mailing list archive at Nabble.com.
More information about the sword-devel