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

When getting the references for a string containing multiple references separated by commas, if the reference has a prefix, the prefix could be mistaken for a chapter/verse. #135

Open avendesora opened 1 year ago

avendesora commented 1 year ago

For example, the string:

"1 Corinthians 1:1, 2 Corinthians 1:1"

Should return the following two references when getting the references:

[
    NormalizedReference(
        book=<Book.CORINTHIANS_1: 46>,
        start_chapter=1,
        start_verse=1,
        end_chapter=1,
        end_verse=1,
        end_book=None
    ),
    NormalizedReference(
        book=<Book.CORINTHIANS_2: 47>,
        start_chapter=1,
        start_verse=1,
        end_chapter=1,
        end_verse=1,
        end_book=None
    )
]

However, the "2" in 2 Corinthians is interpreted as a verse rather than part of the book title, and the following references are returned:

[
    NormalizedReference(
        book=<Book.CORINTHIANS_1: 46>,
        start_chapter=1,
        start_verse=1,
        end_chapter=1,
        end_verse=1,
        end_book=None
    ),
    NormalizedReference(
        book=<Book.CORINTHIANS_1: 46>,
        start_chapter=1,
        start_verse=2,
        end_chapter=1,
        end_verse=2,
        end_book=None
    )
]