codexparser 0.1.81 → 0.1.82
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/CodexParser.js +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.82",
|
|
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
|
@@ -104,9 +104,6 @@ class CodexParser {
|
|
|
104
104
|
const lowerCaseText = normalizedText.toLowerCase()
|
|
105
105
|
let i = 0
|
|
106
106
|
|
|
107
|
-
console.log("[Scan] Input text:", text)
|
|
108
|
-
console.log("[Scan] Normalized text:", normalizedText)
|
|
109
|
-
|
|
110
107
|
const isValidChapterVerseChar = (char) => /[^A-Za-z]/.test(char) // Non-letter characters
|
|
111
108
|
const isNextBibleBook = (startIndex) => {
|
|
112
109
|
const textAfterCurrentPosition = lowerCaseText.substring(startIndex).trim()
|
|
@@ -151,7 +148,6 @@ class CodexParser {
|
|
|
151
148
|
foundBook = fullNames[j]
|
|
152
149
|
matchedLength = book.length
|
|
153
150
|
originalBookText = text.slice(i, i + book.length)
|
|
154
|
-
console.log(`[Scan] Matched full book name: "${foundBook}" at index ${i}`)
|
|
155
151
|
}
|
|
156
152
|
}
|
|
157
153
|
|
|
@@ -166,9 +162,6 @@ class CodexParser {
|
|
|
166
162
|
foundBook = this.abbreviations[abbreviations[k]]
|
|
167
163
|
matchedLength = match[0].length - match[1].length // Exclude chapter-verse part
|
|
168
164
|
originalBookText = text.slice(i, i + matchedLength)
|
|
169
|
-
console.log(
|
|
170
|
-
`[Scan] Matched abbreviation: "${abbreviations[k]}" -> "${foundBook}" at index ${i}`
|
|
171
|
-
)
|
|
172
165
|
}
|
|
173
166
|
}
|
|
174
167
|
}
|
|
@@ -182,7 +175,6 @@ class CodexParser {
|
|
|
182
175
|
// Capture chapter-verse until a letter (potential new book) or semicolon
|
|
183
176
|
while (i < normalizedText.length && isValidChapterVerseChar(normalizedText[i])) {
|
|
184
177
|
if (isNextBibleBook(i)) {
|
|
185
|
-
console.log(`[Scan] Detected next book at index ${i}, breaking`)
|
|
186
178
|
break
|
|
187
179
|
}
|
|
188
180
|
if (normalizedText[i] === ";") {
|
|
@@ -286,7 +278,6 @@ class CodexParser {
|
|
|
286
278
|
endIndex: refObj.endIndex,
|
|
287
279
|
}
|
|
288
280
|
this.found.push(referenceObj)
|
|
289
|
-
console.log(`[Scan] Stored reference: ${JSON.stringify(referenceObj)}`)
|
|
290
281
|
})
|
|
291
282
|
|
|
292
283
|
// Skip any trailing spaces after the reference
|
|
@@ -297,8 +288,6 @@ class CodexParser {
|
|
|
297
288
|
i++
|
|
298
289
|
}
|
|
299
290
|
}
|
|
300
|
-
|
|
301
|
-
console.log("[Scan] Final found references:", JSON.stringify(this.found, null, 2))
|
|
302
291
|
return this
|
|
303
292
|
}
|
|
304
293
|
|