Code Monkey home page Code Monkey logo

python-scriptures's People

Contributors

davisd avatar mcfadden avatar mlv avatar mpnordland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-scriptures's Issues

Bug in bible_re.py

('Obadiah', 'Obad', 'Obad', [21]),
should be
('Obadiah', 'Obad', 'Obad(?:iah)?', [21]),

As it stands this does not return anything
scriptures.extract('Obadiah 3')
but this does
scriptures.extract('Obad 3')

Let me know if you want a pull request.

EDIT Fix a big in my fix. :-)

Fails with format <book> <chapter> - <end chapter>:<end verse>

I'm using python-scriptures to parse sermon passages out of ID3 tags from the sermon mp3 files. I came across this passage: I Sam 28-28:2 which fails with the following trace:

Traceback (most recent call last):
  File "./mp3grabber.py", line 211, in <module>
    postSermon(u, tags)
  File "./mp3grabber.py", line 173, in postSermon
    sermon = sermon_tagger.tag_sermon(sermon, tags)     
  File "/home/micah/dev/fairwaypark/orgsermons.py", line 144, in tag_sermon
    raise e
  File "/home/micah/dev/fairwaypark/orgsermons.py", line 118, in tag_sermon
    book = extract_book(scriptures.extract(tags_text))
  File "/home/micah/dev/fairwaypark/scriptures/references.py", line 28, in extract
    references.append(normalize_reference(*r.groups()))
  File "/home/micah/dev/fairwaypark/scriptures/references.py", line 120, in normalize_reference
    or (chapter == end_chapter and end_verse < verse))):
TypeError: unorderable types: int() < NoneType()

Feature Request (literal phrases for TTS)

Hi, this is a great script, nice feature set. I was hoping this script could return how the references would be spoken literally. Example:
"1 PETER 5:5 NKJ"
Result: First Peter Chapter 5 Verse 5
"1 JOHN 3:8b CEB"
Result: First John Chapter 3 Verse 8
"2 CORINTHIANS 10:4-5 CEB "
Result: Second Corinthians Chapter 10 Verses 4 and 5
"Genesis 3:1-5"
Result: Genesis Chapter 3 Verses 1 through 5

Thanks for your work.

Support multiple related readings.

One thing that would be really useful here is the ability to chain related readings. For example, if I did:

kjv.extract("Matt 23:37-39,24:1-14")
I'd like it to return:
[(u'Matthew', 23, 37, 23, 39), (u'Matthew', 24, 1, 24, 14)]

(Actually, since Matt 23 ends at 39, better would be
[(u'Matthew', 23, 37, 24, 14)]

Right now, it ignores the 24:1-14 as it doesn't begin with a book name. I'd like it to remember the previous book name and if a book name (or chapter) is missing, assume it from the previous one.

Best would be:
kjv.extract("Matt 22,23:1-14,18,35-39,24:1-14,18")
returning
[(u'Matthew', 22, 1, 23, 14), (u'Matthew', 23, 18, 23, 18), (u'Matthew', 23, 35, 24, 14), (u'Matthew', 24, 18, 24, 18)]

I'd be happy if it required them to be consecutive. I wouldn't expect:
kjv.extract("If you look at Matt 23:10-14, you'll see one of the 15 occurrence of the word 'hypocrite'")
to give ('Matthew', '23, 10, 23, 15)

Maybe this could be a different method than extract?

Expanded Canon

Would you be willing to accept a merge request that adds the Greek Old Testament (Septuagint/LXX) books?

This would require a special case for the Psalms since the numbering is different in the LXX, Daniel because there is additional text, the addition of several books (e.g. 1-4 Maccabees), among other changes.

Recognize abbreviations with period

Would be great to be able to extract abbreviations that have a period.

For example, we currently have this:

>>> extract("Num. 1:2 and 1 John 1")
[('I John', 1, 1, 1, 10)]

would be nice to have

>>> extract("Num. 1:2 and 1 John 1")
[('Numbers', 1, 2, 1, 2), ('I John', 1, 1, 1, 10)]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.