scripref 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.aspell.pws +22 -0
- data/Changelog +9 -0
- data/Rakefile +1 -0
- data/lib/scripref/english.rb +3 -0
- data/lib/scripref/german.rb +3 -0
- data/lib/scripref/parser.rb +4 -2
- data/lib/scripref/passage.rb +1 -5
- data/lib/scripref/processor.rb +23 -16
- data/lib/scripref.rb +1 -1
- data/regtest/formatter.rb +3 -5
- data/regtest/parser.rb +1 -2
- data/regtest/processor.rb +1 -2
- data/regtest/processor.yml +194 -169
- data/scripref.gemspec +37 -0
- data/test/test_formatter.rb +51 -51
- data/test/test_helper.rb +2 -2
- data/test/test_parser.rb +76 -68
- data/test/test_passage.rb +6 -6
- data/test/test_processor.rb +47 -18
- metadata +24 -9
data/scripref.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# stub: scripref 0.13.0 ruby lib
|
3
|
+
#
|
4
|
+
# This file is automatically generated by rim.
|
5
|
+
# PLEASE DO NOT EDIT IT DIRECTLY!
|
6
|
+
# Change the values in Rim.setup in Rakefile instead.
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = "scripref"
|
10
|
+
s.version = "0.13.0"
|
11
|
+
|
12
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
|
+
s.require_paths = ["lib"]
|
14
|
+
s.authors = ["Jan Friedrich"]
|
15
|
+
s.date = "2020-04-09"
|
16
|
+
s.description = ""
|
17
|
+
s.email = "janfri26@gmail.com"
|
18
|
+
s.files = ["./.aspell.pws", "Changelog", "LICENSE", "README.md", "Rakefile", "lib/scripref", "lib/scripref.rb", "lib/scripref/basic_methods.rb", "lib/scripref/bookname.rb", "lib/scripref/const_reader.rb", "lib/scripref/english.rb", "lib/scripref/formatter.rb", "lib/scripref/german.rb", "lib/scripref/include.rb", "lib/scripref/parser.rb", "lib/scripref/passage.rb", "lib/scripref/pipelining.rb", "lib/scripref/processor.rb", "regtest/formatter.rb", "regtest/formatter.yml", "regtest/parser.rb", "regtest/parser.yml", "regtest/processor.rb", "regtest/processor.yml", "scripref.gemspec", "test/test_bookname.rb", "test/test_english.rb", "test/test_formatter.rb", "test/test_german.rb", "test/test_helper.rb", "test/test_integration.rb", "test/test_parser.rb", "test/test_passage.rb", "test/test_pipelining.rb", "test/test_processor.rb"]
|
19
|
+
s.homepage = "https://github.com/janfri/scripref"
|
20
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
21
|
+
s.rubygems_version = "3.1.2"
|
22
|
+
s.summary = "Library for parsing scripture references in real texts."
|
23
|
+
|
24
|
+
if s.respond_to? :specification_version then
|
25
|
+
s.specification_version = 4
|
26
|
+
end
|
27
|
+
|
28
|
+
if s.respond_to? :add_runtime_dependency then
|
29
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
30
|
+
s.add_development_dependency(%q<rim>, ["~> 2.17"])
|
31
|
+
s.add_development_dependency(%q<regtest>, ["~> 2"])
|
32
|
+
else
|
33
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
34
|
+
s.add_dependency(%q<rim>, ["~> 2.17"])
|
35
|
+
s.add_dependency(%q<regtest>, ["~> 2"])
|
36
|
+
end
|
37
|
+
end
|
data/test/test_formatter.rb
CHANGED
@@ -13,105 +13,105 @@ class TestFormatter < Test::Unit::TestCase
|
|
13
13
|
|
14
14
|
def test_only_book
|
15
15
|
text = 'Ruth'
|
16
|
-
assert_formated_text_for_ast text, [pass(text
|
16
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, b2: 8)]
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_book_and_chapter
|
20
20
|
text = 'Ruth 2'
|
21
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2,
|
21
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, b2: 8, c2: 2)]
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_book_chapter_and_verse
|
25
25
|
text = 'Ruth 2,5'
|
26
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, 5)]
|
26
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5)]
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_verse_range
|
30
30
|
text = 'Ruth 2,5-11'
|
31
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, 11)]
|
31
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 11)]
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_chapter_verse_range
|
35
35
|
text = 'Ruth 2,5-3,7'
|
36
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 3, 7)]
|
36
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 3, v2: 7)]
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_chapter_range
|
40
40
|
text = 'Ruth 2-3'
|
41
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2,
|
41
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, b2: 8, c2: 3)]
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_book_range
|
45
45
|
text = '1. Mose-Offenbarung'
|
46
|
-
assert_formated_text_for_ast text, [pass(text, 1,
|
46
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 1, b2: 66)]
|
47
47
|
end
|
48
48
|
|
49
49
|
def test_book_chapter_range
|
50
50
|
text = '1. Mose 1-Offenbarung 22'
|
51
|
-
assert_formated_text_for_ast text, [pass(text, 1, 1,
|
51
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 1, c1: 1, b2: 66, c2: 22)]
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_book_chapter_verse_range
|
55
55
|
text = '1. Mose 1,1-Offenbarung 22,21'
|
56
|
-
assert_formated_text_for_ast text, [pass(text, 1, 1, 1, 66, 22, 21)]
|
56
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 1, c1: 1, v1: 1, b2: 66, c2: 22, v2: 21)]
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_one_following_verse
|
60
60
|
text = 'Ruth 2,5f'
|
61
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, :f)]
|
61
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: :f)]
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_more_following_verse
|
65
65
|
text = 'Ruth 2,5ff'
|
66
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, :ff)]
|
66
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: :ff)]
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_first_addon
|
70
70
|
text = 'Ruth 2,5a'
|
71
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, 5, a1: :a)]
|
71
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5, a1: :a)]
|
72
72
|
end
|
73
73
|
|
74
74
|
def test_second_addon
|
75
75
|
text = 'Ruth 2,5-7a'
|
76
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, 7, a2: :a)]
|
76
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 7, a2: :a)]
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_both_addons
|
80
80
|
text = 'Ruth 2,5b-7a'
|
81
|
-
assert_formated_text_for_ast text, [pass(text, 8, 2, 5, 8, 2, 7, a1: :b, a2: :a)]
|
81
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 7, a1: :b, a2: :a)]
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_reset_addons
|
85
85
|
text = 'Ruth'
|
86
|
-
assert_formated_text_for_ast text, [pass(text
|
86
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 8, b2: 8)]
|
87
87
|
end
|
88
88
|
|
89
89
|
def test_book_with_only_one_chapter
|
90
90
|
text = 'Obadja 3'
|
91
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1, 3, 31, 1, 3)]
|
91
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, v1: 3, b2: 31, c2: 1, v2: 3)]
|
92
92
|
text = 'Obadja 1'
|
93
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1, 1, 31, 1, 1)]
|
93
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, v1: 1, b2: 31, c2: 1, v2: 1)]
|
94
94
|
end
|
95
95
|
|
96
96
|
def test_book_with_only_one_chapter_range
|
97
97
|
text = 'Obadja 3-5'
|
98
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1, 3, 31, 1, 5)]
|
98
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, v1: 3, b2: 31, c2: 1, v2: 5)]
|
99
99
|
text = 'Obadja 1-4'
|
100
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1, 1, 31, 1, 4)]
|
100
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, v1: 1, b2: 31, c2: 1, v2: 4)]
|
101
101
|
end
|
102
102
|
|
103
103
|
def test_book_with_only_one_chapter_at_begin_of_range
|
104
104
|
text = 'Obadja-Jona'
|
105
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1,
|
105
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, b2: 32)]
|
106
106
|
text = 'Obadja 3-Jona 2,4'
|
107
|
-
assert_formated_text_for_ast text, [pass(text, 31, 1, 3, 32, 2, 4)]
|
107
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 31, c1: 1, v1: 3, b2: 32, c2: 2, v2: 4)]
|
108
108
|
end
|
109
109
|
|
110
110
|
def test_book_with_only_one_chapter_at_end_of_range
|
111
111
|
text = 'Amos 2,4-Obadja 3'
|
112
|
-
assert_formated_text_for_ast text, [pass(text, 30, 2, 4, 31, 1, 3)]
|
112
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 30, c1: 2, v1: 4, b2: 31, c2: 1, v2: 3)]
|
113
113
|
text = 'Amos 2,4-Obadja 1'
|
114
|
-
assert_formated_text_for_ast text, [pass(text, 30, 2, 4, 31, 1, 1)]
|
114
|
+
assert_formated_text_for_ast text, [pass(text: text, b1: 30, c1: 2, v1: 4, b2: 31, c2: 1, v2: 1)]
|
115
115
|
end
|
116
116
|
|
117
117
|
######################################################################
|
@@ -121,49 +121,49 @@ class TestFormatter < Test::Unit::TestCase
|
|
121
121
|
def test_two_books
|
122
122
|
text = 'Ruth; Markus'
|
123
123
|
t1, t2 = text.split(semi)
|
124
|
-
assert_formated_text_for_ast text, [pass(t1, 8,
|
124
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, b2: 8), semi, pass(text: t2, b1: 41, b2: 41)]
|
125
125
|
end
|
126
126
|
|
127
127
|
def test_two_complete_refs
|
128
128
|
text = 'Ruth 2,1; Markus 4,8'
|
129
129
|
t1, t2 = text.split(semi)
|
130
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 1), semi, pass(t2, 41, 4, 8, 41, 4, 8)]
|
130
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 1), semi, pass(text: t2, b1: 41, c1: 4, v1: 8, b2: 41, c2: 4, v2: 8)]
|
131
131
|
end
|
132
132
|
|
133
133
|
def test_two_refs_same_book
|
134
134
|
text = 'Ruth 2,1; 5,4'
|
135
135
|
t1, t2 = text.split(semi)
|
136
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 1), semi, pass(t2, 8, 5, 4, 8, 5, 4)]
|
136
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 1), semi, pass(text: t2, b1: 8, c1: 5, v1: 4, b2: 8, c2: 5, v2: 4)]
|
137
137
|
end
|
138
138
|
|
139
139
|
def test_two_chapters_same_book
|
140
140
|
text = 'Ruth 2; 5'
|
141
141
|
t1, t2 = text.split(semi)
|
142
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2,
|
142
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, b2: 8, c2: 2), semi, pass(text: t2, b1: 8, c1: 5, b2: 8, c2: 5)]
|
143
143
|
end
|
144
144
|
|
145
145
|
def test_two_chapters_different_book
|
146
146
|
text = 'Ruth 2; Markus 4'
|
147
147
|
t1, t2 = text.split(semi)
|
148
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2,
|
148
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, b2: 8, c2: 2), semi, pass(text: t2, b1: 41, c1: 4, b2: 41, c2: 4)]
|
149
149
|
end
|
150
150
|
|
151
151
|
def test_two_verses
|
152
152
|
text = 'Ruth 2,5.11'
|
153
153
|
t1, t2 = text.split(dot)
|
154
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 5, 8, 2, 5), dot, pass(t2, 8, 2, 11, 8, 2, 11)]
|
154
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5), dot, pass(text: t2, b1: 8, c1: 2, v1: 11, b2: 8, c2: 2, v2: 11)]
|
155
155
|
end
|
156
156
|
|
157
157
|
def test_partial_passage_after_full_passage
|
158
158
|
text = 'Ruth 2,5; 4'
|
159
159
|
t1, t2 = text.split(semi)
|
160
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 5, 8, 2, 5), semi, pass(t2, 8, 4,
|
160
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5), semi, pass(text: t2, b1: 8, c1: 4, b2: 8, c2: 4)]
|
161
161
|
text = 'Ruth 2,5; Markus'
|
162
162
|
t1, t2 = text.split(semi)
|
163
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 5, 8, 2, 5), semi, pass(t2, 41,
|
163
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5), semi, pass(text: t2, b1: 41, b2: 41)]
|
164
164
|
text = 'Ruth 2,5; Markus 4'
|
165
165
|
t1, t2 = text.split(semi)
|
166
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 5, 8, 2, 5), semi, pass(t2, 41, 4,
|
166
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 5, b2: 8, c2: 2, v2: 5), semi, pass(text: t2, b1: 41, c1: 4, b2: 41, c2: 4)]
|
167
167
|
end
|
168
168
|
|
169
169
|
######################################################################
|
@@ -173,61 +173,61 @@ class TestFormatter < Test::Unit::TestCase
|
|
173
173
|
def test_verse_range_and_separated_verse
|
174
174
|
text = 'Ruth 2,1-3.11'
|
175
175
|
t1, t2 = text.split(dot)
|
176
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 3), dot, pass(t2, 8, 2, 11, 8, 2, 11)]
|
176
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 3), dot, pass(text: t2, b1: 8, c1: 2, v1: 11, b2: 8, c2: 2, v2: 11)]
|
177
177
|
end
|
178
178
|
|
179
179
|
def test_separate_verse_and_verse_range
|
180
180
|
text = 'Ruth 2,1.3-11'
|
181
181
|
t1, t2 = text.split(dot)
|
182
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 1), dot, pass(t2, 8, 2, 3, 8, 2, 11)]
|
182
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 1), dot, pass(text: t2, b1: 8, c1: 2, v1: 3, b2: 8, c2: 2, v2: 11)]
|
183
183
|
end
|
184
184
|
|
185
185
|
def test_two_verse_ranges
|
186
186
|
text = 'Ruth 2,1-3.7-11'
|
187
187
|
t1, t2 = text.split(dot)
|
188
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 3), dot, pass(t2, 8, 2, 7, 8, 2, 11)]
|
188
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 3), dot, pass(text: t2, b1: 8, c1: 2, v1: 7, b2: 8, c2: 2, v2: 11)]
|
189
189
|
end
|
190
190
|
|
191
191
|
def test_two_verse_range_different_books
|
192
192
|
text = 'Ruth 2,1-11; Markus 4,3-7'
|
193
193
|
t1, t2 = text.split(semi)
|
194
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 11), semi, pass(t2, 41, 4, 3,41, 4, 7)]
|
194
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 11), semi, pass(text: t2, b1: 41, c1: 4, v1: 3, b2: 41, c2: 4, v2: 7)]
|
195
195
|
end
|
196
196
|
|
197
197
|
def test_two_verse_range_different_chapters
|
198
198
|
text = 'Ruth 2,1-11; 3,10-19'
|
199
199
|
t1, t2 = text.split(semi)
|
200
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 2, 1, 8, 2, 11), semi, pass(t2, 8, 3, 10, 8, 3, 19)]
|
200
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 11), semi, pass(text: t2, b1: 8, c1: 3, v1: 10, b2: 8, c2: 3, v2: 19)]
|
201
201
|
end
|
202
202
|
|
203
203
|
def test_book_range_and_following_book
|
204
204
|
text = 'Ruth-Markus; Johannes'
|
205
205
|
t1, t2 = text.split(semi)
|
206
|
-
assert_formated_text_for_ast text, [pass(t1, 8,
|
206
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, b2: 41), semi, pass(text: t2, b1: 43, b2: 43)]
|
207
207
|
end
|
208
208
|
|
209
209
|
def test_chapter_range_and_following_book
|
210
210
|
text = 'Ruth 1-2; Johannes 4'
|
211
211
|
t1, t2 = text.split(semi)
|
212
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 1,
|
212
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 1, b2: 8, c2: 2), semi, pass(text: t2, b1: 43, c1: 4, b2: 43, c2: 4)]
|
213
213
|
end
|
214
214
|
|
215
215
|
def test_chapter_range_and_following_chapter
|
216
216
|
text = 'Ruth 1-2; 4'
|
217
217
|
t1, t2 = text.split(semi)
|
218
|
-
assert_formated_text_for_ast text, [pass(t1, 8, 1,
|
218
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 8, c1: 1, b2: 8, c2: 2), semi, pass(text: t2, b1: 8, c1: 4, b2: 8, c2: 4)]
|
219
219
|
end
|
220
220
|
|
221
221
|
def test_book_only_after_full_passage
|
222
222
|
text = 'Matthäus 3,4; Markus; Johannes 3,16'
|
223
223
|
t1, t2, t3 = text.split(semi)
|
224
|
-
assert_formated_text_for_ast text, [pass(t1, 40, 3, 4, 40, 3, 4), semi, pass(t2, 41,
|
224
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 40, c1: 3, v1: 4, b2: 40, c2: 3, v2: 4), semi, pass(text: t2, b1: 41, b2: 41), semi, pass(text: t3, b1: 43, c1: 3, v1: 16, b2: 43, c2: 3, v2: 16)]
|
225
225
|
end
|
226
226
|
|
227
227
|
def test_chapter_only_after_full_passage
|
228
228
|
text = 'Matthäus 3,4; 8; Johannes 3,16'
|
229
229
|
t1, t2, t3 = text.split(semi)
|
230
|
-
assert_formated_text_for_ast text, [pass(t1, 40, 3, 4, 40, 3, 4), semi, pass(t2, 40, 8,
|
230
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 40, c1: 3, v1: 4, b2: 40, c2: 3, v2: 4), semi, pass(text: t2, b1: 40, c1: 8, b2: 40, c2: 8), semi, pass(text: t3, b1: 43, c1: 3, v1: 16, b2: 43, c2: 3, v2: 16)]
|
231
231
|
end
|
232
232
|
|
233
233
|
######################################################################
|
@@ -238,13 +238,13 @@ class TestFormatter < Test::Unit::TestCase
|
|
238
238
|
text = 'Ruth 2,1-11.15; 3,7.9-12; Markus 4; 5,3.18-21'
|
239
239
|
t1, t2, t3, t4, t5, t6, t7 = text.split(/; |\./)
|
240
240
|
ast = [
|
241
|
-
pass(t1, 8, 2, 1, 8, 2, 11), dot,
|
242
|
-
pass(t2, 8, 2, 15, 8, 2, 15), semi,
|
243
|
-
pass(t3, 8, 3, 7, 8, 3, 7), dot,
|
244
|
-
pass(t4, 8, 3, 9, 8, 3, 12), semi,
|
245
|
-
pass(t5, 41, 4,
|
246
|
-
pass(t6, 41, 5, 3, 41, 5, 3), dot,
|
247
|
-
pass(t7, 41, 5, 18, 41, 5, 21)
|
241
|
+
pass(text: t1, b1: 8, c1: 2, v1: 1, b2: 8, c2: 2, v2: 11), dot,
|
242
|
+
pass(text: t2, b1: 8, c1: 2, v1: 15, b2: 8, c2: 2, v2: 15), semi,
|
243
|
+
pass(text: t3, b1: 8, c1: 3, v1: 7, b2: 8, c2: 3, v2: 7), dot,
|
244
|
+
pass(text: t4, b1: 8, c1: 3, v1: 9, b2: 8, c2: 3, v2: 12), semi,
|
245
|
+
pass(text: t5, b1: 41, c1: 4, b2: 41, c2: 4), semi,
|
246
|
+
pass(text: t6, b1: 41, c1: 5, v1: 3, b2: 41, c2: 5, v2: 3), dot,
|
247
|
+
pass(text: t7, b1: 41, c1: 5, v1: 18, b2: 41, c2: 5, v2: 21)
|
248
248
|
]
|
249
249
|
assert_formated_text_for_ast text, ast
|
250
250
|
end
|
@@ -257,13 +257,13 @@ class TestFormatter < Test::Unit::TestCase
|
|
257
257
|
@german_formatter.bookformat = :abbrev
|
258
258
|
text = 'Mat 3,4; Mar; Joh 3,16'
|
259
259
|
t1, t2, t3 = text.split(semi)
|
260
|
-
assert_formated_text_for_ast text, [pass(t1, 40, 3, 4, 40, 3, 4), semi, pass(t2, 41,
|
260
|
+
assert_formated_text_for_ast text, [pass(text: t1, b1: 40, c1: 3, v1: 4, b2: 40, c2: 3, v2: 4), semi, pass(text: t2, b1: 41, b2: 41), semi, pass(text: t3, b1: 43, c1: 3, v1: 16, b2: 43, c2: 3, v2: 16)]
|
261
261
|
end
|
262
262
|
|
263
263
|
def test_exception_for_unhandled_bookformat
|
264
264
|
assert_raise NoMethodError do
|
265
265
|
@german_formatter.bookformat = :unknown
|
266
|
-
@german_formatter.format [pass(1,2,3,4,5,6,7)]
|
266
|
+
@german_formatter.format [pass(text: 1, b1: 2, c1: 3, v1: 4, b2: 5, c2: 6, v2: 7)]
|
267
267
|
end
|
268
268
|
end
|
269
269
|
private
|