refdoc / Module-tools

Scripts and tools for SWORD module conversions
5 stars 3 forks source link

usfm2osis.py doesn't convert well the \r marker #12

Open LAfricain opened 7 years ago

LAfricain commented 7 years ago

I have some reference in konnym, example: \r (Mc 1, 2-6; Lc 3, 1-6; Jn 1, 19-23) If I run usfm2osis.py I have this result: <title type="parallel"><reference type="parallel">(Mc 1, 2-6; Lc 3, 1-6; Jn 1, 19-23)</reference></title><chapter eID="Matt.3"/> But, this result is expected: <title type="parallel"><reference osisRef="Mk.1.2-6">(Mc 1, 2-6; </reference><reference osisRef="Lk.3.1-6">Lc 3, 1-6; </reference><reference osisRef="Jn.1.19-23">Jn 1, 19-23)</reference></title> I tinkered with sed: find . -name "*osis.xml" -exec sed -i 's/type="parallel"><reference type="parallel">/type="parallel"><reference osisRef="">/g' {} \; and ubuntu french forum people to fix that, but it's not very practical, maybe the python script from pingouinux will help you.

DavidHaslam commented 7 years ago

Cross-References (including those in parallel passage headings) almost always require further post-processing.

This requires having access to the locale file for the target language in order to interpret localised book names and abbreviations.

This is not a straightforward task. It's not actually covered in the OSIS conversion Python script.

Even the Perl script that the modules team uses for fixing xrefs has its own problems.

The proper context for this issue should be that Perl script rather than usfm2osis.py

DavidHaslam commented 7 years ago

There are issues in your expected outcome too.

Punctuation that's part of the xref note, but not truly part of an xref should be placed outside the XML reference elements.