[sword-devel] usfm2osis.py and tag \cp

Peter von Kaehne refdoc at gmx.net
Fri Oct 12 04:00:13 MST 2012


> Von: Chris Little <chrislit at crosswire.org>

> I hope I've fixed this now. (I haven't tested that it functions 
> correctly, but the error was fairly obvious from the traceback below.)

Hi Chris,

Sorry, while the crash has gone, the function is not correct - at all.

\cp is meant to give a printed chapter number which has no influence on the underlying counting of verses and chapters. How exactly to represent it in OSIS, we would need to figure out, but it should not influence the creation of subsequent osisIDs. I would think <hi type="bold"> is probably the best for our purposes. The OSIS reference is not exactly helpful at this point, nor does it reflect the reality of module making.

Right now the code does two things: It replaces in the sample below the chapter number 1 with an A for the subsequent verse's osisID ("Esth.A.1" instead of "Esth.1.1") and it leaves the \cp A in place. This is both not right - both acc OSIS reference and acc the desires of the USFM writer in my example.

> > Following minimal USFM code creates below attached error message.
> >
> > \id EST
> > \h ESTER
> > \c 1
> > \cp A
> > \s En Mordekai eh Ouraman
> > \p
> > \v 1 Mordekai,
> >

Here is the currently generated OSIS:


<?xml version="1.0" encoding="UTF-8"?>
<osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace" xmlns:xsi="h
<osisText osisRefWork="Bible" xml:lang="und" osisIDWork="Pohnapo">
<header>
<work osisWork="Pohnapo"/>
</header>
<div type="book" osisID="Esth">
<title type="runningHead">ESTER</title>
<chapter osisID="Esth.A" sID="Esth.A"/>
\cp A
<div type="section"><title>En Mordekai eh Ouraman</title>
<p>
<verse osisID="Esth.A.1" sID="Esth.A.1"/>Mordekai,<verse eID="Esth.A.1"/></p><c
</div>
</div>
</osisText>
</osis>

--------------------

I think the best way of expressing above usfm should be something along following lines:

<?xml version="1.0" encoding="UTF-8"?>
<osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace" xmlns:xsi="h
<osisText osisRefWork="Bible" xml:lang="und" osisIDWork="Pohnapo">
<header>
<work osisWork="Pohnapo"/>
</header>
<div type="book" osisID="Esth">
<title type="runningHead">ESTER</title>
<chapter osisID="Esth.1" sID="Esth.1"/>
<hi type="bold">A</hi>
<div type="section"><title>En Mordekai eh Ouraman</title>
<p>
<verse osisID="Esth.1.1" sID="Esth.1.1"/>Mordekai,<verse eID="Esth.1.1"/></p><c
</div>
</div>
</osisText>
</osis>

----------------------

The alternative would be to use one of the messy constructions shown in Appendix I of the OSIS reference for two reference systems, but this is not only very ugly, but will fail to elicit any support in the engine, nor likely gain such support within the near, mid-term or long-term future.

Yours 

Peter



More information about the sword-devel mailing list