codexparser 0.0.5 → 0.0.7
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.
- package/package.json +1 -1
- package/src/abbr.js +69 -2
- package/src/regex.js +1 -1
- package/test.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "This is a Javascript Bible parser and text scanner. It will search through texts and collate all scripture references into an array and parse them into objects, and it will parse passages into objects by book, chapter, verse, and testament. ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/src/abbr.js
CHANGED
|
@@ -149,34 +149,101 @@ const abbrevations = {
|
|
|
149
149
|
Mal: "Malachi",
|
|
150
150
|
Ml: "Malachi",
|
|
151
151
|
Matt: "Matthew",
|
|
152
|
+
Mt: "Matthew",
|
|
152
153
|
Mark: "Mark",
|
|
154
|
+
Mrk: "Mark",
|
|
155
|
+
Mar: "Mark",
|
|
156
|
+
Mk: "Mark",
|
|
157
|
+
Mr: "Mark",
|
|
153
158
|
Luke: "Luke",
|
|
159
|
+
Luk: "Luke",
|
|
160
|
+
Lk: "Luke",
|
|
154
161
|
John: "John",
|
|
162
|
+
Joh: "John",
|
|
163
|
+
Jhn: "John",
|
|
164
|
+
Jn: "John",
|
|
155
165
|
Acts: "Acts",
|
|
156
166
|
Act: "Acts",
|
|
167
|
+
Ac: "Acts",
|
|
157
168
|
Rom: "Romans",
|
|
158
|
-
|
|
169
|
+
Ro: "Romans",
|
|
170
|
+
Rm: "Romans",
|
|
159
171
|
"1Cor": "1 Corinthians",
|
|
172
|
+
"1 Cor": "1 Corinthians",
|
|
173
|
+
"1 Co": "1 Corinthians",
|
|
174
|
+
"1 Cor": "1 Corinthians",
|
|
175
|
+
"1 Co": "1 Corinthians",
|
|
176
|
+
"1Co": "1 Corinthians",
|
|
160
177
|
"2Cor": "2 Corinthians",
|
|
178
|
+
"2 Cor": "2 Corinthians",
|
|
179
|
+
"2 Co": "2 Corinthians",
|
|
180
|
+
"2Co": "2 Corinthians",
|
|
181
|
+
"2Cor": "2 Corinthians",
|
|
182
|
+
"2 Cor": "2 Corinthians",
|
|
161
183
|
Gal: "Galatians",
|
|
184
|
+
Ga: "Galatians",
|
|
162
185
|
Eph: "Ephesians",
|
|
186
|
+
Ephes: "Ephesians",
|
|
163
187
|
Phil: "Philippians",
|
|
188
|
+
Php: "Philippians",
|
|
189
|
+
Pp: "Philippians",
|
|
164
190
|
Col: "Colossians",
|
|
191
|
+
Co: "Colossians",
|
|
165
192
|
"1Thess": "1 Thessalonians",
|
|
193
|
+
"1 Thess": "1 Thessalonians",
|
|
194
|
+
"1 Th": "1 Thessalonians",
|
|
195
|
+
"1Th": "1 Thessalonians",
|
|
196
|
+
"2Thess": "2 Thessalonians",
|
|
197
|
+
"2 Thess": "2 Thessalonians",
|
|
198
|
+
"2 Th": "2 Thessalonians",
|
|
199
|
+
"2Th": "2 Thessalonians",
|
|
166
200
|
"2Thess": "2 Thessalonians",
|
|
167
201
|
"1Tim": "1 Timothy",
|
|
202
|
+
"1 Ti": "1 Timothy",
|
|
203
|
+
"1 Ti": "1 Timothy",
|
|
204
|
+
"1Tim": "1 Timothy",
|
|
205
|
+
"2Tim": "2 Timothy",
|
|
206
|
+
"2 Ti": "2 Timothy",
|
|
207
|
+
"2 Ti": "2 Timothy",
|
|
168
208
|
"2Tim": "2 Timothy",
|
|
169
209
|
Titus: "Titus",
|
|
210
|
+
Tt: "Titus",
|
|
211
|
+
Tit: "Titus",
|
|
212
|
+
Ti: "Titus",
|
|
170
213
|
Phlm: "Philemon",
|
|
214
|
+
Phm: "Philemon",
|
|
215
|
+
Phile: "Philemon",
|
|
216
|
+
Ph: "Philemon",
|
|
217
|
+
Hebr: "Hebrews",
|
|
171
218
|
Heb: "Hebrews",
|
|
219
|
+
He: "Hebrews",
|
|
172
220
|
Jas: "James",
|
|
221
|
+
Jm: "James",
|
|
222
|
+
James: "James",
|
|
173
223
|
"1Pet": "1 Peter",
|
|
224
|
+
"1 Pe": "1 Peter",
|
|
225
|
+
"1 Pe": "1 Peter",
|
|
226
|
+
"1Pet": "1 Peter",
|
|
227
|
+
"2Pet": "2 Peter",
|
|
228
|
+
"2 Pe": "2 Peter",
|
|
229
|
+
"2 Pe": "2 Peter",
|
|
174
230
|
"2Pet": "2 Peter",
|
|
175
231
|
"1John": "1 John",
|
|
232
|
+
"1 Jo": "1 John",
|
|
233
|
+
"1 Jo": "1 John",
|
|
234
|
+
"1John": "1 John",
|
|
235
|
+
"2John": "2 John",
|
|
236
|
+
"2 Jo": "2 John",
|
|
237
|
+
"2 Jo": "2 John",
|
|
176
238
|
"2John": "2 John",
|
|
239
|
+
"2 John": "2 John",
|
|
177
240
|
"3John": "3 John",
|
|
241
|
+
"3 John": "3 John",
|
|
178
242
|
Jude: "Jude",
|
|
243
|
+
Jud: "Jude",
|
|
244
|
+
Jd: "Jude",
|
|
179
245
|
Rev: "Revelation",
|
|
246
|
+
Re: "Revelation",
|
|
180
247
|
Mt: "Matthew",
|
|
181
248
|
Mc: "Mark",
|
|
182
249
|
L: "Luke",
|
|
@@ -206,4 +273,4 @@ const abbrevations = {
|
|
|
206
273
|
Ap: "Revelation",
|
|
207
274
|
}
|
|
208
275
|
|
|
209
|
-
module.exports = abbrevations
|
|
276
|
+
module.exports = abbrevations
|
package/src/regex.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const bookRegex =
|
|
2
|
-
/(?:(?:[gG]e(?:[a-zA-Z])?|[eE]x(?:[a-zA-Z])?|[lL]e(?:[a-zA-Z])?|[nN]u(?:[a-zA-Z])?|[dD]e(?:[a-zA-Z])?|[jJ]o(?:[a-zA-Z])?|[jJ]u(?:[a-zA-Z])?|[rR]u(?:[a-zA-Z])?|1
|
|
2
|
+
/(?:(?:[gG]e(?:[a-zA-Z])?|[eE]x(?:[a-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Z])?|[tT](?:[a-zA-Z])?|[pP]h(?:[a-zA-Z])?|[hH](?:[a-zA-Z])?|[jJ](?:[a-zA-Z])?|1\s?[pP](?:[a-zA-Z])?|2\s?[pP](?:[a-zA-Z])?|1\s?[jJ](?:[a-zA-Z])?|2\s?[jJ](?:[a-zA-Z])?|3\s?[jJ](?:[a-zA-Z])?|[jJ](:[a-zA-Z])?|[Rr|Aa](?:[a-zA-Z])?))/gim
|
|
3
3
|
const bookAbbrRegex =
|
|
4
4
|
/(?:(?:[gG]en|[eE]xo|[lL]ev|[nN]um|[dD]eu|[jJ]os|[jJ]dg|[rR]ut|1 [sS]a|2 [sS]a|1 [kK]gs|2 [kK]gs|1 [cC]hr|2 [cC]hr|[eE]zr|[nN]eh|[eE]st|[jJ]ob|[pP]sa|[pP]ro|[eE]cc|[sS]on|[iI]sa|[jJ]er|[lL]am|[eE]ze|[dD]an|[hH]os|[jJ]oe|[aA]mo|[oO]ba|[jJ]on|[mM]ic|[nN]ah|[hH]ab|[zZ]ep|[hH]ag|[zZ]ec|[mM]al|[mM]att|[mM]ar|[lL]uk|[jJ]oh|[aA]ct|[rR]om|1 [cC]or|2 [cC]or|[gG]al|[eE]ph|[pP]hi|[cC]ol|1 [tT]hess|2 [tT]hess|1 [tT]i|2 [tT]i|[tT]it|[pP]hm|[hH]eb|[jJ]am|1 [pP]e|2 [pP]e|1 [jJ]o|2 [jJ]o|3 [jJ]o|[jJ]ud|[rR]ev))/gim
|
|
5
5
|
const chapterRegex = /(?:\s?\d+:?)/g
|
package/test.js
CHANGED
|
@@ -3,7 +3,7 @@ const CodexParser = require("./src/CodexParser.js")
|
|
|
3
3
|
const parser = new CodexParser()
|
|
4
4
|
const text =
|
|
5
5
|
"The passages that we are looking at tonight are found in 1 John 3:16-17, 1 Peter 1:1, and Romans 10:13, 15, 17. Please turn in your Bibles."
|
|
6
|
-
const single = "
|
|
6
|
+
const single = "1Cor 2.9"
|
|
7
7
|
parser.parse(single)
|
|
8
8
|
//parser.parse(single)
|
|
9
9
|
console.log(parser.getPassages())
|