codexparser 0.0.85 → 0.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.
Files changed (113) hide show
  1. package/package.json +1 -1
  2. package/src/CodexParser.js +301 -187
  3. package/src/abbr.js +1 -1
  4. package/src/bible.js +1 -0
  5. package/src/chapterVerseCombine.js +63 -0
  6. package/src/chapter_verses/1chronicles.js +31 -0
  7. package/src/chapter_verses/1corinthians.js +18 -0
  8. package/src/chapter_verses/1john.js +7 -0
  9. package/src/chapter_verses/1kings.js +24 -0
  10. package/src/chapter_verses/1peter.js +7 -0
  11. package/src/chapter_verses/1samuel.js +33 -0
  12. package/src/chapter_verses/1thessalonians.js +7 -0
  13. package/src/chapter_verses/1timothy.js +8 -0
  14. package/src/chapter_verses/2chronicles.js +38 -0
  15. package/src/chapter_verses/2corinthians.js +15 -0
  16. package/src/chapter_verses/2kings.js +27 -0
  17. package/src/chapter_verses/2peter.js +5 -0
  18. package/src/chapter_verses/2samuel.js +26 -0
  19. package/src/chapter_verses/2thessalonians.js +5 -0
  20. package/src/chapter_verses/2timothy.js +6 -0
  21. package/src/chapter_verses/acts.js +30 -0
  22. package/src/chapter_verses/amos.js +11 -0
  23. package/src/chapter_verses/colossians.js +6 -0
  24. package/src/chapter_verses/daniel.js +14 -0
  25. package/src/chapter_verses/deuteronomy.js +36 -0
  26. package/src/chapter_verses/ecclesiastes.js +14 -0
  27. package/src/chapter_verses/ephesians.js +8 -0
  28. package/src/chapter_verses/esther.js +12 -0
  29. package/src/chapter_verses/exodus.js +42 -0
  30. package/src/chapter_verses/ezekiel.js +50 -0
  31. package/src/chapter_verses/ezra.js +12 -0
  32. package/src/chapter_verses/galatians.js +8 -0
  33. package/src/chapter_verses/genesis.js +52 -0
  34. package/src/chapter_verses/habakkuk.js +5 -0
  35. package/src/chapter_verses/haggai.js +4 -0
  36. package/src/chapter_verses/hebrews.js +15 -0
  37. package/src/chapter_verses/hosea.js +16 -0
  38. package/src/chapter_verses/isaiah.js +68 -0
  39. package/src/chapter_verses/james.js +7 -0
  40. package/src/chapter_verses/jeremiah.js +54 -0
  41. package/src/chapter_verses/job.js +44 -0
  42. package/src/chapter_verses/joel.js +5 -0
  43. package/src/chapter_verses/john.js +23 -0
  44. package/src/chapter_verses/jonah.js +6 -0
  45. package/src/chapter_verses/joshua.js +26 -0
  46. package/src/chapter_verses/judges.js +23 -0
  47. package/src/chapter_verses/lamentations.js +7 -0
  48. package/src/chapter_verses/leviticus.js +29 -0
  49. package/src/chapter_verses/luke.js +26 -0
  50. package/src/chapter_verses/malachi.js +6 -0
  51. package/src/chapter_verses/mark.js +18 -0
  52. package/src/chapter_verses/matthew.js +30 -0
  53. package/src/chapter_verses/micah.js +9 -0
  54. package/src/chapter_verses/nahum.js +5 -0
  55. package/src/chapter_verses/nehemiah.js +15 -0
  56. package/src/chapter_verses/numbers.js +38 -0
  57. package/src/chapter_verses/philippians.js +6 -0
  58. package/src/chapter_verses/proverbs.js +33 -0
  59. package/src/chapter_verses/psalms.js +152 -0
  60. package/src/chapter_verses/revelation.js +24 -0
  61. package/src/chapter_verses/romans.js +18 -0
  62. package/src/chapter_verses/ruth.js +6 -0
  63. package/src/chapter_verses/songs.js +10 -0
  64. package/src/chapter_verses/titus.js +5 -0
  65. package/src/chapter_verses/zechariah.js +16 -0
  66. package/src/chapter_verses/zephaniah.js +5 -0
  67. package/src/versifications/1chronicles.js +592 -0
  68. package/src/versifications/1kings.js +492 -0
  69. package/src/versifications/1samuel.js +202 -0
  70. package/src/versifications/2chronicles.js +167 -0
  71. package/src/versifications/2samuel.js +222 -0
  72. package/src/versifications/daniel.js +332 -0
  73. package/src/versifications/deuteronomy.js +347 -0
  74. package/src/versifications/ecclesiastes.js +102 -0
  75. package/src/versifications/exodus.js +837 -0
  76. package/src/versifications/ezekiel.js +222 -0
  77. package/src/versifications/genesis.js +192 -0
  78. package/src/versifications/hosea.js +207 -0
  79. package/src/versifications/isaiah.js +167 -0
  80. package/src/versifications/jeremiah.js +3892 -0
  81. package/src/versifications/job.js +172 -0
  82. package/src/versifications/joel.js +132 -0
  83. package/src/versifications/jonah.js +57 -0
  84. package/src/versifications/joshua.js +22 -0
  85. package/src/versifications/leviticus.js +152 -0
  86. package/src/versifications/malachi.js +32 -0
  87. package/src/versifications/micah.js +77 -0
  88. package/src/versifications/nahum.js +72 -0
  89. package/src/versifications/nehemiah.js +312 -0
  90. package/src/versifications/numbers.js +382 -0
  91. package/src/versifications/proverbs.js +17 -0
  92. package/src/versifications/psalms.js +12059 -0
  93. package/src/versifications/song.js +72 -0
  94. package/src/versifications/zechariah.js +87 -0
  95. package/src/versified.js +28 -619
  96. package/all-scripture-test.js +0 -19
  97. package/bible-loopthrough-test.js +0 -8
  98. package/chapter-range-test.js +0 -5
  99. package/find-test.js +0 -20
  100. package/jstester.js +0 -329
  101. package/mcleanTest.js +0 -14
  102. package/quicktest.js +0 -5
  103. package/regex-tester.js +0 -32
  104. package/scan-test.js +0 -10
  105. package/src/CodexParser-javascript.js +0 -317
  106. package/src/bookRegex.regex +0 -1
  107. package/sub-verse-scripture-test.js +0 -16
  108. package/tests/abbreviated_verses.js +0 -8
  109. package/tests/bcv-single-test.js +0 -19
  110. package/tests/bcv_test.js +0 -14
  111. package/tests/find.js +0 -8
  112. package/tests/single.js +0 -10
  113. package/tests/versification.js +0 -8
package/jstester.js DELETED
@@ -1,329 +0,0 @@
1
- const BibleParser = require("./src/CodexParser.js")
2
- const parser = new BibleParser()
3
- const books = [
4
- "Gen",
5
- "Ge",
6
- "Gn",
7
- "Exo",
8
- "Ex",
9
- "Exod",
10
- "Lev",
11
- "Le",
12
- "Lv",
13
- "Num",
14
- "Nu",
15
- "Nm",
16
- "Nb",
17
- "Deut",
18
- "Dt",
19
- "Josh",
20
- "Jos",
21
- "Jsh",
22
- "Judg",
23
- "Jdg",
24
- "Jg",
25
- "Jdgs",
26
- "Rth",
27
- "Ru",
28
- "Sam",
29
- "Samuel",
30
- "Kings",
31
- "Kgs",
32
- "Kin",
33
- "Chron",
34
- "Chronicles",
35
- "Ezra",
36
- "Ezr",
37
- "Ez",
38
- "Neh",
39
- "Ne",
40
- "Esth",
41
- "Es",
42
- "Job",
43
- "Job",
44
- "Jb",
45
- "Pslm",
46
- "Ps",
47
- "Psalms",
48
- "Psa",
49
- "Psm",
50
- "Pss",
51
- "Prov",
52
- "Pr",
53
- "Prv",
54
- "Eccles",
55
- "Ec",
56
- "Song",
57
- "So",
58
- "Canticles",
59
- "Song of Songs",
60
- "SOS",
61
- "Isa",
62
- "Is",
63
- "Jer",
64
- "Je",
65
- "Jr",
66
- "Lam",
67
- "La",
68
- "Ezek",
69
- "Eze",
70
- "Ezk",
71
- "Dan",
72
- "Da",
73
- "Dn",
74
- "Hos",
75
- "Ho",
76
- "Joel",
77
- "Joe",
78
- "Jl",
79
- "Amos",
80
- "Am",
81
- "Obad",
82
- "Ob",
83
- "Jnh",
84
- "Jon",
85
- "Micah",
86
- "Mic",
87
- "Nah",
88
- "Na",
89
- "Hab",
90
- "Zeph",
91
- "Zep",
92
- "Zp",
93
- "Haggai",
94
- "Hag",
95
- "Hg",
96
- "Zech",
97
- "Zec",
98
- "Zc",
99
- "Mal",
100
- "Mal",
101
- "Ml",
102
- "Matt",
103
- "Mt",
104
- "Mrk",
105
- "Mk",
106
- "Mr",
107
- "Luk",
108
- "Lk",
109
- "John",
110
- "Jn",
111
- "Jhn",
112
- "Acts",
113
- "Ac",
114
- "Rom",
115
- "Ro",
116
- "Rm",
117
- "Co",
118
- "Cor",
119
- "Corinthians",
120
- "Gal",
121
- "Ga",
122
- "Ephes",
123
- "Eph",
124
- "Phil",
125
- "Php",
126
- "Col",
127
- "Col",
128
- "Th",
129
- "Thes",
130
- "Thess",
131
- "Thessalonians",
132
- "Ti",
133
- "Tim",
134
- "Timothy",
135
- "Titus",
136
- "Tit",
137
- "Philem",
138
- "Phm",
139
- "Hebrews",
140
- "Heb",
141
- "He",
142
- "James",
143
- "Jas",
144
- "Jm",
145
- "Pe",
146
- "Pet",
147
- "Pt",
148
- "Peter",
149
- "Jn",
150
- "Jo",
151
- "Joh",
152
- "Jhn",
153
- "John",
154
- "Jude",
155
- "Jd",
156
- "Jud",
157
- "Jud",
158
- "Rev",
159
- "The Revelation",
160
- "Genesis",
161
- "Exodus",
162
- "Leviticus",
163
- "Numbers",
164
- "Deuteronomy",
165
- "Joshua",
166
- "Judges",
167
- "Ruth",
168
- "Samuel",
169
- "Kings",
170
- "Chronicles",
171
- "Ezra",
172
- "Nehemiah",
173
- "Esther",
174
- "Job",
175
- "Psalms",
176
- "Psalm",
177
- "Proverbs",
178
- "Ecclesiastes",
179
- "Song of Solomon",
180
- "Isaiah",
181
- "Jeremiah",
182
- "Lamentations",
183
- "Ezekiel",
184
- "Daniel",
185
- "Hosea",
186
- "Joel",
187
- "Amos",
188
- "Obadiah",
189
- "Jonah",
190
- "Micah",
191
- "Nahum",
192
- "Habakkuk",
193
- "Zephaniah",
194
- "Haggai",
195
- "Zechariah",
196
- "Malachi",
197
- "Matthew",
198
- "Mark",
199
- "Luke",
200
- "John",
201
- "Acts",
202
- "Romans",
203
- "Corinthians",
204
- "Galatians",
205
- "Ephesians",
206
- "Philippians",
207
- "Colossians",
208
- "Thessalonians",
209
- "Timothy",
210
- "Titus",
211
- "Philemon",
212
- "Hebrews",
213
- "James",
214
- "Peter",
215
- "John",
216
- "Revelation",
217
- "Re",
218
- "Ap",
219
- "Jd.",
220
- "Heb.",
221
- ]
222
-
223
- const preStrings = ["III", "II", "I", "1st", "2nd", "3rd", "First", "Second", "Third", "1", "2", "3"]
224
- const preStringed = [
225
- "Sam",
226
- "Samuel",
227
- "Kings",
228
- "Kgs",
229
- "Kin",
230
- "Chron",
231
- "Chronicles",
232
- "Corinthians",
233
- "Co",
234
- "Cor",
235
- "Thessalonians",
236
- "Th",
237
- "Thes",
238
- "Thess",
239
- "Timothy",
240
- "Ti",
241
- "Tim",
242
- "Peter",
243
- "Pe",
244
- "Pet",
245
- "Pt",
246
- "John",
247
- "Jn",
248
- "Jhn",
249
- ]
250
- let text = `Joel 10:13 The passages Luke 2:32 and Lk 1:23 that we are looking at tonight 1 Cor 12:34 2 Cor 3:4 are found Jude 6, in Jude 5, Genesis 2:1 - 3:19, 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles. Ps 109:4,5,6,8. Isaiah 61.2-3 Mt 5.4
251
-
252
- Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3
253
-
254
- Jd. 5
255
- Jd 6
256
-
257
- 1 Cor 12:34 2 Cor 3:4. He 4.12 Re 1.16
258
-
259
- Leviticus 16:6 He 5.3 He 7.27
260
-
261
- Hos 10:1-3, 8 and 1 John 2:23
262
-
263
- exod15.18. 2 Cor 12:23 Malachi 3:32`
264
- //add the prestringed versions e.g. 1 Peter
265
- for (let b = 0; b < preStringed.length; b++) {
266
- for (let pre = 0; pre < preStrings.length; pre++) {
267
- books.push(preStrings[pre] + " " + preStringed[b])
268
- }
269
- }
270
- // add the book name with . at the end as this seems to be added sometimes, at least to the shortened forms
271
- const length = books.length
272
- for (let b = 0; b < length; b++) {
273
- books.push(books[b] + ".")
274
- }
275
-
276
- // sort descending - longer items first
277
- books.sort((a, b) => b.length - a.length)
278
- let booksAt = []
279
- // go thro' each book finding where it matches in text
280
- for (let b = 0; b < books.length; b++) {
281
- const book = books[b]
282
- let chNoInText = 0
283
- while (chNoInText < text.length) {
284
- let j = text.indexOf(book, chNoInText)
285
- if (j < 0) break
286
- if (j + book.length < text.length && !text.charAt(j + book.length).match(/^[a-z]+$/)) {
287
- booksAt.push([book, j])
288
- let replacement = book
289
- for (let k = 0; k < book.length; k++) {
290
- replacement = replacement.replace(book.charAt(k), "X")
291
- }
292
- text = text.replace(book, replacement) // to prevent a shorter version matching
293
- }
294
- chNoInText = j + book.length + 1
295
- }
296
- }
297
- // into ascending order of start position
298
- booksAt.sort(function (a, b) {
299
- return a[1] - b[1]
300
- })
301
- newText = ""
302
- let chNoInText = 0
303
-
304
- let passages = []
305
- for (let b = 0; b < booksAt.length; b++) {
306
- while (chNoInText < booksAt[b][1]) {
307
- //copy across characters to start of book
308
- newText += text.charAt(chNoInText)
309
- chNoInText++
310
- }
311
- newText += "<span class='passage'>" + booksAt[b][0]
312
- let passage = booksAt[b][0]
313
- chNoInText += booksAt[b][0].length //skip the 'fill-in characters
314
- for (let i = 0; i < 100; i++) {
315
- chNoInText++
316
- const nextCh = text.charAt(chNoInText)
317
- //test whether are at the end of the chapter(s) and verse(s)
318
- if (nextCh.match(/^[a-z]+$/)) break
319
- if (nextCh.match(/^[A-Z]+$/)) break
320
- newText += text.charAt(chNoInText - 1)
321
- passage += text.charAt(chNoInText - 1)
322
- }
323
- passages.push(passage.trim())
324
- newText += "</span>&nbsp;"
325
- }
326
-
327
- const found = parser.find(text)
328
-
329
-
package/mcleanTest.js DELETED
@@ -1,14 +0,0 @@
1
- const BibleParser = require("./src/CodexParser.js")
2
- const util = require("util")
3
-
4
- const dump = (item) => {
5
- console.log(util.inspect(item, { depth: null, colors: true }))
6
- }
7
-
8
- const parser = new BibleParser()
9
-
10
- const text =
11
- "Gen 1:1 - Jos Ant 1:27; Just Apol 1:59, 64; Mel Pasc 47; Ph Aet 19; Her 122; Opif 26-27; Theoph 2.10 Allusions Jn 1:1; Heb 11:3; DialSav 127:20; 4Ez 6:38; Mel Pasc 104; Ph QuGen 4:215; Opif 29; Mos 2:266; Plant 86; Praem 1; Sacrif 8; PrMan 2; Prov 8:22; Tat 5"
12
-
13
- parser.find(text)
14
- dump(parser.getPassages())
package/quicktest.js DELETED
@@ -1,5 +0,0 @@
1
- const BibleParser = require("./src/CodexParser.js")
2
- const string = "Ezra 1:20 Ezk 23:22"
3
- const parser = new BibleParser()
4
- const result = parser.parse(string)
5
- console.log(result.getPassages())
package/regex-tester.js DELETED
@@ -1,32 +0,0 @@
1
- const CodexParser = require("./src/CodexParser")
2
- const util = require("util")
3
-
4
- const dump = (item) => {
5
- console.log(util.inspect(item, { depth: null, colors: true }))
6
- }
7
-
8
- const parser = new CodexParser()
9
- const passage = "jer 9.24 1 cor 1.31 Jd 1"
10
- let text = `Joel 10:13 The passages Luke 2:32 and Lk 1:23 that we are looking at tonight 1 Cor 12:34 2 Cor 3:4 are found Jude 6, in Jude 5, Genesis 2:1 - 3:19. 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles. Ps 109:4,5,6,8. Isaiah 61.2-3 Mt 5.4
11
-
12
- Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3
13
-
14
- Jd. 5
15
- Jd 6
16
-
17
- 1Cor 12:34 2 Cor 3:4. He 4.12 Re 1.16
18
-
19
- Leviticus 16:6 He 5.3 He 7.27
20
-
21
- Hos 10:1-3, 8 and 1 John 2:23
22
-
23
- exod15.18. 2 Cor 12:23 Malachi 3:32 Hebrews 9:20; 10:29; 13:20 2 Kings 4:8,17-37 Psalm 113-118`
24
-
25
- const philemon = "Phlm 1 Phlm 1:2 Philemon 1:3 Phil 2:3 Phile 7"
26
-
27
- const ez = "Ezekiel 12:3 Ezek 1:2 Ezk 2:2 Ezra 1:1 Ezr 1:2 Ez 3:4-5"
28
-
29
- const noSpace = "1 Thess 2.15-16"
30
-
31
- parser.regex(text).regexParser()
32
- dump(parser.getPassages())
package/scan-test.js DELETED
@@ -1,10 +0,0 @@
1
- const BibleParser = require("./src/CodexParser.js")
2
- const util = require("util")
3
-
4
- const dump = (item) => {
5
- console.log(util.inspect(item, { depth: null, colors: true }))
6
- }
7
- let text = `Psalm 94:4-100:6 MT`
8
- const parser = new BibleParser()
9
- const result = parser.find(text).enhance()
10
- dump(result)
@@ -1,317 +0,0 @@
1
- const books = [
2
- "Gen",
3
- "Ge",
4
- "Gn",
5
- "Exo",
6
- "Ex",
7
- "Exod",
8
- "Lev",
9
- "Le",
10
- "Lv",
11
- "Num",
12
- "Nu",
13
- "Nm",
14
- "Nb",
15
- "Deut",
16
- "Dt",
17
- "Josh",
18
- "Jos",
19
- "Jsh",
20
- "Judg",
21
- "Jdg",
22
- "Jg",
23
- "Jdgs",
24
- "Rth",
25
- "Ru",
26
- "Sam",
27
- "Samuel",
28
- "Kings",
29
- "Kgs",
30
- "Kin",
31
- "Chron",
32
- "Chronicles",
33
- "Ezra",
34
- "Ezr",
35
- "Ez",
36
- "Neh",
37
- "Ne",
38
- "Esth",
39
- "Es",
40
- "Job",
41
- "Job",
42
- "Jb",
43
- "Pslm",
44
- "Ps",
45
- "Psalms",
46
- "Psa",
47
- "Psm",
48
- "Pss",
49
- "Prov",
50
- "Pr",
51
- "Prv",
52
- "Eccles",
53
- "Ec",
54
- "Song",
55
- "So",
56
- "Canticles",
57
- "Song of Songs",
58
- "SOS",
59
- "Isa",
60
- "Is",
61
- "Jer",
62
- "Je",
63
- "Jr",
64
- "Lam",
65
- "La",
66
- "Ezek",
67
- "Eze",
68
- "Ezk",
69
- "Dan",
70
- "Da",
71
- "Dn",
72
- "Hos",
73
- "Ho",
74
- "Joel",
75
- "Joe",
76
- "Jl",
77
- "Amos",
78
- "Am",
79
- "Obad",
80
- "Ob",
81
- "Jnh",
82
- "Jon",
83
- "Micah",
84
- "Mic",
85
- "Nah",
86
- "Na",
87
- "Hab",
88
- "Zeph",
89
- "Zep",
90
- "Zp",
91
- "Haggai",
92
- "Hag",
93
- "Hg",
94
- "Zech",
95
- "Zec",
96
- "Zc",
97
- "Mal",
98
- "Mal",
99
- "Ml",
100
- "Matt",
101
- "Mt",
102
- "Mrk",
103
- "Mk",
104
- "Mr",
105
- "Luk",
106
- "Lk",
107
- "John",
108
- "Jn",
109
- "Jhn",
110
- "Acts",
111
- "Ac",
112
- "Rom",
113
- "Ro",
114
- "Rm",
115
- "Co",
116
- "Cor",
117
- "Corinthians",
118
- "Gal",
119
- "Ga",
120
- "Ephes",
121
- "Eph",
122
- "Phil",
123
- "Php",
124
- "Col",
125
- "Col",
126
- "Th",
127
- "Thes",
128
- "Thess",
129
- "Thessalonians",
130
- "Ti",
131
- "Tim",
132
- "Timothy",
133
- "Titus",
134
- "Tit",
135
- "Philem",
136
- "Phm",
137
- "Hebrews",
138
- "Heb",
139
- "He",
140
- "James",
141
- "Jas",
142
- "Jm",
143
- "Pe",
144
- "Pet",
145
- "Pt",
146
- "Peter",
147
- "Jn",
148
- "Jo",
149
- "Joh",
150
- "Jhn",
151
- "John",
152
- "Jude",
153
- "Jd",
154
- "Jud",
155
- "Jud",
156
- "Rev",
157
- "The Revelation",
158
- "Genesis",
159
- "Exodus",
160
- "Leviticus",
161
- "Numbers",
162
- "Deuteronomy",
163
- "Joshua",
164
- "Judges",
165
- "Ruth",
166
- "Samuel",
167
- "Kings",
168
- "Chronicles",
169
- "Ezra",
170
- "Nehemiah",
171
- "Esther",
172
- "Job",
173
- "Psalms",
174
- "Psalm",
175
- "Proverbs",
176
- "Ecclesiastes",
177
- "Song of Solomon",
178
- "Isaiah",
179
- "Jeremiah",
180
- "Lamentations",
181
- "Ezekiel",
182
- "Daniel",
183
- "Hosea",
184
- "Joel",
185
- "Amos",
186
- "Obadiah",
187
- "Jonah",
188
- "Micah",
189
- "Nahum",
190
- "Habakkuk",
191
- "Zephaniah",
192
- "Haggai",
193
- "Zechariah",
194
- "Malachi",
195
- "Matthew",
196
- "Mark",
197
- "Luke",
198
- "John",
199
- "Acts",
200
- "Romans",
201
- "Corinthians",
202
- "Galatians",
203
- "Ephesians",
204
- "Philippians",
205
- "Colossians",
206
- "Thessalonians",
207
- "Timothy",
208
- "Titus",
209
- "Philemon",
210
- "Hebrews",
211
- "James",
212
- "Peter",
213
- "John",
214
- "Revelation",
215
- "Re",
216
- "Ap",
217
- "Jd.",
218
- "Heb.",
219
- ]
220
-
221
- const preStrings = ["III", "II", "I", "1st", "2nd", "3rd", "First", "Second", "Third", "1", "2", "3"]
222
- const preStringed = [
223
- "Sam",
224
- "Samuel",
225
- "Kings",
226
- "Kgs",
227
- "Kin",
228
- "Chron",
229
- "Chronicles",
230
- "Corinthians",
231
- "Co",
232
- "Cor",
233
- "Thessalonians",
234
- "Th",
235
- "Thes",
236
- "Thess",
237
- "Timothy",
238
- "Ti",
239
- "Tim",
240
- "Peter",
241
- "Pe",
242
- "Pet",
243
- "Pt",
244
- "John",
245
- "Jn",
246
- "Jhn",
247
- ]
248
- let text = `Joel 10:13 The passages Luke 2:32 and Lk 1:23 that we are looking at tonight 1 Cor 12:34 2 Cor 3:4 are found Jude 6, in Jude 5, Genesis 2:1 - 3:19, 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles. Ps 109:4,5,6,8. Isaiah 61.2-3 Mt 5.4
249
-
250
- Ge 27.27-29,89-40 Heb 11.20 Heb. 12.17 Jonah 3
251
-
252
- Jd. 5
253
- Jd 6
254
-
255
- 1 Cor 12:34 2 Cor 3:4. He 4.12 Re 1.16
256
-
257
- Leviticus 16:6 He 5.3 He 7.27
258
-
259
- Hos 10:1-3, 8 and 1 John 2:23`
260
- //add the prestringed versions e.g. 1 Peter
261
- for (let b = 0; b < preStringed.length; b++) {
262
- for (let pre = 0; pre < preStrings.length; pre++) {
263
- books.push(preStrings[pre] + " " + preStringed[b])
264
- }
265
- }
266
- // add the book name with . at the end as this seems to be added sometimes, at least to the shortened forms
267
- const length = books.length
268
- for (let b = 0; b < length; b++) {
269
- books.push(books[b] + ".")
270
- }
271
-
272
- // sort descending - longer items first
273
- books.sort((a, b) => b.length - a.length)
274
- let booksAt = []
275
- // go thro' each book finding where it matches in text
276
- for (let b = 0; b < books.length; b++) {
277
- const book = books[b]
278
- let chNoInText = 0
279
- while (chNoInText < text.length) {
280
- let j = text.indexOf(book, chNoInText)
281
- if (j < 0) break
282
- if (j + book.length < text.length && !text.charAt(j + book.length).match(/^[a-z]+$/)) {
283
- booksAt.push([book, j])
284
- let replacement = book
285
- for (let k = 0; k < book.length; k++) {
286
- replacement = replacement.replace(book.charAt(k), "X")
287
- }
288
- text = text.replace(book, replacement) // to prevent a shorter version matching
289
- }
290
- chNoInText = j + book.length + 1
291
- }
292
- }
293
- // into ascending order of start position
294
- booksAt.sort(function (a, b) {
295
- return a[1] - b[1]
296
- })
297
- newText = ""
298
- let chNoInText = 0
299
- for (let b = 0; b < booksAt.length; b++) {
300
- while (chNoInText < booksAt[b][1]) {
301
- //copy across characters to start of book
302
- newText += text.charAt(chNoInText)
303
- chNoInText++
304
- }
305
- newText += "<span>" + booksAt[b][0] + "</span><span>"
306
- chNoInText += booksAt[b][0].length //skip the 'fill-in characters
307
- for (let i = 0; i < 100; i++) {
308
- chNoInText++
309
- const nextCh = text.charAt(chNoInText)
310
- //test whether are at the end of the chapter(s) and verse(s)
311
- if (nextCh.match(/^[a-z]+$/)) break
312
- if (nextCh.match(/^[A-Z]+$/)) break
313
- newText += text.charAt(chNoInText - 1)
314
- }
315
- newText += "</span>&nbsp;"
316
- }
317
- document.querySelector("div").innerHTML = newText
@@ -1 +0,0 @@
1
- Genesis|Gen|Ge|Gn|Ex|Exo|Exod|Exodus|Exodus|Leviticus|Lev|Le|Lv|Numbers|Num|Nu|Deuteronomy|Dt|Dt|Joshua|Josh|Jsh|Judges|Jdg|Jdg|Ruth|Rth|Ru|1 Samuel|1 Sam|1 Sa|1 S|I Sam|I Sa|1Sam|1Sa|1S|1st Samuel|1st Sam|First Samuel|First Sam|2 Samuel|2 Sam|2 Sa|2 S|II Sam|II Sa|2Sam|2Sa|2S|2nd Samuel|2nd Sam|Second Samuel|Second Sam|1 Kings|1 Kgs|1 Ki|1Kgs|1Kin|1Ki|1K|I Kgs|I Ki|1st Kings|1st Kgs|2 Kings|2 Kgs|2 Ki|2Kgs|2Kin|2Ki|2K|II Kgs|II Ki|2nd Kings|2nd Kgs|1 Chronicles|1 Chron|1 Chr|1 Ch|1Chron|1Chr|1Ch|I Chron|I Chr|I Ch|1st Chronicles|1st Chron|First Chronicles|First Chron|2 Chronicles|2 Chron|2 Chr|2 Ch|2Chron|2Chr|2Ch|II Chron|II Chr|II Ch|2nd Chronicles|2nd Chron|Second Chronicles|Second Chron|Ezra|Ezr|Ezr|Ez|Nehemiah|Neh|Ne|Esther|Esth|Es|Job|Jb|Job|Jb|Psalms|Ps|Psalm|Pslm|Psa|Psm|Pss|Proverbs|Prov|Pro|Prv|Pr|Ecclesiastes|Eccles|Eccle|Ecc|Ec|Qoh|Song of Solomon|Song|SOS|So|Canticle of Canticles|Canticles|Cant|Isaiah|Isa|Is|Jeremiah|Jer|Je|Jr|Lamentations|Lam|La|Ezekiel|Ezek|Eze|Ezk|Daniel|Dan|Da|Dn|Hosea|Hos|Ho|Joel|Joel|Jl|Amos|Amos|Am|Obadiah|Obad|Ob|Jonah|Jonah|Jnh|Jon|Micah|Mic|Mc|Nahum|Nah|Na|Habakkuk|Hab|Hb|Zephaniah|Zeph|Zep|Zp|Haggai|Hag|Hg|Zechariah|Zechar|Zech|Zec|Zc|Malachi|Mal|Ml|Matthew|Matt|Mt|Mark|Mrk|Mar|Mk|Mr|Luke|Luk|Lk|John|Joh|Jhn|Jn|Acts|Act|Ac|Romans|Rom|Ro|Rm1Corinthians|1Cor|1Co|ICor|ICo|1Cor|1Co|ICorinthians|1Corinthians|1stCorinthians|FirstCorinthians|2Corinthians|2 Cor|2 Co|II Cor|II Co|2Cor|2Co|II Corinthians|2Corinthians|2nd Corinthians|Second Corinthians|Galatians|Gal|Ga|Ephesians|Eph|Ephes|Philippians|Phil|Php|Pp|Colossians|Col|Co|1 Thessalonians|1 Thess|1 Thes|1 Th|I Thessalonians|I Thess|I Thes|I Th|1Thessalonians|1Thess|1Thes|1Th|1st Thessalonians|1st Thess|First Thessalonians|First Thess|2 Thessalonians|2 Thess|2 Thes|2 Th|II Thessalonians|II Thess|II Thes|II Th|2Thessalonians|2Thess|2Thes|2Th|2nd Thessalonians|2nd Thess|Second Thessalonians|Second Thess|1 Timothy|1 Tim|1 Ti|I Timothy|I Tim|I Ti|1Timothy|1Tim|1Ti|1st Timothy|1st Tim|First Timothy|First Tim|2 Timothy|2 Tim|2 Ti|II Timothy|II Tim|II Ti|2Timothy|2Tim|2Ti|2nd Timothy|2nd Tim|Second Timothy|Second Tim|Titus|titus|tit|ti|Philemon|Philem|Phm|Pm|He|Hebrews|Heb|James|James|Jas|Jm|1 Peter|1 Pet|1 Pe|1 Pt|1 P|I Pet|I Pt|I Pe|1Peter|1Pet|1Pe|1Pt|1P|I Peter|1st Peter|First Peter|2 Peter|2 Pet|2 Pe|2 Pt|2 P|II Peter|II Pet|II Pt|II Pe|2Peter|2Pet|2Pe|2Pt|2P|II Peter|2nd Peter|Second Peter|1 John|1 Jhn|1 Jn|1 J|1John|1Jhn|1Joh|1Jn|1Jo|1J|I John|I Jhn|I Joh|I Jn|I Jo|1st John|First John|2 John|2 Jhn|2 Jn|2 J|2John|2Jhn|2Joh|2Jn|2Jo|2J|II John|II Jhn|II Joh|II Jn|II Jo|2nd John|Second John|3 John|3 Jhn|3 Jn|3 J|3John|3Jhn|3Joh|3Jn|3Jo|3J|III John|III Jhn|III Joh|III Jn|III Jo|3rd John|Third John|Jude|Jud|Jd|Revelation|Rev|Rev|The Revelation|Apoc