avendesora / pythonbible

A python library for validating, parsing, normalizing scripture references and retrieving scripture texts (for open source and public domain versions)
https://docs.python.bible
MIT License
58 stars 11 forks source link

OSIS Parser is ignoring the seg and divineName tags #50

Closed avendesora closed 2 years ago

avendesora commented 2 years ago

The KJV OSIS XML file uses the divineName tag for LORD, but the OSISParser is currently not handling that tag or its parent seg tag, so the text within is not included in the output.

For example:

import pythonbible as bible

# 1 Chronicles 16:8
bible.get_verse_text(13016008)

The output is:

'Give thanks unto the call upon his name, make known his deeds among the people.'

But it should be:

'Give thanks unto the LORD, call upon his name, make known his deeds among the people.'

This is the input XML for that verse:

<verse osisID="1Chr.16.8" sID="1Chr.16.8.seID.11183" n="8" />
<w lemma="strong:H3034" morph="strongMorph:TH8685">Give thanks</w> 
unto the 
<seg>
    <divineName>
        <w lemma="strong:H3068">LORD</w>
    </divineName>
</seg>,
<w lemma="strong:H7121" morph="strongMorph:TH8798">call</w>
<w lemma="strong:H8034">upon his name</w>,
<w lemma="strong:H3045" morph="strongMorph:TH8685">make known</w>
<w lemma="strong:H5949">his deeds</w>
<w lemma="strong:H5971">among the people</w>.

This issue was reported via email by Nathan Wood.