pericope icon indicating copy to clipboard operation
pericope copied to clipboard

Single Chapter Books - Allow book name without chapter / verse to resolve to whole book

Open jpowell opened this issue 4 years ago • 0 comments

I'd love for single chapter books to resolve just the same as a whole chapter reference. For example:

# nothing returned for this single chapter book
irb(main):020:0> Pericope.parse_one('Philemon')
=> nil
# full chapter verse range already handled for single chapter book WITHOUT chapter designation
irb(main):021:0> Pericope.parse_one('Philemon 1-25')
=> Pericope(Philemon 1–25)
irb(main):022:0> Pericope.parse_one('Ezekiel 1')
=> Pericope(Ezekiel 1)
# single chapter book could be similar to single chapter of multi chapter book
irb(main):023:0> Pericope.parse_one('Philemon 1-25').ranges
=> [57001001..57001025]
irb(main):024:0> Pericope.parse_one('Ezekiel 1').ranges
=> [26001001..26001028]

Right now we're handling this exception in a wrapper outside Pericope but would love if this was seen as a valid reference string. Thanks for the great library!

jpowell avatar Jan 06 '22 22:01 jpowell