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

Philemon is getting parsed as Philippians and is causing an error during normalization of the reference #2

Closed avendesora closed 4 years ago

avendesora commented 4 years ago

The following is throwing an error even though it is a valid reference.

import pythonbible as bible
text = "Philemon 1:9"
references = bible.get_references(text)

It is because the regular expression for the book of Philippians returns a match for this because it finds the abbreviation "Phil". We need to still support that abbreviation in Philippian's regular expression but only if it is not immediately followed by "emon".

avendesora commented 4 years ago

should be fixed now with this commit:

https://github.com/avendesora/python-bible/commit/ad97ec605fb5876ddb2fbeb346c9568153ad09ed