pericope 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pericope.rb +89 -134
- data/lib/pericope/data.rb +4 -0
- data/lib/pericope/version.rb +1 -1
- metadata +4 -4
- data/data/book_abbreviations.txt +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73416285e1d134c5eb40e70050467eb93db8f911
|
4
|
+
data.tar.gz: fb3c8d2c9ccee993c26c92f71e9d1cafe4dec80f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a860ac575b882282ef6c0c3cbf0cc9d1cfb6843d4df81c2b5618aed69523dae4c5b3dc25c11b736f0491a0f5939dd70b6ae957e418d87360044836343f3cadf
|
7
|
+
data.tar.gz: cafc84e2ead675fab5de26d4b1a613bc2ca1d62f9c26e93517288091f6c7c05168054c28e2d9a7ad745d8866daef3fc9001a69b411d5fb4ceff526bb4dabe431
|
data/lib/pericope.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require "pericope/version"
|
4
|
+
require "pericope/data"
|
4
5
|
|
5
6
|
class Pericope
|
6
7
|
attr_reader :book,
|
@@ -11,17 +12,6 @@ class Pericope
|
|
11
12
|
|
12
13
|
|
13
14
|
|
14
|
-
def self.book_names
|
15
|
-
load_book_abbreviations! unless defined?(@book_names)
|
16
|
-
@book_names
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.book_name_regexes
|
20
|
-
load_book_abbreviations! unless defined?(@book_name_regexes)
|
21
|
-
@book_name_regexes
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
15
|
|
26
16
|
def initialize(arg)
|
27
17
|
case arg
|
@@ -54,7 +44,7 @@ class Pericope
|
|
54
44
|
|
55
45
|
|
56
46
|
def self.book_has_chapters?(book)
|
57
|
-
|
47
|
+
BOOK_CHAPTER_COUNTS[book] > 1
|
58
48
|
end
|
59
49
|
|
60
50
|
def book_has_chapters?
|
@@ -89,8 +79,7 @@ class Pericope
|
|
89
79
|
|
90
80
|
|
91
81
|
|
92
|
-
def self.split(text
|
93
|
-
puts "DEPRECATION NOTICE: split will no longer accept a 'pattern' argument in Pericope 0.7.0" if pattern
|
82
|
+
def self.split(text)
|
94
83
|
segments = []
|
95
84
|
start = 0
|
96
85
|
|
@@ -115,39 +104,9 @@ class Pericope
|
|
115
104
|
yield pretext if block_given?
|
116
105
|
end
|
117
106
|
|
118
|
-
segments = ___split_segments_by_pattern(segments, pattern) if pattern
|
119
107
|
segments
|
120
108
|
end
|
121
109
|
|
122
|
-
def self.___split_segments_by_pattern(segments, pattern)
|
123
|
-
segments2 = []
|
124
|
-
segments.each do |segment|
|
125
|
-
if segment.is_a? Pericope
|
126
|
-
segments2 << segment
|
127
|
-
else
|
128
|
-
segments2.concat(segment.split(pattern))
|
129
|
-
end
|
130
|
-
end
|
131
|
-
segments2
|
132
|
-
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
def self.extract(text)
|
137
|
-
puts "DEPRECATION NOTICE: the 'extract' method will be removed in Pericope 0.7.0"
|
138
|
-
segments = split(text)
|
139
|
-
text = ""
|
140
|
-
pericopes = []
|
141
|
-
segments.each do |segment|
|
142
|
-
if segment.is_a?(String)
|
143
|
-
text << segment
|
144
|
-
else
|
145
|
-
pericopes << segment
|
146
|
-
end
|
147
|
-
end
|
148
|
-
{:text => text, :pericopes => pericopes}
|
149
|
-
end
|
150
|
-
|
151
110
|
|
152
111
|
|
153
112
|
def self.sub(text)
|
@@ -178,13 +137,6 @@ class Pericope
|
|
178
137
|
|
179
138
|
|
180
139
|
|
181
|
-
def report
|
182
|
-
puts "DEPRECATION NOTICE: the 'report' method will be removed in Pericope 0.7.0"
|
183
|
-
" #{self.original_string} => #{self}"
|
184
|
-
end
|
185
|
-
|
186
|
-
|
187
|
-
|
188
140
|
def to_a
|
189
141
|
# one range per chapter
|
190
142
|
chapter_ranges = []
|
@@ -279,11 +231,11 @@ class Pericope
|
|
279
231
|
|
280
232
|
def self.get_max_verse(book, chapter)
|
281
233
|
id = (book * 1000000) + (chapter * 1000)
|
282
|
-
|
234
|
+
CHAPTER_VERSE_COUNTS[id]
|
283
235
|
end
|
284
236
|
|
285
237
|
def self.get_max_chapter(book)
|
286
|
-
|
238
|
+
BOOK_CHAPTER_COUNTS[book]
|
287
239
|
end
|
288
240
|
|
289
241
|
|
@@ -294,8 +246,8 @@ private
|
|
294
246
|
|
295
247
|
def set_book(value)
|
296
248
|
@book = value || raise(ArgumentError, "must specify book")
|
297
|
-
@book_name = Pericope
|
298
|
-
@book_chapter_count = Pericope
|
249
|
+
@book_name = Pericope::BOOK_NAMES[@book]
|
250
|
+
@book_chapter_count = Pericope::BOOK_CHAPTER_COUNTS[@book]
|
299
251
|
end
|
300
252
|
|
301
253
|
|
@@ -402,11 +354,9 @@ private
|
|
402
354
|
def self.match_all(text)
|
403
355
|
text.scan(Pericope::PERICOPE_PATTERN) do
|
404
356
|
match = Regexp.last_match
|
357
|
+
book = BOOK_IDS[match.captures.find_index(&:itself)]
|
405
358
|
|
406
|
-
|
407
|
-
next unless book
|
408
|
-
|
409
|
-
ranges = parse_reference(book, match[2])
|
359
|
+
ranges = parse_reference(book, match[67])
|
410
360
|
next if ranges.empty?
|
411
361
|
|
412
362
|
attributes = {
|
@@ -419,14 +369,6 @@ private
|
|
419
369
|
end
|
420
370
|
end
|
421
371
|
|
422
|
-
def self.recognize_book(book)
|
423
|
-
book = book.to_s.downcase
|
424
|
-
book_name_regexes.each do |book_regex|
|
425
|
-
return book_regex[0] if book =~ book_regex[1]
|
426
|
-
end
|
427
|
-
nil
|
428
|
-
end
|
429
|
-
|
430
372
|
def self.parse_reference(book, reference)
|
431
373
|
reference = normalize_reference(reference)
|
432
374
|
parse_ranges(book, reference.split(/[,;]/))
|
@@ -492,76 +434,89 @@ private
|
|
492
434
|
|
493
435
|
|
494
436
|
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
437
|
+
BOOK_PATTERN = %r{\b(?:
|
438
|
+
(?:(?:3|iii|third|3rd)\s*(?:
|
439
|
+
(john|joh|jon|jhn|jh|jo|jn)
|
440
|
+
))|
|
441
|
+
(?:(?:2|ii|second|2nd)\s*(?:
|
442
|
+
(samuels|samuel|sam|sa|sm)|
|
443
|
+
(kings|king|kngs|kgs|kg|k)|
|
444
|
+
(chronicles|chronicle|chron|chrn|chr)|
|
445
|
+
(john|joh|jon|jhn|jh|jo|jn)|
|
446
|
+
(corinthians?|cor?|corint?h?|corth)|
|
447
|
+
(thessalonians?|thes{1,}|the?s?)|
|
448
|
+
(timothy|tim|tm|ti)|
|
449
|
+
(peter|pete|pet|ptr|pe|pt|pr)
|
450
|
+
))|
|
451
|
+
(?:(?:1|i|first|1st)\s*(?:
|
452
|
+
(samuels|samuel|sam|sa|sm)|
|
453
|
+
(kings|king|kngs|kgs|kg|k)|
|
454
|
+
(chronicles|chronicle|chron|chrn|chr)|
|
455
|
+
(john|joh|jon|jhn|jh|jo|jn)|
|
456
|
+
(corinthians?|cor?|corint?h?|corth)|
|
457
|
+
(thessalonians?|thes{1,}|the?s?)|
|
458
|
+
(timothy|tim|tm|ti)|
|
459
|
+
(peter|pete|pet|ptr|pe|pt|pr)
|
460
|
+
))|
|
461
|
+
(genesis|gen|gn|ge)|
|
462
|
+
(exodus|exod|exo|exd|ex)|
|
463
|
+
(leviticus|lev|levi|le|lv)|
|
464
|
+
(numbers|number|numb|num|nmb|nu|nm)|
|
465
|
+
(deuteronomy|deut|deu|dt)|
|
466
|
+
(joshua|josh|jsh|jos)|
|
467
|
+
(judges|jdgs|judg|jdg)|
|
468
|
+
(ruth|rut|rth|ru)|
|
469
|
+
(isaiah|isa|is|ia|isai|isah)|
|
470
|
+
(ezra|ezr)|
|
471
|
+
(nehemiah|neh|ne)|
|
472
|
+
(esther|esth|est|es)|
|
473
|
+
(job|jb)|
|
474
|
+
(psalms|psalm|pslms|pslm|psm|psa|ps)|
|
475
|
+
(proverbs|proverb|prov|prv|prvb|prvbs|pv)|
|
476
|
+
(ecclesiastes|eccles|eccl|ecc|ecl)|
|
477
|
+
((?:the\s?)?song\s?of\s?solomon|(?:the\s?)?song\s?of\s?songs|sn?gs?|songs?|so?s|sol?|son|s\s?of\s?\ss)|
|
478
|
+
(jeremiah?|jer?|jr|jere)|
|
479
|
+
(lamentations?|lam?|lm)|
|
480
|
+
(ezekiel|ezek|eze|ezk)|
|
481
|
+
(daniel|dan|dn|dl|da)|
|
482
|
+
(hosea|hos|ho|hs)|
|
483
|
+
(joel|jl)|
|
484
|
+
(amos|amo|ams|am)|
|
485
|
+
(obadiah|obadia|obad|oba|obd|ob)|
|
486
|
+
(jonah|jon)|
|
487
|
+
(micah|mica|mic|mi)|
|
488
|
+
(nahum|nah|nahu|na)|
|
489
|
+
(habakk?uk|habk?)|
|
490
|
+
(zephaniah?|ze?ph?)|
|
491
|
+
(haggai|ha?gg?)|
|
492
|
+
(zechariah?|ze?ch?)|
|
493
|
+
(malachi|mal)|
|
494
|
+
(matthew|matt|mat|ma|mt)|
|
495
|
+
(mark|mrk|mk)|
|
496
|
+
(luke|luk|lk|lu)|
|
497
|
+
(john|joh|jon|jhn|jh|jo|jn)|
|
498
|
+
(acts|act|ac)|
|
499
|
+
(romans|roman|roms|rom|rms|ro|rm)|
|
500
|
+
(galatians|galatian|galat|gala|gal|ga)|
|
501
|
+
(ephesians?|eph?|ephe?s?)|
|
502
|
+
(philippians?|phi?l|php|phi|philipp?)|
|
503
|
+
(colossi?ans?|col?)|
|
504
|
+
(titus|tit|ti)|
|
505
|
+
(philemon|phl?mn?|philem?)|
|
506
|
+
(hebrews|hebrew|heb)|
|
507
|
+
(james|jam|jas|jm|js|ja)|
|
508
|
+
(jude)|
|
509
|
+
(revelations|revelation|revel|rev|rv|re)
|
510
|
+
)}ix.freeze
|
511
|
+
|
512
|
+
# The order books of the Bible are matched
|
513
|
+
BOOK_IDS = [ 64, 10, 12, 14, 63, 47, 53, 55, 61, 9, 11, 13, 62, 46, 52, 54, 60, 1, 2, 3, 4, 5, 6, 7, 8, 23, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 56, 57, 58, 59, 65, 66 ].freeze
|
514
|
+
|
515
|
+
BOOK_NAMES = [nil, "Genesis", "Exodus", "Leviticus", "Numbers", "Deuteronomy", "Joshua", "Judges", "Ruth", "1 Samuel", "2 Samuel", "1 Kings", "2 Kings", "1 Chronicles", "2 Chronicles", "Ezra", "Nehemiah", "Esther", "Job", "Psalm", "Proverbs", "Ecclesiastes", "Song of Solomon", "Isaiah", "Jeremiah", "Lamentations", "Ezekiel", "Daniel", "Hosea", "Joel", "Amos", "Obadiah", "Jonah", "Micah", "Nahum", "Habakkuk", "Zephaniah", "Haggai", "Zechariah", "Malachi", "Matthew", "Mark", "Luke", "John", "Acts", "Romans", "1 Corinthians", "2 Corinthians", "Galatians", "Ephesians", "Philippians", "Colossians", "1 Thessalonians", "2 Thessalonians", "1 Timothy", "2 Timothy", "Titus", "Philemon", "Hebrews", "James", "1 Peter", "2 Peter", "1 John", "2 John", "3 John", "Jude", "Revelation"].freeze
|
561
516
|
|
562
517
|
REFERENCE_PATTERN = '(?:\s*\d{1,3})(?:\s*[:\"\.]\s*\d{1,3}[ab]?(?:\s*[,;]\s*(?:\d{1,3}[:\"\.])?\s*\d{1,3}[ab]?)*)?(?:\s*[-–—]\s*(?:\d{1,3}\s*[:\"\.])?(?:\d{1,3}[ab]?)(?:\s*[,;]\s*(?:\d{1,3}\s*[:\"\.])?\s*\d{1,3}[ab]?)*)*'
|
563
518
|
|
564
|
-
PERICOPE_PATTERN =
|
519
|
+
PERICOPE_PATTERN = /#{BOOK_PATTERN.source.gsub(/[ \n]/, "")}\.?(#{REFERENCE_PATTERN})/i
|
565
520
|
|
566
521
|
NORMALIZATIONS = [
|
567
522
|
[/(\d+)[".](\d+)/, '\1:\2'], # 12"5 and 12.5 -> 12:5
|
@@ -0,0 +1,4 @@
|
|
1
|
+
class Pericope
|
2
|
+
CHAPTER_VERSE_COUNTS = {1001000=>31, 1002000=>25, 1003000=>24, 1004000=>26, 1005000=>32, 1006000=>22, 1007000=>24, 1008000=>22, 1009000=>29, 1010000=>32, 1011000=>32, 1012000=>20, 1013000=>18, 1014000=>24, 1015000=>21, 1016000=>16, 1017000=>27, 1018000=>33, 1019000=>38, 1020000=>18, 1021000=>34, 1022000=>24, 1023000=>20, 1024000=>67, 1025000=>34, 1026000=>35, 1027000=>46, 1028000=>22, 1029000=>35, 1030000=>43, 1031000=>55, 1032000=>32, 1033000=>20, 1034000=>31, 1035000=>29, 1036000=>43, 1037000=>36, 1038000=>30, 1039000=>23, 1040000=>23, 1041000=>57, 1042000=>38, 1043000=>34, 1044000=>34, 1045000=>28, 1046000=>34, 1047000=>31, 1048000=>22, 1049000=>33, 1050000=>26, 2001000=>22, 2002000=>25, 2003000=>22, 2004000=>31, 2005000=>23, 2006000=>30, 2007000=>25, 2008000=>32, 2009000=>35, 2010000=>29, 2011000=>10, 2012000=>51, 2013000=>22, 2014000=>31, 2015000=>27, 2016000=>36, 2017000=>16, 2018000=>27, 2019000=>25, 2020000=>26, 2021000=>36, 2022000=>31, 2023000=>33, 2024000=>18, 2025000=>40, 2026000=>37, 2027000=>21, 2028000=>43, 2029000=>46, 2030000=>38, 2031000=>18, 2032000=>35, 2033000=>23, 2034000=>35, 2035000=>35, 2036000=>38, 2037000=>29, 2038000=>31, 2039000=>43, 2040000=>38, 3001000=>17, 3002000=>16, 3003000=>17, 3004000=>35, 3005000=>19, 3006000=>30, 3007000=>38, 3008000=>36, 3009000=>24, 3010000=>20, 3011000=>47, 3012000=>8, 3013000=>59, 3014000=>57, 3015000=>33, 3016000=>34, 3017000=>16, 3018000=>30, 3019000=>37, 3020000=>27, 3021000=>24, 3022000=>33, 3023000=>44, 3024000=>23, 3025000=>55, 3026000=>46, 3027000=>34, 4001000=>54, 4002000=>34, 4003000=>51, 4004000=>49, 4005000=>31, 4006000=>27, 4007000=>89, 4008000=>26, 4009000=>23, 4010000=>36, 4011000=>35, 4012000=>16, 4013000=>33, 4014000=>45, 4015000=>41, 4016000=>50, 4017000=>13, 4018000=>32, 4019000=>22, 4020000=>29, 4021000=>35, 4022000=>41, 4023000=>30, 4024000=>25, 4025000=>18, 4026000=>65, 4027000=>23, 4028000=>31, 4029000=>40, 4030000=>16, 4031000=>54, 4032000=>42, 4033000=>56, 4034000=>29, 4035000=>34, 4036000=>13, 5001000=>46, 5002000=>37, 5003000=>29, 5004000=>49, 5005000=>33, 5006000=>25, 5007000=>26, 5008000=>20, 5009000=>29, 5010000=>22, 5011000=>32, 5012000=>32, 5013000=>18, 5014000=>29, 5015000=>23, 5016000=>22, 5017000=>20, 5018000=>22, 5019000=>21, 5020000=>20, 5021000=>23, 5022000=>30, 5023000=>25, 5024000=>22, 5025000=>19, 5026000=>19, 5027000=>26, 5028000=>68, 5029000=>29, 5030000=>20, 5031000=>30, 5032000=>52, 5033000=>29, 5034000=>12, 6001000=>18, 6002000=>24, 6003000=>17, 6004000=>24, 6005000=>15, 6006000=>27, 6007000=>26, 6008000=>35, 6009000=>27, 6010000=>43, 6011000=>23, 6012000=>24, 6013000=>33, 6014000=>15, 6015000=>63, 6016000=>10, 6017000=>18, 6018000=>28, 6019000=>51, 6020000=>9, 6021000=>45, 6022000=>34, 6023000=>16, 6024000=>33, 7001000=>36, 7002000=>23, 7003000=>31, 7004000=>24, 7005000=>31, 7006000=>40, 7007000=>25, 7008000=>35, 7009000=>57, 7010000=>18, 7011000=>40, 7012000=>15, 7013000=>25, 7014000=>20, 7015000=>20, 7016000=>31, 7017000=>13, 7018000=>31, 7019000=>30, 7020000=>48, 7021000=>25, 8001000=>22, 8002000=>23, 8003000=>18, 8004000=>22, 9001000=>28, 9002000=>36, 9003000=>21, 9004000=>22, 9005000=>12, 9006000=>21, 9007000=>17, 9008000=>22, 9009000=>27, 9010000=>27, 9011000=>15, 9012000=>25, 9013000=>23, 9014000=>52, 9015000=>35, 9016000=>23, 9017000=>58, 9018000=>30, 9019000=>24, 9020000=>42, 9021000=>15, 9022000=>23, 9023000=>29, 9024000=>22, 9025000=>44, 9026000=>25, 9027000=>12, 9028000=>25, 9029000=>11, 9030000=>31, 9031000=>13, 10001000=>27, 10002000=>32, 10003000=>39, 10004000=>12, 10005000=>25, 10006000=>23, 10007000=>29, 10008000=>18, 10009000=>13, 10010000=>19, 10011000=>27, 10012000=>31, 10013000=>39, 10014000=>33, 10015000=>37, 10016000=>23, 10017000=>29, 10018000=>33, 10019000=>43, 10020000=>26, 10021000=>22, 10022000=>51, 10023000=>39, 10024000=>25, 11001000=>53, 11002000=>46, 11003000=>28, 11004000=>34, 11005000=>18, 11006000=>38, 11007000=>51, 11008000=>66, 11009000=>28, 11010000=>29, 11011000=>43, 11012000=>33, 11013000=>34, 11014000=>31, 11015000=>34, 11016000=>34, 11017000=>24, 11018000=>46, 11019000=>21, 11020000=>43, 11021000=>29, 11022000=>53, 12001000=>18, 12002000=>25, 12003000=>27, 12004000=>44, 12005000=>27, 12006000=>33, 12007000=>20, 12008000=>29, 12009000=>37, 12010000=>36, 12011000=>21, 12012000=>21, 12013000=>25, 12014000=>29, 12015000=>38, 12016000=>20, 12017000=>41, 12018000=>37, 12019000=>37, 12020000=>21, 12021000=>26, 12022000=>20, 12023000=>37, 12024000=>20, 12025000=>30, 13001000=>54, 13002000=>55, 13003000=>24, 13004000=>43, 13005000=>26, 13006000=>81, 13007000=>40, 13008000=>40, 13009000=>44, 13010000=>14, 13011000=>47, 13012000=>40, 13013000=>14, 13014000=>17, 13015000=>29, 13016000=>43, 13017000=>27, 13018000=>17, 13019000=>19, 13020000=>8, 13021000=>30, 13022000=>19, 13023000=>32, 13024000=>31, 13025000=>31, 13026000=>32, 13027000=>34, 13028000=>21, 13029000=>30, 14001000=>17, 14002000=>18, 14003000=>17, 14004000=>22, 14005000=>14, 14006000=>42, 14007000=>22, 14008000=>18, 14009000=>31, 14010000=>19, 14011000=>23, 14012000=>16, 14013000=>22, 14014000=>15, 14015000=>19, 14016000=>14, 14017000=>19, 14018000=>34, 14019000=>11, 14020000=>37, 14021000=>20, 14022000=>12, 14023000=>21, 14024000=>27, 14025000=>28, 14026000=>23, 14027000=>9, 14028000=>27, 14029000=>36, 14030000=>27, 14031000=>21, 14032000=>33, 14033000=>25, 14034000=>33, 14035000=>27, 14036000=>23, 15001000=>11, 15002000=>70, 15003000=>13, 15004000=>24, 15005000=>17, 15006000=>22, 15007000=>28, 15008000=>36, 15009000=>15, 15010000=>44, 16001000=>11, 16002000=>20, 16003000=>32, 16004000=>23, 16005000=>19, 16006000=>19, 16007000=>73, 16008000=>18, 16009000=>38, 16010000=>39, 16011000=>36, 16012000=>47, 16013000=>31, 17001000=>22, 17002000=>23, 17003000=>15, 17004000=>17, 17005000=>14, 17006000=>14, 17007000=>10, 17008000=>17, 17009000=>32, 17010000=>3, 18001000=>22, 18002000=>13, 18003000=>26, 18004000=>21, 18005000=>27, 18006000=>30, 18007000=>21, 18008000=>22, 18009000=>35, 18010000=>22, 18011000=>20, 18012000=>25, 18013000=>28, 18014000=>22, 18015000=>35, 18016000=>22, 18017000=>16, 18018000=>21, 18019000=>29, 18020000=>29, 18021000=>34, 18022000=>30, 18023000=>17, 18024000=>25, 18025000=>6, 18026000=>14, 18027000=>23, 18028000=>28, 18029000=>25, 18030000=>31, 18031000=>40, 18032000=>22, 18033000=>33, 18034000=>37, 18035000=>16, 18036000=>33, 18037000=>24, 18038000=>41, 18039000=>30, 18040000=>24, 18041000=>34, 18042000=>17, 19001000=>6, 19002000=>12, 19003000=>8, 19004000=>8, 19005000=>12, 19006000=>10, 19007000=>17, 19008000=>9, 19009000=>20, 19010000=>18, 19011000=>7, 19012000=>8, 19013000=>6, 19014000=>7, 19015000=>5, 19016000=>11, 19017000=>15, 19018000=>50, 19019000=>14, 19020000=>9, 19021000=>13, 19022000=>31, 19023000=>6, 19024000=>10, 19025000=>22, 19026000=>12, 19027000=>14, 19028000=>9, 19029000=>11, 19030000=>12, 19031000=>24, 19032000=>11, 19033000=>22, 19034000=>22, 19035000=>28, 19036000=>12, 19037000=>40, 19038000=>22, 19039000=>13, 19040000=>17, 19041000=>13, 19042000=>11, 19043000=>5, 19044000=>26, 19045000=>17, 19046000=>11, 19047000=>9, 19048000=>14, 19049000=>20, 19050000=>23, 19051000=>19, 19052000=>9, 19053000=>6, 19054000=>7, 19055000=>23, 19056000=>13, 19057000=>11, 19058000=>11, 19059000=>17, 19060000=>12, 19061000=>8, 19062000=>12, 19063000=>11, 19064000=>10, 19065000=>13, 19066000=>20, 19067000=>7, 19068000=>35, 19069000=>36, 19070000=>5, 19071000=>24, 19072000=>20, 19073000=>28, 19074000=>23, 19075000=>10, 19076000=>12, 19077000=>20, 19078000=>72, 19079000=>13, 19080000=>19, 19081000=>16, 19082000=>8, 19083000=>18, 19084000=>12, 19085000=>13, 19086000=>17, 19087000=>7, 19088000=>18, 19089000=>52, 19090000=>17, 19091000=>16, 19092000=>15, 19093000=>5, 19094000=>23, 19095000=>11, 19096000=>13, 19097000=>12, 19098000=>9, 19099000=>9, 19100000=>5, 19101000=>8, 19102000=>28, 19103000=>22, 19104000=>35, 19105000=>45, 19106000=>48, 19107000=>43, 19108000=>13, 19109000=>31, 19110000=>7, 19111000=>10, 19112000=>10, 19113000=>9, 19114000=>8, 19115000=>18, 19116000=>19, 19117000=>2, 19118000=>29, 19119000=>176, 19120000=>7, 19121000=>8, 19122000=>9, 19123000=>4, 19124000=>8, 19125000=>5, 19126000=>6, 19127000=>5, 19128000=>6, 19129000=>8, 19130000=>8, 19131000=>3, 19132000=>18, 19133000=>3, 19134000=>3, 19135000=>21, 19136000=>26, 19137000=>9, 19138000=>8, 19139000=>24, 19140000=>13, 19141000=>10, 19142000=>7, 19143000=>12, 19144000=>15, 19145000=>21, 19146000=>10, 19147000=>20, 19148000=>14, 19149000=>9, 19150000=>6, 20001000=>33, 20002000=>22, 20003000=>35, 20004000=>27, 20005000=>23, 20006000=>35, 20007000=>27, 20008000=>36, 20009000=>18, 20010000=>32, 20011000=>31, 20012000=>28, 20013000=>25, 20014000=>35, 20015000=>33, 20016000=>33, 20017000=>28, 20018000=>24, 20019000=>29, 20020000=>30, 20021000=>31, 20022000=>29, 20023000=>35, 20024000=>34, 20025000=>28, 20026000=>28, 20027000=>27, 20028000=>28, 20029000=>27, 20030000=>33, 20031000=>31, 21001000=>18, 21002000=>26, 21003000=>22, 21004000=>16, 21005000=>20, 21006000=>12, 21007000=>29, 21008000=>17, 21009000=>18, 21010000=>20, 21011000=>10, 21012000=>14, 22001000=>17, 22002000=>17, 22003000=>11, 22004000=>16, 22005000=>16, 22006000=>13, 22007000=>13, 22008000=>14, 23001000=>31, 23002000=>22, 23003000=>26, 23004000=>6, 23005000=>30, 23006000=>13, 23007000=>25, 23008000=>22, 23009000=>21, 23010000=>34, 23011000=>16, 23012000=>6, 23013000=>22, 23014000=>32, 23015000=>9, 23016000=>14, 23017000=>14, 23018000=>7, 23019000=>25, 23020000=>6, 23021000=>17, 23022000=>25, 23023000=>18, 23024000=>23, 23025000=>12, 23026000=>21, 23027000=>13, 23028000=>29, 23029000=>24, 23030000=>33, 23031000=>9, 23032000=>20, 23033000=>24, 23034000=>17, 23035000=>10, 23036000=>22, 23037000=>38, 23038000=>22, 23039000=>8, 23040000=>31, 23041000=>29, 23042000=>25, 23043000=>28, 23044000=>28, 23045000=>25, 23046000=>13, 23047000=>15, 23048000=>22, 23049000=>26, 23050000=>11, 23051000=>23, 23052000=>15, 23053000=>12, 23054000=>17, 23055000=>13, 23056000=>12, 23057000=>21, 23058000=>14, 23059000=>21, 23060000=>22, 23061000=>11, 23062000=>12, 23063000=>19, 23064000=>12, 23065000=>25, 23066000=>24, 24001000=>19, 24002000=>37, 24003000=>25, 24004000=>31, 24005000=>31, 24006000=>30, 24007000=>34, 24008000=>22, 24009000=>26, 24010000=>25, 24011000=>23, 24012000=>17, 24013000=>27, 24014000=>22, 24015000=>21, 24016000=>21, 24017000=>27, 24018000=>23, 24019000=>15, 24020000=>18, 24021000=>14, 24022000=>30, 24023000=>40, 24024000=>10, 24025000=>38, 24026000=>24, 24027000=>22, 24028000=>17, 24029000=>32, 24030000=>24, 24031000=>40, 24032000=>44, 24033000=>26, 24034000=>22, 24035000=>19, 24036000=>32, 24037000=>21, 24038000=>28, 24039000=>18, 24040000=>16, 24041000=>18, 24042000=>22, 24043000=>13, 24044000=>30, 24045000=>5, 24046000=>28, 24047000=>7, 24048000=>47, 24049000=>39, 24050000=>46, 24051000=>64, 24052000=>34, 25001000=>22, 25002000=>22, 25003000=>66, 25004000=>22, 25005000=>22, 26001000=>28, 26002000=>10, 26003000=>27, 26004000=>17, 26005000=>17, 26006000=>14, 26007000=>27, 26008000=>18, 26009000=>11, 26010000=>22, 26011000=>25, 26012000=>28, 26013000=>23, 26014000=>23, 26015000=>8, 26016000=>63, 26017000=>24, 26018000=>32, 26019000=>14, 26020000=>49, 26021000=>32, 26022000=>31, 26023000=>49, 26024000=>27, 26025000=>17, 26026000=>21, 26027000=>36, 26028000=>26, 26029000=>21, 26030000=>26, 26031000=>18, 26032000=>32, 26033000=>33, 26034000=>31, 26035000=>15, 26036000=>38, 26037000=>28, 26038000=>23, 26039000=>29, 26040000=>49, 26041000=>26, 26042000=>20, 26043000=>27, 26044000=>31, 26045000=>25, 26046000=>24, 26047000=>23, 26048000=>35, 27001000=>21, 27002000=>49, 27003000=>30, 27004000=>37, 27005000=>31, 27006000=>28, 27007000=>28, 27008000=>27, 27009000=>27, 27010000=>21, 27011000=>45, 27012000=>13, 28001000=>11, 28002000=>23, 28003000=>5, 28004000=>19, 28005000=>15, 28006000=>11, 28007000=>16, 28008000=>14, 28009000=>17, 28010000=>15, 28011000=>12, 28012000=>14, 28013000=>16, 28014000=>9, 29001000=>20, 29002000=>32, 29003000=>21, 30001000=>15, 30002000=>16, 30003000=>15, 30004000=>13, 30005000=>27, 30006000=>14, 30007000=>17, 30008000=>14, 30009000=>15, 31001000=>21, 32001000=>17, 32002000=>10, 32003000=>10, 32004000=>11, 33001000=>16, 33002000=>13, 33003000=>12, 33004000=>13, 33005000=>15, 33006000=>16, 33007000=>20, 34001000=>15, 34002000=>13, 34003000=>19, 35001000=>17, 35002000=>20, 35003000=>19, 36001000=>18, 36002000=>15, 36003000=>20, 37001000=>15, 37002000=>23, 38001000=>21, 38002000=>13, 38003000=>10, 38004000=>14, 38005000=>11, 38006000=>15, 38007000=>14, 38008000=>23, 38009000=>17, 38010000=>12, 38011000=>17, 38012000=>14, 38013000=>9, 38014000=>21, 39001000=>14, 39002000=>17, 39003000=>18, 39004000=>6, 40001000=>25, 40002000=>23, 40003000=>17, 40004000=>25, 40005000=>48, 40006000=>34, 40007000=>29, 40008000=>34, 40009000=>38, 40010000=>42, 40011000=>30, 40012000=>50, 40013000=>58, 40014000=>36, 40015000=>39, 40016000=>28, 40017000=>27, 40018000=>35, 40019000=>30, 40020000=>34, 40021000=>46, 40022000=>46, 40023000=>39, 40024000=>51, 40025000=>46, 40026000=>75, 40027000=>66, 40028000=>20, 41001000=>45, 41002000=>28, 41003000=>35, 41004000=>41, 41005000=>43, 41006000=>56, 41007000=>37, 41008000=>38, 41009000=>50, 41010000=>52, 41011000=>33, 41012000=>44, 41013000=>37, 41014000=>72, 41015000=>47, 41016000=>20, 42001000=>80, 42002000=>52, 42003000=>38, 42004000=>44, 42005000=>39, 42006000=>49, 42007000=>50, 42008000=>56, 42009000=>62, 42010000=>42, 42011000=>54, 42012000=>59, 42013000=>35, 42014000=>35, 42015000=>32, 42016000=>31, 42017000=>37, 42018000=>43, 42019000=>48, 42020000=>47, 42021000=>38, 42022000=>71, 42023000=>56, 42024000=>53, 43001000=>51, 43002000=>25, 43003000=>36, 43004000=>54, 43005000=>47, 43006000=>71, 43007000=>53, 43008000=>59, 43009000=>41, 43010000=>42, 43011000=>57, 43012000=>50, 43013000=>38, 43014000=>31, 43015000=>27, 43016000=>33, 43017000=>26, 43018000=>40, 43019000=>42, 43020000=>31, 43021000=>25, 44001000=>26, 44002000=>47, 44003000=>26, 44004000=>37, 44005000=>42, 44006000=>15, 44007000=>60, 44008000=>40, 44009000=>43, 44010000=>48, 44011000=>30, 44012000=>25, 44013000=>52, 44014000=>28, 44015000=>41, 44016000=>40, 44017000=>34, 44018000=>28, 44019000=>41, 44020000=>38, 44021000=>40, 44022000=>30, 44023000=>35, 44024000=>27, 44025000=>27, 44026000=>32, 44027000=>44, 44028000=>31, 45001000=>32, 45002000=>29, 45003000=>31, 45004000=>25, 45005000=>21, 45006000=>23, 45007000=>25, 45008000=>39, 45009000=>33, 45010000=>21, 45011000=>36, 45012000=>21, 45013000=>14, 45014000=>23, 45015000=>33, 45016000=>27, 46001000=>31, 46002000=>16, 46003000=>23, 46004000=>21, 46005000=>13, 46006000=>20, 46007000=>40, 46008000=>13, 46009000=>27, 46010000=>33, 46011000=>34, 46012000=>31, 46013000=>13, 46014000=>40, 46015000=>58, 46016000=>24, 47001000=>24, 47002000=>17, 47003000=>18, 47004000=>18, 47005000=>21, 47006000=>18, 47007000=>16, 47008000=>24, 47009000=>15, 47010000=>18, 47011000=>33, 47012000=>21, 47013000=>14, 48001000=>24, 48002000=>21, 48003000=>29, 48004000=>31, 48005000=>26, 48006000=>18, 49001000=>23, 49002000=>22, 49003000=>21, 49004000=>32, 49005000=>33, 49006000=>24, 50001000=>30, 50002000=>30, 50003000=>21, 50004000=>23, 51001000=>29, 51002000=>23, 51003000=>25, 51004000=>18, 52001000=>10, 52002000=>20, 52003000=>13, 52004000=>18, 52005000=>28, 53001000=>12, 53002000=>17, 53003000=>18, 54001000=>20, 54002000=>15, 54003000=>16, 54004000=>16, 54005000=>25, 54006000=>21, 55001000=>18, 55002000=>26, 55003000=>17, 55004000=>22, 56001000=>16, 56002000=>15, 56003000=>15, 57001000=>25, 58001000=>14, 58002000=>18, 58003000=>19, 58004000=>16, 58005000=>14, 58006000=>20, 58007000=>28, 58008000=>13, 58009000=>28, 58010000=>39, 58011000=>40, 58012000=>29, 58013000=>25, 59001000=>27, 59002000=>26, 59003000=>18, 59004000=>17, 59005000=>20, 60001000=>25, 60002000=>25, 60003000=>22, 60004000=>19, 60005000=>14, 61001000=>21, 61002000=>22, 61003000=>18, 62001000=>10, 62002000=>29, 62003000=>24, 62004000=>21, 62005000=>21, 63001000=>13, 64001000=>15, 65001000=>25, 66001000=>20, 66002000=>29, 66003000=>22, 66004000=>11, 66005000=>14, 66006000=>17, 66007000=>17, 66008000=>13, 66009000=>21, 66010000=>11, 66011000=>19, 66012000=>17, 66013000=>18, 66014000=>20, 66015000=>8, 66016000=>21, 66017000=>18, 66018000=>24, 66019000=>21, 66020000=>15, 66021000=>27, 66022000=>21}.freeze
|
3
|
+
BOOK_CHAPTER_COUNTS = [nil, 50, 40, 27, 36, 34, 24, 21, 4, 31, 24, 22, 25, 29, 36, 10, 13, 10, 42, 150, 31, 12, 8, 66, 52, 5, 48, 12, 14, 3, 9, 1, 4, 7, 3, 3, 3, 2, 14, 4, 28, 16, 24, 21, 28, 16, 16, 13, 6, 6, 4, 4, 5, 3, 6, 4, 3, 1, 13, 5, 5, 3, 5, 1, 1, 1, 22].freeze
|
4
|
+
end
|
data/lib/pericope/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pericope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Lail
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,12 +108,12 @@ files:
|
|
108
108
|
- README.mdown
|
109
109
|
- bin/console
|
110
110
|
- bin/pericope
|
111
|
-
- data/book_abbreviations.txt
|
112
111
|
- data/chapter_verse_count.txt
|
113
112
|
- lib/cli/base.rb
|
114
113
|
- lib/cli/command.rb
|
115
114
|
- lib/pericope.rb
|
116
115
|
- lib/pericope/cli.rb
|
116
|
+
- lib/pericope/data.rb
|
117
117
|
- lib/pericope/version.rb
|
118
118
|
- lib/tasks/pericope_tasks.rake
|
119
119
|
homepage: http://github.com/boblail/pericope
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.6.11
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Pericope is a gem for parsing Bible references.
|
data/data/book_abbreviations.txt
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
1 Genesis genesis gen? gn
|
2
|
-
2 Exodus exodus exo?d? ex
|
3
|
-
3 Leviticus leviticus le?v levi le
|
4
|
-
4 Numbers numbers? nu?m nu numb
|
5
|
-
5 Deuteronomy deuteronomy deut? dt
|
6
|
-
6 Joshua joshua jo?sh jos
|
7
|
-
7 Judges judges jd?gs? judg
|
8
|
-
8 Ruth ruth? ru rth
|
9
|
-
# isa is technically an abbrev for both Isaiah and 1 Samuel, but it should only be for isaiah
|
10
|
-
23 Isaiah isaiah isa? ia isa[ih]
|
11
|
-
# there's a space in '1 st', etc, because query normalization puts one in; 2 before 1 because 'samuel' matches 1 samuel
|
12
|
-
10 2 Samuel (?:2|ii|second|2 nd) ?samuels? (?:2|ii|second|2 nd) ?sa?m?
|
13
|
-
9 1 Samuel (?:(?:1|i|first|1 st) ?)?samuels? (?:1|i|first|1 st) ?sa?m?
|
14
|
-
12 2 Kings (?:2|ii|second|2 nd) ?ki?ng?s? (?:2|ii|second|2 nd) ?ki? (?:2|ii|second|2 nd) ?kgs?
|
15
|
-
11 1 Kings (?:(?:1|i|first|1 st) ?)?ki?ng?s? (?:1|i) ?ki? (?:1|i|first|1 st) ?kgs?
|
16
|
-
14 2 Chronicles (?:2|ii|second|2 nd) ?chronicles? (?:2|ii|second|2 nd) ?chr? (?:2|ii|second|2 nd) ?chro?n?
|
17
|
-
13 1 Chronicles (?:(?:1|i|first|1 st) ?)?chronicles? (?:1|i|first|1 st) ?chr? (?:1|i|first|1 st) ?chro?n?
|
18
|
-
15 Ezra ezra?
|
19
|
-
16 Nehemiah nehemiah neh?
|
20
|
-
17 Esther esther esth? es
|
21
|
-
18 Job jo?b
|
22
|
-
19 Psalm psa?lms? ps[as]?m?
|
23
|
-
20 Proverbs proverbs? pro?v? prvbs? pv
|
24
|
-
21 Ecclesiastes ecclesiastes? eccl? eccles ecl?
|
25
|
-
22 Song of Solomon (?:the ?)?song ?of ?solomon (?:the ?)?song ?of ?songs sn?gs? songs? so?s sol? son s ?of ? s
|
26
|
-
24 Jeremiah jeremiah? jer? jr jere
|
27
|
-
25 Lamentations lamentations? lam? lm
|
28
|
-
26 Ezekiel ezekiel ez[ek] ezek
|
29
|
-
27 Daniel daniel da?n dl da
|
30
|
-
28 Hosea hosea ho?s hos?
|
31
|
-
29 Joel joel? jl
|
32
|
-
30 Amos amo?s?
|
33
|
-
31 Obadiah obadiah? obad? obd?
|
34
|
-
32 Jonah jonah jon
|
35
|
-
33 Micah micah? mic?
|
36
|
-
34 Nahum nahum nah? nahu
|
37
|
-
35 Habakkuk habakk?uk habk?
|
38
|
-
36 Zephaniah zephaniah? ze?ph?
|
39
|
-
37 Haggai haggai ha?gg?
|
40
|
-
38 Zechariah zechariah? ze?ch?
|
41
|
-
39 Malachi malachi? mal
|
42
|
-
40 Matthew matthew ma?tt?
|
43
|
-
41 Mark ma?rk? mk
|
44
|
-
42 Luke luke? lk lu
|
45
|
-
# don't want john to gobble up the "jn" when they really mean 1 jn
|
46
|
-
62 1 John (?:1|i|first|1 st) ?john? (?:1|i|first|1 st) ?jh?n (?:1|i|first|1 st) ?jon? (?:1|i|first|1 st) ?jh
|
47
|
-
63 2 John (?:2|ii|second|2 nd) ?john? (?:2|ii|second|2 nd) ?jh?n (?:2|ii|second|2 nd) ?jon? (?:2|ii|second|2 nd) ?jh
|
48
|
-
64 3 John (?:3|iii|third|3 rd) ?john? (?:3|iii|third|3 rd) ?jh?n (?:3|iii|third|3 rd) ?jon? (?:3|iii|third|3 rd) ?jh
|
49
|
-
43 John john? jh?n
|
50
|
-
44 Acts acts act?
|
51
|
-
45 Romans romans? rom? rms? roms
|
52
|
-
47 2 Corinthians (?:2|ii|second|2 nd) ?corinthians? (?:2|ii|second|2 nd) ?cor? (?:2|ii) ?corint?h? (?:2|ii) ?corth
|
53
|
-
46 1 Corinthians (?:(?:1|i|first|1 st) ?)?corinthians? (?:1|i|first|1 st) ?cor? (?:1|i|first|1 st) ?corint?h? (?:1|i|first|1 st) ?corth
|
54
|
-
48 Galatians galatians? gal? galat?
|
55
|
-
49 Ephesians ephesians? eph? ephe?s?
|
56
|
-
50 Philippians philippians? phi?l php phi philipp?
|
57
|
-
51 Colossians colossi?ans? col?
|
58
|
-
53 2 Thessalonians (?:2|ii|second|2 nd) ?thessalonians? (?:2|ii|second|2 nd) ?thes{1,} (?:2|ii|second|2 nd) ?the?s?
|
59
|
-
52 1 Thessalonians (?:(?:1|i|first|1 st) ?)?thessalonians? (?:(?:1|i|first|1 st) ?)?thes{1,} (?:(?:1|i|first|1 st) ?)?the?s?
|
60
|
-
55 2 Timothy (?:2|ii|second|2 nd) ?timothy? (?:2|ii|second|2 nd) ?tim? (?:2|ii|second|2 nd) ?tm
|
61
|
-
54 1 Timothy (?:(?:1|i|first|1 st) ?)?timothy? (?:1|i|first|1 st) ?tim? (?:1|i|first|1 st) ?tm
|
62
|
-
56 Titus titus tit?
|
63
|
-
57 Philemon philemon phl?mn? philem?
|
64
|
-
58 Hebrews hebrews? heb
|
65
|
-
59 James james? ja[ms]? jms?
|
66
|
-
61 2 Peter (?:2|ii|second|2 nd) ?peter? (?:2|ii|second|2 nd) ?pe?t?r?
|
67
|
-
60 1 Peter (?:(?:1|i|first|1 st) ?)?peter? (?:1|i|first|1 st) ?pe?t?r?
|
68
|
-
65 Jude jude
|
69
|
-
66 Revelation revelations? re?v re revel
|