cskit 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc2a9550e46d7df48af95443aa4bd70b8a6d9f51
4
- data.tar.gz: 2c74a6f0feefde08a17af8ba7e7113e9bb97e5fa
3
+ metadata.gz: 3ac84566cea888ff9477e3bb701a61baf499aeee
4
+ data.tar.gz: a9475fd9c7387d8d822f6b48f7e4a18356ff0a12
5
5
  SHA512:
6
- metadata.gz: fa92477f03276a97d9e77964b5eb2b9ea295870d810c97037166e31a091d2fbd808227325949febebdd4efef5894344d127bb3639fbb6fd237f806fec49cba73
7
- data.tar.gz: eaad5970540813c5a6f489fa60668b15476bed1ae281d092d46898bb8a29e22766d687c400d5b2b67d0b55bbd27d4886d6b199105a98cd455319df83b8fb486e
6
+ metadata.gz: 623a052e6de8426972d65aab3034a40682710fb1e7ab592b56dafb8f10322bc99252e0158975c8f8364a40ccee273564fd7af852641326e932e55a3a82a63446
7
+ data.tar.gz: ce82b6aa1e550181d6c95ec10f72b62c3aba2a9f9ee0ffef27b34e77cfcdb808d6d71318169f4ef1814cfa69fbfa382413adb2716ca6d540d450decfba85e1cb
data/History.txt CHANGED
@@ -11,3 +11,7 @@
11
11
  * Parser rewrite.
12
12
  * Add parser tests.
13
13
  * General cleanup.
14
+
15
+ == 1.1.1
16
+
17
+ * Fix bible parser to handle books like "II Chronicles" and "Song of Solomon".
@@ -91,7 +91,7 @@ module CSKit
91
91
  end
92
92
 
93
93
  def book
94
- current.value.tap { next_token(:text) }
94
+ current.value.tap { next_token(:book, :sos, :text) }
95
95
  end
96
96
 
97
97
  def chapter_list
@@ -6,6 +6,8 @@ module CSKit
6
6
 
7
7
  class BibleTokenizer < CSKit::Parsers::Tokenizer
8
8
  PATTERNS = {
9
+ book: /\Ai{1,3}\s+[^\s\(\);:,]+/i,
10
+ sos: /\Asong\s+of\s+solomon/i,
9
11
  left_paren: /\A\(/,
10
12
  right_paren: /\A\)/,
11
13
  dash: /\A-/,
data/lib/cskit/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module CSKit
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
@@ -21,6 +21,34 @@ describe BibleParser do
21
21
  end
22
22
  end
23
23
 
24
+ context 'single chapter, single verse, numbered book name' do
25
+ let(:citation_text) { 'II Chronicles 1:1' }
26
+
27
+ it 'parses correctly' do
28
+ expect(parser.parse.to_hash).to eq({
29
+ book: 'II Chronicles', chapters: [{
30
+ chapter_number: 1, verses: [{
31
+ start: 1, finish: 1, starter: nil, terminator: nil
32
+ }]
33
+ }]
34
+ })
35
+ end
36
+ end
37
+
38
+ context 'single chapter, single verse, Song of Solomon' do
39
+ let(:citation_text) { 'Song of Solomon 1:1' }
40
+
41
+ it 'parses correctly' do
42
+ expect(parser.parse.to_hash).to eq({
43
+ book: 'Song of Solomon', chapters: [{
44
+ chapter_number: 1, verses: [{
45
+ start: 1, finish: 1, starter: nil, terminator: nil
46
+ }]
47
+ }]
48
+ })
49
+ end
50
+ end
51
+
24
52
  context 'single chapter, verse range' do
25
53
  let(:citation_text) { 'Genesis 1:1-5' }
26
54
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cskit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-04 00:00:00.000000000 Z
11
+ date: 2017-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json