codexparser 0.0.64 → 0.0.65
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
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/CodexParser.js
CHANGED
|
@@ -135,6 +135,13 @@ class CodexParser {
|
|
|
135
135
|
passage.scripture = this.scripturize(passage)
|
|
136
136
|
passage.indices = result.indices
|
|
137
137
|
passage.entities = result.entities
|
|
138
|
+
if (passage.entities[0].translations) {
|
|
139
|
+
passage.version = {
|
|
140
|
+
name: passage.entities[0].translations[0].translation,
|
|
141
|
+
alias: passage.entities[0].translations[0].alias,
|
|
142
|
+
abbreviation: passage.entities[0].translations[0].osis
|
|
143
|
+
}
|
|
144
|
+
}
|
|
138
145
|
this.passages.push(passage)
|
|
139
146
|
}
|
|
140
147
|
}
|
|
@@ -6,6 +6,10 @@ const dump = (item) => {
|
|
|
6
6
|
}
|
|
7
7
|
const string = "Malachi 3:32"
|
|
8
8
|
const parser = new BibleParser()
|
|
9
|
-
parser.options({
|
|
10
|
-
|
|
9
|
+
parser.options({
|
|
10
|
+
invalid_passage_strategy: "include",
|
|
11
|
+
invalid_sequence_strategy: "include",
|
|
12
|
+
single_chapter_1_strategy: "verse",
|
|
13
|
+
})
|
|
14
|
+
const result = parser.parse("Lk 1.47 2 Cor 7.6")
|
|
11
15
|
dump(result.getPassages())
|