From bd23d159a207167159c64c362a881c614841aac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tka=C4=8D=C3=ADk=20Radim=20=28Integrace=29?= Date: Mon, 13 Apr 2026 11:15:50 +0200 Subject: [PATCH] Added sk shortcut Ezech and Luk --- js/sk_bcv_parser.js | 4653 +++++++++++++++++++++++------------------ package-lock.json | 324 ++- package.json | 2 + src/sk/book_names.txt | 2 + src/sk/data.txt | 4 +- src/sk/regexps.coffee | 114 +- src/sk/spec.coffee | 4 + test/js/sk.spec.js | 176 +- 8 files changed, 3042 insertions(+), 2237 deletions(-) diff --git a/js/sk_bcv_parser.js b/js/sk_bcv_parser.js index 09555e2..64862f4 100644 --- a/js/sk_bcv_parser.js +++ b/js/sk_bcv_parser.js @@ -1,2164 +1,2589 @@ (function() { + // This class takes a string and identifies Bible passage references in that string. It's designed to handle how people actually type Bible passages and tries fairly hard to make sense of dubious possibilities. + + // The aggressiveness is tunable, to a certain extent, using the below `options`. It's probably too aggressive for general text parsing (the "is 2" in "There is 2 much" becomes "Isa.2", for example). + + // Export to whatever the current context is. var bcv_parser, bcv_passage, bcv_utils, root, hasProp = {}.hasOwnProperty; root = this; bcv_parser = (function() { - bcv_parser.prototype.s = ""; - - bcv_parser.prototype.entities = []; - - bcv_parser.prototype.passage = null; - - bcv_parser.prototype.regexps = {}; - - bcv_parser.prototype.options = { - consecutive_combination_strategy: "combine", - osis_compaction_strategy: "b", - book_sequence_strategy: "ignore", - invalid_sequence_strategy: "ignore", - sequence_combination_strategy: "combine", - punctuation_strategy: "us", - invalid_passage_strategy: "ignore", - non_latin_digits_strategy: "ignore", - passage_existence_strategy: "bcv", - zero_chapter_strategy: "error", - zero_verse_strategy: "error", - single_chapter_1_strategy: "chapter", - book_alone_strategy: "ignore", - book_range_strategy: "ignore", - captive_end_digits_strategy: "delete", - end_range_digits_strategy: "verse", - include_apocrypha: false, - ps151_strategy: "c", - versification_system: "default", - case_sensitive: "none" - }; - - function bcv_parser() { - var key, ref, val; - this.options = {}; - ref = bcv_parser.prototype.options; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - val = ref[key]; - this.options[key] = val; + class bcv_parser { + // Remember default options for later use. + constructor() { + var key, ref, val; + this.options = {}; + ref = bcv_parser.prototype.options; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + val = ref[key]; + this.options[key] = val; + } + // If we've changed the versification system, make sure previous object invocations don't leak. + this.versification_system(this.options.versification_system); + } + + // ## Parse-Related Functions + // Parse a string and prepare the object for further interrogation, depending on what's needed. + parse(s) { + this.reset(); + this.s = s; + // Replace any control characters already in the string. + s = this.replace_control_characters(s); + // Get a string representation suitable for passing to the parser. + [s, this.passage.books] = this.match_books(s); + // Replace potential BCVs one at a time to reduce processing time on long strings. + [this.entities] = this.match_passages(s); + return this; } - this.versification_system(this.options.versification_system); - } - - bcv_parser.prototype.parse = function(s) { - var ref; - this.reset(); - this.s = s; - s = this.replace_control_characters(s); - ref = this.match_books(s), s = ref[0], this.passage.books = ref[1]; - this.entities = this.match_passages(s)[0]; - return this; - }; - - bcv_parser.prototype.parse_with_context = function(s, context) { - var entities, ref, ref1, ref2; - this.reset(); - ref = this.match_books(this.replace_control_characters(context)), context = ref[0], this.passage.books = ref[1]; - ref1 = this.match_passages(context), entities = ref1[0], context = ref1[1]; - this.reset(); - this.s = s; - s = this.replace_control_characters(s); - ref2 = this.match_books(s), s = ref2[0], this.passage.books = ref2[1]; - this.passage.books.push({ - value: "", - parsed: [], - start_index: 0, - type: "context", - context: context - }); - s = "\x1f" + (this.passage.books.length - 1) + "/9\x1f" + s; - this.entities = this.match_passages(s)[0]; - return this; - }; - bcv_parser.prototype.reset = function() { - this.s = ""; - this.entities = []; - if (this.passage) { - this.passage.books = []; - return this.passage.indices = {}; - } else { - this.passage = new bcv_passage; - this.passage.options = this.options; - return this.passage.translations = this.translations; + // Parse a string and prepare the object for further interrogation, depending on what's needed. The second argument is a string that serves as the context for the first argument. If there's a valid partial match at the beginning of the first argument, then it will parse it using the supplied `context`. For example, `parse_string_with_context("verse 2", "Genesis 3").osis()` = `Gen.3.2`. You'd use this when you have some text that looks like it's a partial reference, and you already know the context. + parse_with_context(s, context) { + var entities; + this.reset(); + [context, this.passage.books] = this.match_books(this.replace_control_characters(context)); + [entities, context] = this.match_passages(context); + this.reset(); + this.s = s; + // Replace any control characters already in the string. + s = this.replace_control_characters(s); + // Get a string representation suitable for passing to the parser. + [s, this.passage.books] = this.match_books(s); + this.passage.books.push({ + value: "", + parsed: [], + start_index: 0, + type: "context", + context: context + }); + // Reconstruct the string, adding in the context. Because we've already called `match_books`, the resulting offsets will reflect the original string and not the new string. + s = "\x1f" + (this.passage.books.length - 1) + "/9\x1f" + s; + // Replace potential BCVs one at a time to reduce processing time on long strings. + [this.entities] = this.match_passages(s); + return this; } - }; - bcv_parser.prototype.set_options = function(options) { - var key, val; - for (key in options) { - if (!hasProp.call(options, key)) continue; - val = options[key]; - if (key === "include_apocrypha" || key === "versification_system" || key === "case_sensitive") { - this[key](val); + // If we have a new string to parse, reset any values from previous parses. + reset() { + this.s = ""; + this.entities = []; + if (this.passage) { + this.passage.books = []; + return this.passage.indices = {}; } else { - this.options[key] = val; + this.passage = new bcv_passage(); + this.passage.options = this.options; + return this.passage.translations = this.translations; + } + } + + // ## Options-Related Functions + // Override default options. + set_options(options) { + var key, val; + for (key in options) { + if (!hasProp.call(options, key)) continue; + val = options[key]; + // The drawback with this approach is that calling `include_apocrypha`, `versification_system`, and `case_sensitive` could regenerate `@regexps.books` three times. + if (key === "include_apocrypha" || key === "versification_system" || key === "case_sensitive") { + this[key](val); + } else { + this.options[key] = val; + } } - } - return this; - }; - - bcv_parser.prototype.include_apocrypha = function(arg) { - var base, base1, ref, translation, verse_count; - if (!((arg != null) && (arg === true || arg === false))) { return this; } - this.options.include_apocrypha = arg; - this.regexps.books = this.regexps.get_books(arg, this.options.case_sensitive); - ref = this.translations; - for (translation in ref) { - if (!hasProp.call(ref, translation)) continue; - if (translation === "aliases" || translation === "alternates") { - continue; + + // Whether to use books and abbreviations from the Apocrypha. Takes a boolean argument: `true` to include the Apocrypha and `false` to not. Defaults to `false`. Returns the `bcv_parser` object. + include_apocrypha(arg) { + var base, base1, ref, translation, verse_count; + if (!((arg != null) && (arg === true || arg === false))) { + return this; } - if ((base = this.translations[translation]).chapters == null) { - base.chapters = {}; + this.options.include_apocrypha = arg; + this.regexps.books = this.regexps.get_books(arg, this.options.case_sensitive); + ref = this.translations; + for (translation in ref) { + if (!hasProp.call(ref, translation)) continue; + if (translation === "aliases" || translation === "alternates") { + continue; + } + // If the `Ps` array in the `chapters` object doesn't exist, create it so that we can add Ps 151 to the end of it. + if ((base = this.translations[translation]).chapters == null) { + base.chapters = {}; + } + if ((base1 = this.translations[translation].chapters)["Ps"] == null) { + base1["Ps"] = bcv_utils.shallow_clone_array(this.translations["default"].chapters["Ps"]); + } + // Add Ps 151 to the end of Psalms. The assumption here is that Ps151 always only is one chapter long. + if (arg === true) { + if (this.translations[translation].chapters["Ps151"] != null) { + verse_count = this.translations[translation].chapters["Ps151"][0]; + } else { + verse_count = this.translations["default"].chapters["Ps151"][0]; + } + this.translations[translation].chapters["Ps"][150] = verse_count; + } else { + if (this.translations[translation].chapters["Ps"].length === 151) { + // Remove Ps 151 from the end of Psalms. + this.translations[translation].chapters["Ps"].pop(); + } + } } - if ((base1 = this.translations[translation].chapters)["Ps"] == null) { - base1["Ps"] = bcv_utils.shallow_clone_array(this.translations["default"].chapters["Ps"]); + return this; + } + + // Use an alternate versification system. Takes a string argument; the built-in options are: `default` to use KJV-style versification and `vulgate` to use the Vulgate (Greek) Psalm numbering. English offers several other versification systems; see the Readme for details. + versification_system(system) { + var base, base1, base2, book, chapter_list, ref, ref1; + if (!((system != null) && (this.translations[system] != null))) { + return this; } - if (arg === true) { - if (this.translations[translation].chapters["Ps151"] != null) { - verse_count = this.translations[translation].chapters["Ps151"][0]; + // If we've already changed the `versification_system` once, we need to do some cleanup before we change it to something else. + if (this.translations.alternates.default != null) { + // If we're changing to the default from something else, make sure we reset it to the correct values. + if (system === "default") { + if (this.translations.alternates.default.order != null) { + this.translations.default.order = bcv_utils.shallow_clone(this.translations.alternates.default.order); + } + ref = this.translations.alternates.default.chapters; + for (book in ref) { + if (!hasProp.call(ref, book)) continue; + chapter_list = ref[book]; + this.translations.default.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); + } } else { - verse_count = this.translations["default"].chapters["Ps151"][0]; + // Make sure the `versification_system` is reset to the default before applying any changes--alternate systems only include differences from the default. + this.versification_system("default"); } - this.translations[translation].chapters["Ps"][150] = verse_count; - } else { - if (this.translations[translation].chapters["Ps"].length === 151) { - this.translations[translation].chapters["Ps"].pop(); + } + if ((base = this.translations.alternates).default == null) { + base.default = { + order: null, + chapters: {} + }; + } + // If we're updating the book order (e.g., to mix the Apocrypha into the Old Testament)... + if (system !== "default" && (this.translations[system].order != null)) { + // Save the existing default order so we can get it back later if necessary. We want to do everything nondestructively. + if ((base1 = this.translations.alternates.default).order == null) { + base1.order = bcv_utils.shallow_clone(this.translations.default.order); + } + // The `order` key should always contain the full order; too many things can go wrong if we try to merge the old order and the new one. + this.translations.default.order = bcv_utils.shallow_clone(this.translations[system].order); + } + // If we're updating the number of chapters in a book or the number of verses in a chapter... + if (system !== "default" && (this.translations[system].chapters != null)) { + ref1 = this.translations[system].chapters; + for (book in ref1) { + if (!hasProp.call(ref1, book)) continue; + chapter_list = ref1[book]; + // Save the existing default order so we can get it back later. Only set it the first time. + if ((base2 = this.translations.alternates.default.chapters)[book] == null) { + base2[book] = bcv_utils.shallow_clone_array(this.translations.default.chapters[book]); + } + this.translations.default.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } } + // Depending on the order of operations, the cloned list could be inconsistent with the current state. For example, if we called `versification_system`, we've cached 150 Psalms. If we then call `include_apocrypha(true)`, we now have 151 Psalms. If we then call `versification_system` again, we're back, incorrectly, to 150 Psalms because that's what was cached. + this.options.versification_system = system; + this.include_apocrypha(this.options.include_apocrypha); + return this; } - return this; - }; - bcv_parser.prototype.versification_system = function(system) { - var base, base1, base2, book, chapter_list, ref, ref1; - if (!((system != null) && (this.translations[system] != null))) { + // Whether to treat books as case-sensitive. Valid values are `none` and `books`. + case_sensitive(arg) { + if (!((arg != null) && (arg === "none" || arg === "books"))) { + return this; + } + if (arg === this.options.case_sensitive) { + // If nothing is changing, don't bother continuing + return this; + } + this.options.case_sensitive = arg; + this.regexps.books = this.regexps.get_books(this.options.include_apocrypha, arg); return this; } - if (this.translations.alternates["default"] != null) { - if (system === "default") { - if (this.translations.alternates["default"].order != null) { - this.translations["default"].order = bcv_utils.shallow_clone(this.translations.alternates["default"].order); - } - ref = this.translations.alternates["default"].chapters; - for (book in ref) { - if (!hasProp.call(ref, book)) continue; - chapter_list = ref[book]; - this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); - } - } else { - this.versification_system("default"); + + // ## Administrative Functions + // Return translation information so that we don't have to reach into semi-private objects to grab the data we need. + translation_info(new_translation = "default") { + var book, chapter_list, id, old_translation, out, ref, ref1, ref2; + if ((new_translation != null) && (((ref = this.translations.aliases[new_translation]) != null ? ref.alias : void 0) != null)) { + new_translation = this.translations.aliases[new_translation].alias; } - } - if ((base = this.translations.alternates)["default"] == null) { - base["default"] = { - order: null, - chapters: {} - }; - } - if (system !== "default" && (this.translations[system].order != null)) { - if ((base1 = this.translations.alternates["default"]).order == null) { - base1.order = bcv_utils.shallow_clone(this.translations["default"].order); + if (!((new_translation != null) && (this.translations[new_translation] != null))) { + new_translation = "default"; } - this.translations["default"].order = bcv_utils.shallow_clone(this.translations[system].order); - } - if (system !== "default" && (this.translations[system].chapters != null)) { - ref1 = this.translations[system].chapters; + old_translation = this.options.versification_system; + if (new_translation !== old_translation) { + this.versification_system(new_translation); + } + out = { + alias: new_translation, + books: [], + chapters: {}, + order: bcv_utils.shallow_clone(this.translations.default.order) + }; + ref1 = this.translations.default.chapters; for (book in ref1) { if (!hasProp.call(ref1, book)) continue; chapter_list = ref1[book]; - if ((base2 = this.translations.alternates["default"].chapters)[book] == null) { - base2[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); + out.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); + } + ref2 = out.order; + for (book in ref2) { + if (!hasProp.call(ref2, book)) continue; + id = ref2[book]; + out.books[id - 1] = book; + } + if (new_translation !== old_translation) { + this.versification_system(old_translation); + } + return out; + } + + // ## Parsing-Related Functions + // Replace control characters and spaces since we replace books with a specific character pattern. The string changes, but the length stays the same so that indices remain valid. If we want to use Latin numbers rather than non-Latin ones, replace them here. + replace_control_characters(s) { + s = s.replace(this.regexps.control, " "); + if (this.options.non_latin_digits_strategy === "replace") { + s = s.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g, "0"); + s = s.replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g, "1"); + s = s.replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g, "2"); + s = s.replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g, "3"); + s = s.replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g, "4"); + s = s.replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g, "5"); + s = s.replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g, "6"); + s = s.replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g, "7"); + s = s.replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g, "8"); + s = s.replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g, "9"); + } + return s; + } + + // Find and replace instances of Bible books. + match_books(s) { + var book, books, has_replacement, k, len, ref; + books = []; + ref = this.regexps.books; + // Replace all book strings. + for (k = 0, len = ref.length; k < len; k++) { + book = ref[k]; + has_replacement = false; + // Using array concatenation instead of replacing text directly didn't offer performance improvements in tests of the approach. + s = s.replace(book.regexp, function(full, prev, bk) { + var extra; + has_replacement = true; + // `value` contains the raw string; `book.osis` is the osis value for the book. + books.push({ + value: bk, + parsed: book.osis, + type: "book" + }); + extra = book.extra != null ? `/${book.extra}` : ""; + return `${prev}\x1f${books.length - 1}${extra}\x1f`; + }); + // If we've already replaced all possible books in the string, we don't need to check any further. + if (has_replacement === true && /^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(s)) { + break; } - this.translations["default"].chapters[book] = bcv_utils.shallow_clone_array(chapter_list); } - } - this.options.versification_system = system; - this.include_apocrypha(this.options.include_apocrypha); - return this; - }; - - bcv_parser.prototype.case_sensitive = function(arg) { - if (!((arg != null) && (arg === "none" || arg === "books"))) { - return this; - } - if (arg === this.options.case_sensitive) { - return this; - } - this.options.case_sensitive = arg; - this.regexps.books = this.regexps.get_books(this.options.include_apocrypha, arg); - return this; - }; - - bcv_parser.prototype.translation_info = function(new_translation) { - var book, chapter_list, id, old_translation, out, ref, ref1, ref2; - if (new_translation == null) { - new_translation = "default"; - } - if ((new_translation != null) && (((ref = this.translations.aliases[new_translation]) != null ? ref.alias : void 0) != null)) { - new_translation = this.translations.aliases[new_translation].alias; - } - if (!((new_translation != null) && (this.translations[new_translation] != null))) { - new_translation = "default"; - } - old_translation = this.options.versification_system; - if (new_translation !== old_translation) { - this.versification_system(new_translation); - } - out = { - alias: new_translation, - books: [], - chapters: {}, - order: bcv_utils.shallow_clone(this.translations["default"].order) - }; - ref1 = this.translations["default"].chapters; - for (book in ref1) { - if (!hasProp.call(ref1, book)) continue; - chapter_list = ref1[book]; - out.chapters[book] = bcv_utils.shallow_clone_array(chapter_list); - } - ref2 = out.order; - for (book in ref2) { - if (!hasProp.call(ref2, book)) continue; - id = ref2[book]; - out.books[id - 1] = book; - } - if (new_translation !== old_translation) { - this.versification_system(old_translation); - } - return out; - }; - - bcv_parser.prototype.replace_control_characters = function(s) { - s = s.replace(this.regexps.control, " "); - if (this.options.non_latin_digits_strategy === "replace") { - s = s.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g, "0"); - s = s.replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g, "1"); - s = s.replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g, "2"); - s = s.replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g, "3"); - s = s.replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g, "4"); - s = s.replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g, "5"); - s = s.replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g, "6"); - s = s.replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g, "7"); - s = s.replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g, "8"); - s = s.replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g, "9"); - } - return s; - }; - - bcv_parser.prototype.match_books = function(s) { - var book, books, has_replacement, k, len, ref; - books = []; - ref = this.regexps.books; - for (k = 0, len = ref.length; k < len; k++) { - book = ref[k]; - has_replacement = false; - s = s.replace(book.regexp, function(full, prev, bk) { - var extra; - has_replacement = true; + // Replace translations. + s = s.replace(this.regexps.translations, function(match) { books.push({ - value: bk, - parsed: book.osis, - type: "book" + value: match, + parsed: match.toLowerCase(), + type: "translation" }); - extra = book.extra != null ? "/" + book.extra : ""; - return prev + "\x1f" + (books.length - 1) + extra + "\x1f"; + return `\x1e${books.length - 1}\x1e`; }); - if (has_replacement === true && /^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(s)) { - break; + return [s, this.get_book_indices(books, s)]; + } + + // Get the string index for all the books / translations, adding the start index as a new key. + get_book_indices(books, s) { + var add_index, match, re; + add_index = 0; + re = /([\x1f\x1e])(\d+)(?:\/\d+)?\1/g; // opening book or translation + // the number + // optional extra identifier + // closing delimeter + while (match = re.exec(s)) { + // Keep track of the actual start index. + books[match[2]].start_index = match.index + add_index; + // Add the difference between the real length of the book and what we replaced it with (`match[0]` is the replacement). + add_index += books[match[2]].value.length - match[0].length; + } + return books; + } + + // Create an array of all the potential bcv matches in the string. + match_passages(s) { + var accum, book_id, entities, full, match, next_char, original_part_length, part, passage, post_context, regexp_index_adjust, start_index_adjust; + entities = []; + post_context = {}; + while (match = this.regexps.escaped_passage.exec(s)) { + // * `match[0]` includes the preceding character (if any) for bounding. + // * `match[1]` is the full match minus the character preceding the match used for bounding. + // * `match[2]` is the book id. + [full, part, book_id] = match; + // Adjust the `index` to use the `part` offset rather than the `full` offset. We use it below for `captive_end_digits`. + original_part_length = part.length; + match.index += full.length - original_part_length; + // Remove most three+-character digits at the end; they won't match. + if (/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(part)) { + part = part.replace(/\s+\d+\s*$/, ""); + } + // Clean up the end of the match to avoid irrelevant context. + if (!/[\d\x1f\x1e)]$/.test(part)) { + // Remove superfluous characters from the end of the match. + part = this.replace_match_end(part); + } + if (this.options.captive_end_digits_strategy === "delete") { + // If the match ends with a space+digit and is immediately followed by a word character, ignore the space+digit: `Matt 1, 2Text`. + next_char = match.index + part.length; + if (s.length > next_char && /^\w/.test(s.substr(next_char, 1))) { + part = part.replace(/[\s*]+\d+$/, ""); + } + // If the match ends with a translation indicator, remove any numbers afterward. This situation generally occurs in cases like, "Ps 1:1 ESV 1 Blessed is...", where the final `1` is a verse number that's part of the text. + part = part.replace(/(\x1e[)\]]?)[\s*]*\d+$/, "$1"); + } + // Though PEG.js doesn't have to be case-sensitive, using the case-insensitive feature involves some repeated processing. By lower-casing here, we only pay the cost once. The grammar for words like "also" is case-sensitive; we can safely lowercase ascii letters without changing indices. We don't just call .toLowerCase() because it could affect the length of the string if it contains certain characters; maintaining the indices is the most important thing. + part = part.replace(/[A-Z]+/g, function(capitals) { + return capitals.toLowerCase(); + }); + // If we're in a chapter-book situation, the first character won't be a book control character, which would throw off the `start_index`. + start_index_adjust = part.substr(0, 1) === "\x1f" ? 0 : part.split("\x1f")[0].length; + // * `match` is important for the length and whether it contains control characters, neither of which we've changed inconsistently with the original string. The `part` may be shorter than originally matched, but that's only to remove unneeded characters at the end. + // * `grammar` is the external PEG parser. The `@options.punctuation_strategy` determines which punctuation is used for sequences and `cv` separators. + passage = { + value: grammar.parse(part, { + punctuation_strategy: this.options.punctuation_strategy + }), + type: "base", + start_index: this.passage.books[book_id].start_index - start_index_adjust, + match: part + }; + // Are we looking at a single book on its own that could be part of a range like "1-2 Sam"? + // Either it's on its own or a translation sequence follows it, making it effectively on its own. + if (this.options.book_alone_strategy === "full" && this.options.book_range_strategy === "include" && passage.value[0].type === "b" && (passage.value.length === 1 || (passage.value.length > 1 && passage.value[1].type === "translation_sequence")) && start_index_adjust === 0 && (this.passage.books[book_id].parsed.length === 1 || (this.passage.books[book_id].parsed.length > 1 && this.passage.books[book_id].parsed[1].type === "translation")) && /^[234]/.test(this.passage.books[book_id].parsed[0])) { + this.create_book_range(s, passage, book_id); + } + // Handle each passage individually to prevent context leakage (e.g., translations back-propagating through unrelated entities). + [accum, post_context] = this.passage.handle_obj(passage); + entities = entities.concat(accum); + // Move the next RegExp iteration to start earlier if we didn't use everything we thought we were going to. + regexp_index_adjust = this.adjust_regexp_end(accum, original_part_length, part.length); + if (regexp_index_adjust > 0) { + this.regexps.escaped_passage.lastIndex -= regexp_index_adjust; + } } + return [entities, post_context]; } - s = s.replace(this.regexps.translations, function(match) { - books.push({ - value: match, - parsed: match.toLowerCase(), - type: "translation" - }); - return "\x1e" + (books.length - 1) + "\x1e"; - }); - return [s, this.get_book_indices(books, s)]; - }; - bcv_parser.prototype.get_book_indices = function(books, s) { - var add_index, match, re; - add_index = 0; - re = /([\x1f\x1e])(\d+)(?:\/\d+)?\1/g; - while (match = re.exec(s)) { - books[match[2]].start_index = match.index + add_index; - add_index += books[match[2]].value.length - match[0].length; + // Handle the objects returned from the grammar to produce entities for further processing. We may need to adjust the `RegExp.lastIndex` if we discarded characters from the end of the match or if, after parsing, we're ignoring some of them--especially with ending parenthetical statements like "Luke 8:1-3; 24:10 (and Matthew 14:1-12 and Luke 23:7-12 for background)". + adjust_regexp_end(accum, old_length, new_length) { + var regexp_index_adjust; + regexp_index_adjust = 0; + if (accum.length > 0) { + // `accum` uses an off-by-one end index compared to the RegExp object. "and Psa3" means `lastIndex` = 8, `old_length` and `new_length` are both 4 (omitting "and " and leaving "Psa3"), and the `accum` end index is 3. We end up with 4 - 3 - 1 = 0, or no adjustment. Compare "and Psa3 and", where the last " and" is originally considered part of the regexp. In this case, `regexp_index_adjust` is 4: 8 ("Psa3 and") - 3 ("Psa3") - 1. + regexp_index_adjust = old_length - accum[accum.length - 1].indices[1] - 1; + } else if (old_length !== new_length) { + regexp_index_adjust = old_length - new_length; + } + return regexp_index_adjust; } - return books; - }; - bcv_parser.prototype.match_passages = function(s) { - var accum, book_id, entities, full, match, next_char, original_part_length, part, passage, post_context, ref, regexp_index_adjust, start_index_adjust; - entities = []; - post_context = {}; - while (match = this.regexps.escaped_passage.exec(s)) { - full = match[0], part = match[1], book_id = match[2]; - original_part_length = part.length; - match.index += full.length - original_part_length; - if (/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(part)) { - part = part.replace(/\s+\d+\s*$/, ""); - } - if (!/[\d\x1f\x1e)]$/.test(part)) { - part = this.replace_match_end(part); - } - if (this.options.captive_end_digits_strategy === "delete") { - next_char = match.index + part.length; - if (s.length > next_char && /^\w/.test(s.substr(next_char, 1))) { - part = part.replace(/[\s*]+\d+$/, ""); - } - part = part.replace(/(\x1e[)\]]?)[\s*]*\d+$/, "$1"); - } - part = part.replace(/[A-Z]+/g, function(capitals) { - return capitals.toLowerCase(); - }); - start_index_adjust = part.substr(0, 1) === "\x1f" ? 0 : part.split("\x1f")[0].length; - passage = { - value: grammar.parse(part, { - punctuation_strategy: this.options.punctuation_strategy - }), - type: "base", - start_index: this.passage.books[book_id].start_index - start_index_adjust, - match: part - }; - if (this.options.book_alone_strategy === "full" && this.options.book_range_strategy === "include" && passage.value[0].type === "b" && (passage.value.length === 1 || (passage.value.length > 1 && passage.value[1].type === "translation_sequence")) && start_index_adjust === 0 && (this.passage.books[book_id].parsed.length === 1 || (this.passage.books[book_id].parsed.length > 1 && this.passage.books[book_id].parsed[1].type === "translation")) && /^[234]/.test(this.passage.books[book_id].parsed[0])) { - this.create_book_range(s, passage, book_id); + // Remove unnecessary characters from the end of the match. + replace_match_end(part) { + var match, remove; + // Split the string on valid ending characters. Remove whatever's leftover at the end of the string. It would be easier to do `part.split(@regexps.match_end_split).pop()`, but IE doesn't handle empty strings at the end. + remove = part.length; + while (match = this.regexps.match_end_split.exec(part)) { + remove = match.index + match[0].length; } - ref = this.passage.handle_obj(passage), accum = ref[0], post_context = ref[1]; - entities = entities.concat(accum); - regexp_index_adjust = this.adjust_regexp_end(accum, original_part_length, part.length); - if (regexp_index_adjust > 0) { - this.regexps.escaped_passage.lastIndex -= regexp_index_adjust; + if (remove < part.length) { + part = part.substr(0, remove); } + return part; } - return [entities, post_context]; - }; - - bcv_parser.prototype.adjust_regexp_end = function(accum, old_length, new_length) { - var regexp_index_adjust; - regexp_index_adjust = 0; - if (accum.length > 0) { - regexp_index_adjust = old_length - accum[accum.length - 1].indices[1] - 1; - } else if (old_length !== new_length) { - regexp_index_adjust = old_length - new_length; - } - return regexp_index_adjust; - }; - bcv_parser.prototype.replace_match_end = function(part) { - var match, remove; - remove = part.length; - while (match = this.regexps.match_end_split.exec(part)) { - remove = match.index + match[0].length; - } - if (remove < part.length) { - part = part.substr(0, remove); + // If a book is on its own, check whether it's preceded by something that indicates it's a book range like "1-2 Samuel". + create_book_range(s, passage, book_id) { + var cases, i, k, limit, prev, range_regexp, ref; + cases = [bcv_parser.prototype.regexps.first, bcv_parser.prototype.regexps.second, bcv_parser.prototype.regexps.third]; + limit = parseInt(this.passage.books[book_id].parsed[0].substr(0, 1), 10); + for (i = k = 1, ref = limit; (1 <= ref ? k < ref : k > ref); i = 1 <= ref ? ++k : --k) { + range_regexp = i === limit - 1 ? bcv_parser.prototype.regexps.range_and : bcv_parser.prototype.regexps.range_only; + prev = s.match(RegExp(`(?:^|\\W)(${cases[i - 1]}\\s*${range_regexp}\\s*)\\x1f${book_id}\\x1f`, "i")); + if (prev != null) { + return this.add_book_range_object(passage, prev, i); + } + } + return false; } - return part; - }; - bcv_parser.prototype.create_book_range = function(s, passage, book_id) { - var cases, i, k, limit, prev, range_regexp, ref; - cases = [bcv_parser.prototype.regexps.first, bcv_parser.prototype.regexps.second, bcv_parser.prototype.regexps.third]; - limit = parseInt(this.passage.books[book_id].parsed[0].substr(0, 1), 10); - for (i = k = 1, ref = limit; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { - range_regexp = i === limit - 1 ? bcv_parser.prototype.regexps.range_and : bcv_parser.prototype.regexps.range_only; - prev = s.match(RegExp("(?:^|\\W)(" + cases[i - 1] + "\\s*" + range_regexp + "\\s*)\\x1f" + book_id + "\\x1f", "i")); - if (prev != null) { - return this.add_book_range_object(passage, prev, i); + // Create a fake object that can be parsed to show the correct result. + add_book_range_object(passage, prev, start_book_number) { + var i, k, length, ref, ref1, results; + length = prev[1].length; + passage.value[0] = { + type: "b_range_pre", + value: [ + { + type: "b_pre", + value: start_book_number.toString(), + indices: [prev.index, + prev.index + length] + }, + passage.value[0] + ], + indices: [0, passage.value[0].indices[1] + length] + }; + // Adjust the indices of the original result so they reflect the new content. + passage.value[0].value[1].indices[0] += length; + passage.value[0].value[1].indices[1] += length; + // These two are the most important ones; the `absolute_indices` function uses them. + passage.start_index -= length; + passage.match = prev[1] + passage.match; + if (passage.value.length === 1) { + return; + } +// If there are subsequent objects, also adjust their offsets. + results = []; + for (i = k = 1, ref = passage.value.length; (1 <= ref ? k < ref : k > ref); i = 1 <= ref ? ++k : --k) { + if (passage.value[i].value == null) { + continue; + } + // If it's an `integer` type, `passage.value[i].value` is a scalar rather than an object, so we only need to adjust the indices for the top-level object. + if (((ref1 = passage.value[i].value[0]) != null ? ref1.indices : void 0) != null) { + passage.value[i].value[0].indices[0] += length; + passage.value[i].value[0].indices[1] += length; + } + passage.value[i].indices[0] += length; + results.push(passage.value[i].indices[1] += length); } + return results; } - return false; - }; - - bcv_parser.prototype.add_book_range_object = function(passage, prev, start_book_number) { - var i, k, length, ref, ref1, results; - length = prev[1].length; - passage.value[0] = { - type: "b_range_pre", - value: [ - { - type: "b_pre", - value: start_book_number.toString(), - indices: [prev.index, prev.index + length] - }, passage.value[0] - ], - indices: [0, passage.value[0].indices[1] + length] - }; - passage.value[0].value[1].indices[0] += length; - passage.value[0].value[1].indices[1] += length; - passage.start_index -= length; - passage.match = prev[1] + passage.match; - if (passage.value.length === 1) { - return; - } - results = []; - for (i = k = 1, ref = passage.value.length; 1 <= ref ? k < ref : k > ref; i = 1 <= ref ? ++k : --k) { - if (passage.value[i].value == null) { - continue; - } - if (((ref1 = passage.value[i].value[0]) != null ? ref1.indices : void 0) != null) { - passage.value[i].value[0].indices[0] += length; - passage.value[i].value[0].indices[1] += length; - } - passage.value[i].indices[0] += length; - results.push(passage.value[i].indices[1] += length); - } - return results; - }; - bcv_parser.prototype.osis = function() { - var k, len, osis, out, ref; - out = []; - ref = this.parsed_entities(); - for (k = 0, len = ref.length; k < len; k++) { - osis = ref[k]; - if (osis.osis.length > 0) { - out.push(osis.osis); + // ## Output-Related Functions + // Return a single OSIS string (comma-separated) for all the references in the whole input string. + osis() { + var k, len, osis, out, ref; + out = []; + ref = this.parsed_entities(); + for (k = 0, len = ref.length; k < len; k++) { + osis = ref[k]; + if (osis.osis.length > 0) { + out.push(osis.osis); + } } + return out.join(","); } - return out.join(","); - }; - bcv_parser.prototype.osis_and_translations = function() { - var k, len, osis, out, ref; - out = []; - ref = this.parsed_entities(); - for (k = 0, len = ref.length; k < len; k++) { - osis = ref[k]; - if (osis.osis.length > 0) { - out.push([osis.osis, osis.translations.join(",")]); + // Return an array of `[OSIS, TRANSLATIONS]` for each reference (combined according to `options`). + osis_and_translations() { + var k, len, osis, out, ref; + out = []; + ref = this.parsed_entities(); + for (k = 0, len = ref.length; k < len; k++) { + osis = ref[k]; + if (osis.osis.length > 0) { + out.push([osis.osis, osis.translations.join(",")]); + } } + return out; } - return out; - }; - bcv_parser.prototype.osis_and_indices = function() { - var k, len, osis, out, ref; - out = []; - ref = this.parsed_entities(); - for (k = 0, len = ref.length; k < len; k++) { - osis = ref[k]; - if (osis.osis.length > 0) { - out.push({ - osis: osis.osis, - translations: osis.translations, - indices: osis.indices - }); + // Return an array of `{osis: OSIS, indices:[START, END], translations: [TRANSLATIONS]}` objects for each reference (combined according to `options`). + osis_and_indices() { + var k, len, osis, out, ref; + out = []; + ref = this.parsed_entities(); + for (k = 0, len = ref.length; k < len; k++) { + osis = ref[k]; + if (osis.osis.length > 0) { + out.push({ + osis: osis.osis, + translations: osis.translations, + indices: osis.indices + }); + } } + return out; } - return out; - }; - bcv_parser.prototype.parsed_entities = function() { - var entity, entity_id, i, k, l, last_i, len, len1, length, m, n, osis, osises, out, passage, ref, ref1, ref2, ref3, strings, translation, translation_alias, translation_osis, translations; - out = []; - for (entity_id = k = 0, ref = this.entities.length; 0 <= ref ? k < ref : k > ref; entity_id = 0 <= ref ? ++k : --k) { - entity = this.entities[entity_id]; - if (entity.type && entity.type === "translation_sequence" && out.length > 0 && entity_id === out[out.length - 1].entity_id + 1) { - out[out.length - 1].indices[1] = entity.absolute_indices[1]; - } - if (entity.passages == null) { - continue; - } - if ((entity.type === "b" && this.options.book_alone_strategy === "ignore") || (entity.type === "b_range" && this.options.book_range_strategy === "ignore") || entity.type === "context") { - continue; - } - translations = []; - translation_alias = null; - if (entity.passages[0].translations != null) { - ref1 = entity.passages[0].translations; - for (l = 0, len = ref1.length; l < len; l++) { - translation = ref1[l]; - translation_osis = ((ref2 = translation.osis) != null ? ref2.length : void 0) > 0 ? translation.osis : ""; - if (translation_alias == null) { - translation_alias = translation.alias; - } - translations.push(translation_osis); + // Return all objects, probably for additional processing. + parsed_entities() { + var entity, entity_id, i, k, l, last_i, len, len1, length, m, n, osis, osises, out, passage, ref, ref1, ref2, ref3, strings, translation, translation_alias, translation_osis, translations; + out = []; + for (entity_id = k = 0, ref = this.entities.length; (0 <= ref ? k < ref : k > ref); entity_id = 0 <= ref ? ++k : --k) { + entity = this.entities[entity_id]; + // Be sure to include any translation identifiers in the indices we report back, but only if the translation immediately follows the previous entity. + if (entity.type && entity.type === "translation_sequence" && out.length > 0 && entity_id === out[out.length - 1].entity_id + 1) { + out[out.length - 1].indices[1] = entity.absolute_indices[1]; } - } else { - translations = [""]; - translation_alias = "default"; - } - osises = []; - length = entity.passages.length; - for (i = m = 0, ref3 = length; 0 <= ref3 ? m < ref3 : m > ref3; i = 0 <= ref3 ? ++m : --m) { - passage = entity.passages[i]; - if (passage.type == null) { - passage.type = entity.type; + if (entity.passages == null) { + continue; + } + if ((entity.type === "b" && this.options.book_alone_strategy === "ignore") || (entity.type === "b_range" && this.options.book_range_strategy === "ignore") || entity.type === "context") { + continue; } - if (passage.valid.valid === false) { - if (this.options.invalid_sequence_strategy === "ignore" && entity.type === "sequence") { - this.snap_sequence("ignore", entity, osises, i, length); + // A given entity, even if part of a sequence, always only has one set of translations associated with it. + translations = []; + translation_alias = null; + if (entity.passages[0].translations != null) { + ref1 = entity.passages[0].translations; + for (l = 0, len = ref1.length; l < len; l++) { + translation = ref1[l]; + translation_osis = ((ref2 = translation.osis) != null ? ref2.length : void 0) > 0 ? translation.osis : ""; + if (translation_alias == null) { + translation_alias = translation.alias; + } + translations.push(translation_osis); + } + } else { + translations = [""]; + translation_alias = "default"; + } + osises = []; + length = entity.passages.length; + for (i = m = 0, ref3 = length; (0 <= ref3 ? m < ref3 : m > ref3); i = 0 <= ref3 ? ++m : --m) { + passage = entity.passages[i]; + // The `type` is usually only set in a sequence. + if (passage.type == null) { + passage.type = entity.type; } - if (this.options.invalid_passage_strategy === "ignore") { + if (passage.valid.valid === false) { + if (this.options.invalid_sequence_strategy === "ignore" && entity.type === "sequence") { + this.snap_sequence("ignore", entity, osises, i, length); + } + if (this.options.invalid_passage_strategy === "ignore") { + // Stop here if we're ignoring invalid passages. + continue; + } + } + // If indicated in `@options`, exclude stray start/end books, resetting the parent indices as needed. + if ((passage.type === "b" || passage.type === "b_range") && this.options.book_sequence_strategy === "ignore" && entity.type === "sequence") { + this.snap_sequence("book", entity, osises, i, length); continue; } + if ((passage.type === "b_range_start" || passage.type === "range_end_b") && this.options.book_range_strategy === "ignore") { + this.snap_range(entity, i); + } + if (passage.absolute_indices == null) { + passage.absolute_indices = entity.absolute_indices; + } + osises.push({ + osis: passage.valid.valid ? this.to_osis(passage.start, passage.end, translation_alias) : "", + type: passage.type, + indices: passage.absolute_indices, + translations: translations, + start: passage.start, + end: passage.end, + enclosed_indices: passage.enclosed_absolute_indices, + entity_id: entity_id, + entities: [passage] + }); } - if ((passage.type === "b" || passage.type === "b_range") && this.options.book_sequence_strategy === "ignore" && entity.type === "sequence") { - this.snap_sequence("book", entity, osises, i, length); + if (osises.length === 0) { + // Don't return an empty object. continue; } - if ((passage.type === "b_range_start" || passage.type === "range_end_b") && this.options.book_range_strategy === "ignore") { - this.snap_range(entity, i); - } - if (passage.absolute_indices == null) { - passage.absolute_indices = entity.absolute_indices; - } - osises.push({ - osis: passage.valid.valid ? this.to_osis(passage.start, passage.end, translation_alias) : "", - type: passage.type, - indices: passage.absolute_indices, - translations: translations, - start: passage.start, - end: passage.end, - enclosed_indices: passage.enclosed_absolute_indices, - entity_id: entity_id, - entities: [passage] - }); + if (osises.length > 1 && this.options.consecutive_combination_strategy === "combine") { + osises = this.combine_consecutive_passages(osises, translation_alias); + } + // Add the osises array to the existing array. + if (this.options.sequence_combination_strategy === "separate") { + out = out.concat(osises); + } else { + // Add the OSIS string and some data to the array. + strings = []; + last_i = osises.length - 1; + if ((osises[last_i].enclosed_indices != null) && osises[last_i].enclosed_indices[1] >= 0) { + // Adjust the end index to match a closing parenthesis when presented with `enclosed` entities. These entities always start mid-sequence (unless there's a book we're ignoring), so we don't need to worry about the start index. + entity.absolute_indices[1] = osises[last_i].enclosed_indices[1]; + } + for (n = 0, len1 = osises.length; n < len1; n++) { + osis = osises[n]; + if (osis.osis.length > 0) { + strings.push(osis.osis); + } + } + out.push({ + osis: strings.join(","), + indices: entity.absolute_indices, + translations: translations, + entity_id: entity_id, + entities: osises + }); + } + } + return out; + } + + to_osis(start, end, translation) { + var osis, out; + if ((end.c == null) && (end.v == null) && start.b === end.b && (start.c == null) && (start.v == null) && this.options.book_alone_strategy === "first_chapter") { + // If it's just a book on its own, how we deal with it depends on whether we want to return just the first chapter or the complete book. + end.c = 1; + } + osis = { + start: "", + end: "" + }; + // If no start chapter or verse, assume the first possible. + if (start.c == null) { + start.c = 1; } - if (osises.length === 0) { - continue; + if (start.v == null) { + start.v = 1; } - if (osises.length > 1 && this.options.consecutive_combination_strategy === "combine") { - osises = this.combine_consecutive_passages(osises, translation_alias); + // If no end chapter or verse, assume the last possible. If it's a single-chapter book, always use the first chapter for consistency with other `passage_existence_strategy` results (which do respect the single-chapter length). + if (end.c == null) { + if (this.options.passage_existence_strategy.indexOf("c") >= 0 || ((this.passage.translations[translation].chapters[end.b] != null) && this.passage.translations[translation].chapters[end.b].length === 1)) { + end.c = this.passage.translations[translation].chapters[end.b].length; + } else { + end.c = 999; + } } - if (this.options.sequence_combination_strategy === "separate") { - out = out.concat(osises); - } else { - strings = []; - last_i = osises.length - 1; - if ((osises[last_i].enclosed_indices != null) && osises[last_i].enclosed_indices[1] >= 0) { - entity.absolute_indices[1] = osises[last_i].enclosed_indices[1]; - } - for (n = 0, len1 = osises.length; n < len1; n++) { - osis = osises[n]; - if (osis.osis.length > 0) { - strings.push(osis.osis); - } - } - out.push({ - osis: strings.join(","), - indices: entity.absolute_indices, - translations: translations, - entity_id: entity_id, - entities: osises - }); + if (end.v == null) { + if ((this.passage.translations[translation].chapters[end.b][end.c - 1] != null) && this.options.passage_existence_strategy.indexOf("v") >= 0) { + end.v = this.passage.translations[translation].chapters[end.b][end.c - 1]; + } else { + end.v = 999; + } } - } - return out; - }; - - bcv_parser.prototype.to_osis = function(start, end, translation) { - var osis, out; - if ((end.c == null) && (end.v == null) && start.b === end.b && (start.c == null) && (start.v == null) && this.options.book_alone_strategy === "first_chapter") { - end.c = 1; - } - osis = { - start: "", - end: "" - }; - if (start.c == null) { - start.c = 1; - } - if (start.v == null) { - start.v = 1; - } - if (end.c == null) { - if (this.options.passage_existence_strategy.indexOf("c") >= 0 || ((this.passage.translations[translation].chapters[end.b] != null) && this.passage.translations[translation].chapters[end.b].length === 1)) { - end.c = this.passage.translations[translation].chapters[end.b].length; + if (this.options.include_apocrypha && this.options.ps151_strategy === "b" && ((start.c === 151 && start.b === "Ps") || (end.c === 151 && end.b === "Ps"))) { + this.fix_ps151(start, end, translation); + } + // If it's a complete book or range of complete books and we want the shortest possible OSIS, return just the book names. The `end.c` and `end.v` equaling 999 is for when the `passage_existence_strategy` sets them to 999, indicating that we should treat it as a complete book or chapter. + if (this.options.osis_compaction_strategy === "b" && start.c === 1 && start.v === 1 && ((end.c === 999 && end.v === 999) || (end.c === this.passage.translations[translation].chapters[end.b].length && this.options.passage_existence_strategy.indexOf("c") >= 0 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))))) { + osis.start = start.b; + osis.end = end.b; + // If it's a complete chapter or range of complete chapters and we want a short OSIS, return just the books and chapters. We only care when `osis_compaction_strategy` isn't `bcv` (i.e., length 3) because `bcv` is always fully specified. + } else if (this.options.osis_compaction_strategy.length <= 2 && start.v === 1 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))) { + osis.start = start.b + "." + start.c.toString(); + osis.end = end.b + "." + end.c.toString(); } else { - end.c = 999; + // Otherwise, return the full BCV reference for both. + osis.start = start.b + "." + start.c.toString() + "." + start.v.toString(); + osis.end = end.b + "." + end.c.toString() + "." + end.v.toString(); } - } - if (end.v == null) { - if ((this.passage.translations[translation].chapters[end.b][end.c - 1] != null) && this.options.passage_existence_strategy.indexOf("v") >= 0) { - end.v = this.passage.translations[translation].chapters[end.b][end.c - 1]; + // If it's the same verse ("Gen.1.1-Gen.1.1"), chapter ("Gen.1-Gen.1") or book ("Gen-Gen"), return just the start so we don't end up with an empty range. + if (osis.start === osis.end) { + out = osis.start; } else { - end.v = 999; + // Otherwise return the range. + out = osis.start + "-" + osis.end; } + if (start.extra != null) { + out = start.extra + "," + out; + } + if (end.extra != null) { + out += "," + end.extra; + } + return out; } - if (this.options.include_apocrypha && this.options.ps151_strategy === "b" && ((start.c === 151 && start.b === "Ps") || (end.c === 151 && end.b === "Ps"))) { - this.fix_ps151(start, end, translation); - } - if (this.options.osis_compaction_strategy === "b" && start.c === 1 && start.v === 1 && ((end.c === 999 && end.v === 999) || (end.c === this.passage.translations[translation].chapters[end.b].length && this.options.passage_existence_strategy.indexOf("c") >= 0 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))))) { - osis.start = start.b; - osis.end = end.b; - } else if (this.options.osis_compaction_strategy.length <= 2 && start.v === 1 && (end.v === 999 || (end.v === this.passage.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0))) { - osis.start = start.b + "." + start.c.toString(); - osis.end = end.b + "." + end.c.toString(); - } else { - osis.start = start.b + "." + start.c.toString() + "." + start.v.toString(); - osis.end = end.b + "." + end.c.toString() + "." + end.v.toString(); - } - if (osis.start === osis.end) { - out = osis.start; - } else { - out = osis.start + "-" + osis.end; - } - if (start.extra != null) { - out = start.extra + "," + out; - } - if (end.extra != null) { - out += "," + end.extra; - } - return out; - }; - bcv_parser.prototype.fix_ps151 = function(start, end, translation) { - var ref; - if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters["Ps151"] : void 0) == null)) { - this.passage.promote_book_to_translation("Ps151", translation); - } - if (start.c === 151 && start.b === "Ps") { - if (end.c === 151 && end.b === "Ps") { - start.b = "Ps151"; - start.c = 1; - end.b = "Ps151"; - return end.c = 1; + // If we want to treat Ps151 as a book rather than a chapter, we have to do some gymnastics to make sure it returns properly. + fix_ps151(start, end, translation) { + var ref; + // Ps151 doesn't necessarily get promoted into the translation chapter list because during the string parsing, we treat it as `Ps` rather than `Ps151`. + if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters["Ps151"] : void 0) == null)) { + this.passage.promote_book_to_translation("Ps151", translation); + } + if (start.c === 151 && start.b === "Ps") { + // If the whole range is in Ps151, we can just reset both sets of books and chapters; we don't have to worry about odd ranges. + if (end.c === 151 && end.b === "Ps") { + start.b = "Ps151"; + start.c = 1; + end.b = "Ps151"; + return end.c = 1; + } else { + // This is the string we're going to prepend to our final output. + // Otherwise, we generate the OSIS for Ps151 and then set the beginning of the range to the next book. We assume that the next book is Prov, which isn't necessarily the case. I'm not aware of a canon that doesn't place Prov after Ps, however. + start.extra = this.to_osis({ + b: "Ps151", + c: 1, + v: start.v + }, { + b: "Ps151", + c: 1, + v: this.passage.translations[translation].chapters["Ps151"][0] + }, translation); + start.b = "Prov"; + start.c = 1; + return start.v = 1; + } } else { - start.extra = this.to_osis({ + // This is the string we're going to append to the final output. + // We know that end is in Ps151 and start is beforehand. + end.extra = this.to_osis({ b: "Ps151", c: 1, - v: start.v + v: 1 }, { b: "Ps151", c: 1, - v: this.passage.translations[translation].chapters["Ps151"][0] + v: end.v }, translation); - start.b = "Prov"; - start.c = 1; - return start.v = 1; - } - } else { - end.extra = this.to_osis({ - b: "Ps151", - c: 1, - v: 1 - }, { - b: "Ps151", - c: 1, - v: end.v - }, translation); - end.c = 150; - return end.v = this.passage.translations[translation].chapters["Ps"][149]; - } - }; - - bcv_parser.prototype.combine_consecutive_passages = function(osises, translation) { - var enclosed_sequence_start, has_enclosed, i, is_enclosed_last, k, last_i, osis, out, prev, prev_i, ref; - out = []; - prev = {}; - last_i = osises.length - 1; - enclosed_sequence_start = -1; - has_enclosed = false; - for (i = k = 0, ref = last_i; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { - osis = osises[i]; - if (osis.osis.length > 0) { - prev_i = out.length - 1; - is_enclosed_last = false; - if (osis.enclosed_indices[0] !== enclosed_sequence_start) { - enclosed_sequence_start = osis.enclosed_indices[0]; - } - if (enclosed_sequence_start >= 0 && (i === last_i || osises[i + 1].enclosed_indices[0] !== osis.enclosed_indices[0])) { - is_enclosed_last = true; - has_enclosed = true; - } - if (this.is_verse_consecutive(prev, osis.start, translation)) { - out[prev_i].end = osis.end; - out[prev_i].is_enclosed_last = is_enclosed_last; - out[prev_i].indices[1] = osis.indices[1]; - out[prev_i].enclosed_indices[1] = osis.enclosed_indices[1]; - out[prev_i].osis = this.to_osis(out[prev_i].start, osis.end, translation); + // Set the end of the range to be the end of Ps.150, which immediately precedes Ps151. + end.c = 150; + return end.v = this.passage.translations[translation].chapters["Ps"][149]; + } + } + + // If we have the correct `option` set (checked before calling this function), merge passages that refer to sequential verses: Gen 1, 2 -> Gen 1-2. It works for any combination of books, chapters, and verses. + combine_consecutive_passages(osises, translation) { + var enclosed_sequence_start, has_enclosed, i, is_enclosed_last, k, last_i, osis, out, prev, prev_i, ref; + out = []; + prev = {}; + last_i = osises.length - 1; + enclosed_sequence_start = -1; + has_enclosed = false; + for (i = k = 0, ref = last_i; (0 <= ref ? k <= ref : k >= ref); i = 0 <= ref ? ++k : --k) { + osis = osises[i]; + if (osis.osis.length > 0) { + prev_i = out.length - 1; + is_enclosed_last = false; + // Record the start index of the enclosed sequence for use in future iterations. + if (osis.enclosed_indices[0] !== enclosed_sequence_start) { + enclosed_sequence_start = osis.enclosed_indices[0]; + } + // If we're in an enclosed sequence and it's either the last item in the sequence or the next item in the sequence isn't part of the same enclosed sequence, then we've reached the end of the enclosed sequence. + if (enclosed_sequence_start >= 0 && (i === last_i || osises[i + 1].enclosed_indices[0] !== osis.enclosed_indices[0])) { + is_enclosed_last = true; + // We may need to adjust the indices later. + has_enclosed = true; + } + // Pretend like the previous `end` and existing `start` don't exist. + if (this.is_verse_consecutive(prev, osis.start, translation)) { + out[prev_i].end = osis.end; + // Set the enclosed indices if it's last or at the end of a sequence of enclosed indices. Otherwise only extend the indices to the actual indices--e.g., `Ps 117 (118, 120)`, should only extend to after `118`. + out[prev_i].is_enclosed_last = is_enclosed_last; + out[prev_i].indices[1] = osis.indices[1]; + out[prev_i].enclosed_indices[1] = osis.enclosed_indices[1]; + out[prev_i].osis = this.to_osis(out[prev_i].start, osis.end, translation); + } else { + out.push(osis); + } + prev = { + b: osis.end.b, + c: osis.end.c, + v: osis.end.v + }; } else { out.push(osis); + prev = {}; } - prev = { - b: osis.end.b, - c: osis.end.c, - v: osis.end.v - }; - } else { - out.push(osis); - prev = {}; } + if (has_enclosed) { + this.snap_enclosed_indices(out); + } + return out; } - if (has_enclosed) { - this.snap_enclosed_indices(out); - } - return out; - }; - bcv_parser.prototype.snap_enclosed_indices = function(osises) { - var k, len, osis; - for (k = 0, len = osises.length; k < len; k++) { - osis = osises[k]; - if (osis.is_enclosed_last != null) { - if (osis.enclosed_indices[0] < 0 && osis.is_enclosed_last) { - osis.indices[1] = osis.enclosed_indices[1]; + // If there's an enclosed reference--e.g., Ps 1 (2)--and we've combined consecutive passages in such a way that the enclosed reference is fully inside the sequence (i.e., if it starts before the enclosed sequence), then make sure the end index for the passage includes the necessary closing punctuation. + snap_enclosed_indices(osises) { + var k, len, osis; + for (k = 0, len = osises.length; k < len; k++) { + osis = osises[k]; + if (osis.is_enclosed_last != null) { + if (osis.enclosed_indices[0] < 0 && osis.is_enclosed_last) { + osis.indices[1] = osis.enclosed_indices[1]; + } + delete osis.is_enclosed_last; } - delete osis.is_enclosed_last; } + return osises; } - return osises; - }; - bcv_parser.prototype.is_verse_consecutive = function(prev, check, translation) { - var translation_order; - if (prev.b == null) { - return false; - } - translation_order = this.passage.translations[translation].order != null ? this.passage.translations[translation].order : this.passage.translations["default"].order; - if (prev.b === check.b) { - if (prev.c === check.c) { - if (prev.v === check.v - 1) { - return true; + // Given two fully specified objects (complete bcvs), find whether they're sequential. + is_verse_consecutive(prev, check, translation) { + var translation_order; + if (prev.b == null) { + return false; + } + // A translation doesn't always have an `order` set. If it doesn't, then use the default order. + translation_order = this.passage.translations[translation].order != null ? this.passage.translations[translation].order : this.passage.translations.default.order; + if (prev.b === check.b) { + if (prev.c === check.c) { + if (prev.v === check.v - 1) { + return true; + } + } else if (check.v === 1 && prev.c === check.c - 1) { + if (prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { + return true; + } } - } else if (check.v === 1 && prev.c === check.c - 1) { - if (prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { + } else if (check.c === 1 && check.v === 1 && translation_order[prev.b] === translation_order[check.b] - 1) { + if (prev.c === this.passage.translations[translation].chapters[prev.b].length && prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { return true; } } - } else if (check.c === 1 && check.v === 1 && translation_order[prev.b] === translation_order[check.b] - 1) { - if (prev.c === this.passage.translations[translation].chapters[prev.b].length && prev.v === this.passage.translations[translation].chapters[prev.b][prev.c - 1]) { - return true; - } + return false; } - return false; - }; - bcv_parser.prototype.snap_range = function(entity, passage_i) { - var entity_i, key, pluck, ref, source_entity, target_entity, temp, type; - if (entity.type === "b_range_start" || (entity.type === "sequence" && entity.passages[passage_i].type === "b_range_start")) { - entity_i = 1; - source_entity = "end"; - type = "b_range_start"; - } else { - entity_i = 0; - source_entity = "start"; - type = "range_end_b"; - } - target_entity = source_entity === "end" ? "start" : "end"; - ref = entity.passages[passage_i][target_entity]; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - entity.passages[passage_i][target_entity][key] = entity.passages[passage_i][source_entity][key]; - } - if (entity.type === "sequence") { - if (passage_i >= entity.value.length) { - passage_i = entity.value.length - 1; - } - pluck = this.passage.pluck(type, entity.value[passage_i]); - if (pluck != null) { - temp = this.snap_range(pluck, 0); - if (passage_i === 0) { - entity.absolute_indices[0] = temp.absolute_indices[0]; - } else { - entity.absolute_indices[1] = temp.absolute_indices[1]; + // Snap the start/end index of the range when it includes a book on its own and `@options.book_range_strategy` is `ignore`. + snap_range(entity, passage_i) { + var entity_i, key, pluck, ref, source_entity, target_entity, temp, type; + // If the book is at the start of the range, we want to ignore the first part of the range. + if (entity.type === "b_range_start" || (entity.type === "sequence" && entity.passages[passage_i].type === "b_range_start")) { + entity_i = 1; + source_entity = "end"; + type = "b_range_start"; + } else { + // If the book is at the end of the range, we want to ignore the end of the range. + entity_i = 0; + source_entity = "start"; + type = "range_end_b"; + } + target_entity = source_entity === "end" ? "start" : "end"; + ref = entity.passages[passage_i][target_entity]; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + entity.passages[passage_i][target_entity][key] = entity.passages[passage_i][source_entity][key]; + } + if (entity.type === "sequence") { + if (passage_i >= entity.value.length) { + // This can be too long if a range is converted into a sequence where it ends with an open book range (`Matt 10-Rev`) that we want to ignore. At this point, the `passages` and `value` keys can get out-of-sync. + passage_i = entity.value.length - 1; + } + pluck = this.passage.pluck(type, entity.value[passage_i]); + // The `pluck` can be null if we've already overwritten its `type` in a previous recursion. This process is unusual, but can happen in "Proverbs 31:2. Vs 10 to dan". + if (pluck != null) { + temp = this.snap_range(pluck, 0); + // Move the indices to exclude what we've omitted. We want to move it even if it isn't the last one in case there are multiple books at the end--this way it'll use the correct indices. + if (passage_i === 0) { + entity.absolute_indices[0] = temp.absolute_indices[0]; + } else { + entity.absolute_indices[1] = temp.absolute_indices[1]; + } } + } else { + // If it's not a sequence, change the `type` and `absolute_indices` to exclude the book we're omitting. + entity.original_type = entity.type; + entity.type = entity.value[entity_i].type; + entity.absolute_indices = [entity.value[entity_i].absolute_indices[0], entity.value[entity_i].absolute_indices[1]]; } - } else { - entity.original_type = entity.type; - entity.type = entity.value[entity_i].type; - entity.absolute_indices = [entity.value[entity_i].absolute_indices[0], entity.value[entity_i].absolute_indices[1]]; + return entity; } - return entity; - }; - bcv_parser.prototype.snap_sequence = function(type, entity, osises, i, length) { - var passage; - passage = entity.passages[i]; - if (passage.absolute_indices[0] === entity.absolute_indices[0] && i < length - 1 && this.get_snap_sequence_i(entity.passages, i, length) !== i) { - entity.absolute_indices[0] = entity.passages[i + 1].absolute_indices[0]; - this.remove_absolute_indices(entity.passages, i + 1); - } else if (passage.absolute_indices[1] === entity.absolute_indices[1] && i > 0) { - entity.absolute_indices[1] = osises.length > 0 ? osises[osises.length - 1].indices[1] : entity.passages[i - 1].absolute_indices[1]; - } else if (type === "book" && i < length - 1 && !this.starts_with_book(entity.passages[i + 1])) { - entity.passages[i + 1].absolute_indices[0] = passage.absolute_indices[0]; - } - return entity; - }; + // Snap the start/end index of the entity or surrounding passages when there's a lone book or invalid item in a sequence. + snap_sequence(type, entity, osises, i, length) { + var passage; + passage = entity.passages[i]; + // If the passage is the first thing in the sequence and something is after it, snap the start index of the whole entity to the start index of the next item. - bcv_parser.prototype.get_snap_sequence_i = function(passages, i, length) { - var j, k, ref, ref1; - for (j = k = ref = i + 1, ref1 = length; ref <= ref1 ? k < ref1 : k > ref1; j = ref <= ref1 ? ++k : --k) { - if (this.starts_with_book(passages[j])) { - return j; - } - if (passages[j].valid.valid) { - return i; + // But we only want to do this if it's followed by a book (if it's "Matt, 5", we want to be sure to include "Matt" as part of the indices and bypass this step). We can tell if that's the case if the `type` of what follows starts with `b` or if it's a `range` starting in a different book. The tricky part occurs when we have several invalid references at the start (Matt 29, 30, Acts 1)--we need to find the first value that's a book. If there's a valid item before the next book, abort. + if (passage.absolute_indices[0] === entity.absolute_indices[0] && i < length - 1 && this.get_snap_sequence_i(entity.passages, i, length) !== i) { + entity.absolute_indices[0] = entity.passages[i + 1].absolute_indices[0]; + this.remove_absolute_indices(entity.passages, i + 1); + // If the passage is the last thing in a sequence (but not the only one), snap the entity end index to the end index of the previous valid item. To handle multiple items at the end, snap back to the last known good item if available. + } else if (passage.absolute_indices[1] === entity.absolute_indices[1] && i > 0) { + entity.absolute_indices[1] = osises.length > 0 ? osises[osises.length - 1].indices[1] : entity.passages[i - 1].absolute_indices[1]; + // Otherwise, if the next item doesn't start with a book, link the start index of the current passage to the next one because we're including the current passage as part of the next one. In "Eph. 4. Gen, Matt, 6", the `Matt, ` should be part of the `6`, but "Eph. 4. Gen, Matt, 1cor6" should exclude `Matt`. + } else if (type === "book" && i < length - 1 && !this.starts_with_book(entity.passages[i + 1])) { + entity.passages[i + 1].absolute_indices[0] = passage.absolute_indices[0]; } + // Return something only for unit testing. + return entity; } - return i; - }; - bcv_parser.prototype.starts_with_book = function(passage) { - if (passage.type.substr(0, 1) === "b") { - return true; - } - if ((passage.type === "range" || passage.type === "ff") && passage.start.type.substr(0, 1) === "b") { - return true; + // Identify whether there are any valid items between the current item and the next book. + get_snap_sequence_i(passages, i, length) { + var j, k, ref, ref1; + for (j = k = ref = i + 1, ref1 = length; (ref <= ref1 ? k < ref1 : k > ref1); j = ref <= ref1 ? ++k : --k) { + if (this.starts_with_book(passages[j])) { + return j; + } + if (passages[j].valid.valid) { + return i; + } + } + return i; } - return false; - }; - bcv_parser.prototype.remove_absolute_indices = function(passages, i) { - var end, k, len, passage, ref, ref1, start; - if (passages[i].enclosed_absolute_indices[0] < 0) { + // Given a passage, does it start with a book? It never takes a sequence as an argument. + starts_with_book(passage) { + if (passage.type.substr(0, 1) === "b") { + return true; + } + if ((passage.type === "range" || passage.type === "ff") && passage.start.type.substr(0, 1) === "b") { + return true; + } return false; } - ref = passages[i].enclosed_absolute_indices, start = ref[0], end = ref[1]; - ref1 = passages.slice(i); - for (k = 0, len = ref1.length; k < len; k++) { - passage = ref1[k]; - if (passage.enclosed_absolute_indices[0] === start && passage.enclosed_absolute_indices[1] === end) { - passage.enclosed_absolute_indices = [-1, -1]; - } else { - break; + + // Remove absolute indices from the given passage to the end of the sequence. We do this when we don't want to include the end of a sequence in the sequence (most likely because it's invalid or a book on its own). + remove_absolute_indices(passages, i) { + var end, k, len, passage, ref, start; + if (passages[i].enclosed_absolute_indices[0] < 0) { + return false; + } + [start, end] = passages[i].enclosed_absolute_indices; + ref = passages.slice(i); + for (k = 0, len = ref.length; k < len; k++) { + passage = ref[k]; + if (passage.enclosed_absolute_indices[0] === start && passage.enclosed_absolute_indices[1] === end) { + passage.enclosed_absolute_indices = [-1, -1]; + } else { + break; + } } + return true; } - return true; + }; - return bcv_parser; + bcv_parser.prototype.s = ""; - })(); + bcv_parser.prototype.entities = []; - root.bcv_parser = bcv_parser; + bcv_parser.prototype.passage = null; - bcv_passage = (function() { - function bcv_passage() {} + bcv_parser.prototype.regexps = {}; - bcv_passage.prototype.books = []; + // ## Main Options + bcv_parser.prototype.options = { + // ### OSIS Output + // * `combine`: "Matt 5, 6, 7" -> "Matt.5-Matt.7". + // * `separate`: "Matt 5, 6, 7" -> "Matt.5,Matt.6,Matt.7". + consecutive_combination_strategy: "combine", + // * `b`: OSIS refs get reduced to the shortest possible. "Gen.1.1-Gen.50.26" and "Gen.1-Gen.50" -> "Gen", while "Gen.1.1-Gen.2.25" -> "Gen.1-Gen.2". + // * `bc`: OSIS refs get reduced to complete chapters if possible, but not whole books. "Gen.1.1-Gen.50.26" -> "Gen.1-Gen.50". + // * `bcv`: OSIS refs always include the full book, chapter, and verse. "Gen.1" -> "Gen.1.1-Gen.1.31". + osis_compaction_strategy: "b", + // ### Sequence + // * `ignore`: ignore any books on their own in sequences ("Gen Is 1" -> "Isa.1"). + // * `include`: any books that appear on their own get parsed according to `book_alone_strategy` ("Gen Is 1" means "Gen.1-Gen.50,Isa.1" if `book_alone_strategy` is `full` or `ignore`, or "Gen.1,Isa.1" if it's `first_chapter`). + book_sequence_strategy: "ignore", + // * `ignore`: "Matt 99, Gen 1" sequence index starts at the valid `Gen 1`. + // * `include`: "Matt 99, Gen 1" sequence index starts at the invalid `Matt 99`. + invalid_sequence_strategy: "ignore", + // * `combine`: sequential references in the text are combined into a single comma-separated OSIS string: "Gen 1, 3" → `"Gen.1,Gen.3"`. + // * `separate`: sequential references in the text are separated into an array of their component parts: "Gen 1, 3" → `["Gen.1", "Gen.3"]`. + sequence_combination_strategy: "combine", + // * `us`: commas separate sequences, periods separate chapters and verses. "Matt 1, 2. 4" → "Matt.1,Matt.2.4". + // * `eu`: periods separate sequences, commas separate chapters and verses. "Matt 1, 2. 4" → "Matt.1.2,Matt.1.4". + punctuation_strategy: "us", + // ### Potentially Invalid Input + // * `ignore`: Include only valid passages in `parsed_entities()`. + // * `include`: Include invalid passages in `parsed_entities()` (they still don't have OSIS values). + invalid_passage_strategy: "ignore", + // * `ignore`: treat non-Latin digits the same as any other character. + // * `replace`: replace non-Latin (0-9) numeric digits with Latin digits. This replacement occurs before any book substitution. + non_latin_digits_strategy: "ignore", + // * Include `b` in the string to validate book order ("Revelation to Genesis" is invalid). + // * Include `c` in the string to validate chapter existence. If omitted, strings like "Genesis 51" (which doesn't exist) return as valid. Omitting `c` means that looking up full books will return `999` as the end chapter: "Genesis to Exodus" → "Gen.1-Exod.999". + // * Include `v` in the string to validate verse existence. If omitted, strings like `Genesis 1:100` (which doesn't exist) return as valid. Omitting `v` means that looking up full chapters will return `999` as the end verse: "Genesis 1:2 to chapter 3" → "Gen.1.2-Gen.3.999". + // * Tested values are `b`, `bc`, `bcv`, `bv`, `c`, `cv`, `v`, and `none`. In all cases, single-chapter books still respond as single-chapter books to allow treating strings like `Obadiah 2` as `Obad.1.2`. + passage_existence_strategy: "bcv", + // * `error`: zero chapters ("Matthew 0") are invalid. + // * `upgrade`: zero chapters are upgraded to 1: "Matthew 0" -> "Matt.1". + // Unlike `zero_verse_strategy`, chapter 0 isn't allowed. + zero_chapter_strategy: "error", + // * `error`: zero verses ("Matthew 5:0") are invalid. + // * `upgrade`: zero verses are upgraded to 1: "Matthew 5:0" -> "Matt.5.1". + // * `allow`: zero verses are kept as-is: "Matthew 5:0" -> "Matt.5.0". Some traditions use 0 for Psalm titles. + zero_verse_strategy: "error", + // * `chapter`: treat "Jude 1" as referring to the complete book of Jude: `Jude.1`. People almost always want this output when they enter this text in a search box. + // * `verse`: treat "Jude 1" as referring to the first verse in Jude: `Jude.1.1`. If you're parsing specialized text that follows a style guide, you may want to set this option. + single_chapter_1_strategy: "chapter", + // ### Context + // * `ignore`: any books that appear on their own don't get parsed as books ("Gen saw" doesn't trigger a match, but "Gen 1" does). + // * `full`: any books that appear on their own get parsed as the complete book ("Gen" means "Gen.1-Gen.50"). + // * `first_chapter`: any books that appear on their own get parsed as the first chapter ("Gen" means "Gen.1"). + book_alone_strategy: "ignore", + // * `ignore`: any books that appear on their own in a range are ignored ("Matt-Mark 2" means "Mark.2"). + // * `include`: any books that appear on their own in a range are included as part of the range ("Matt-Mark 2" means "Matt.1-Mark.2", while "Matt 2-Mark" means "Matt.2-Mark.16"). + book_range_strategy: "ignore", + // * `delete`: remove any digits at the end of a sequence that are preceded by spaces and immediately followed by a `\w`: "Matt 5 1Hi" -> "Matt.5". This is better for text extraction. + // * `include`: keep any digits at the end of a sequence that are preceded by spaces and immediately followed by a `\w`: "Matt 5 1Hi" -> "Matt.5.1". This is better for query parsing. + captive_end_digits_strategy: "delete", + // * `verse`: treat "Jer 33-11" as "Jer.33.11" (end before start) and "Heb 13-15" as "Heb.13.15" (end range too high). + // * `sequence`: treat them as sequences. + end_range_digits_strategy: "verse", + // ### Apocrypha + // Don't set this value directly; use the `include_apocrypha` or `set_options` functions. + include_apocrypha: false, + // `c`: treat references to Psalm 151 (if using the Apocrypha) as a chapter: "Psalm 151:1" -> "Ps.151.1" + // `b`: treat references to Psalm 151 (if using the Apocrypha) as a book: "Psalm 151:1" -> "Ps151.1.1". Be aware that for ranges starting or ending in Psalm 151, you'll get two OSISes, regardless of the `sequence_combination_strategy`: "Psalms 149-151" -> "Ps.149-Ps.150,Ps151.1" Setting this option to `b` is the only way to correctly parse OSISes that treat `Ps151` as a book. + ps151_strategy: "c", + // ### Versification System + // Don't set this value directly; use the `versification_system` or `set_options` functions. + // * `default`: the default ESV-style versification. Also used in AMP and NASB. + // * `ceb`: use CEB versification, which varies mostly in the Apocrypha. + // * `kjv`: use KJV versification, with one fewer verse in 3John. Also used in NIV and NKJV. + // `nab`: use NAB versification, which generally follows the Septuagint. + // * `nlt`: use NLT versification, with one extra verse in Rev. Also used in NCV. + // * `nrsv`: use NRSV versification. + // * `vulgate`: use Vulgate (Greek) numbering for the Psalms. + versification_system: "default", + // ### Case Sensitivity + // Don't use this value directly; use the `set_options` function. Changing this option repeatedly will slow down execution. + // * `none`: All matches are case-insensitive. + // * `books`: Book names are case-sensitive. Everything else is still case-insensitive. + case_sensitive: "none" + }; - bcv_passage.prototype.indices = {}; + return bcv_parser; - bcv_passage.prototype.options = {}; + }).call(this); - bcv_passage.prototype.translations = {}; + root.bcv_parser = bcv_parser; - bcv_passage.prototype.handle_array = function(passages, accum, context) { - var k, len, passage, ref; - if (accum == null) { - accum = []; - } - if (context == null) { - context = {}; - } - for (k = 0, len = passages.length; k < len; k++) { - passage = passages[k]; - if (passage == null) { - continue; - } - if (passage.type === "stop") { - break; + bcv_passage = (function() { + // This class takes the output from the grammar and turns it into simpler objects for additional processing or for output. + class bcv_passage { + // ## Public + // Loop through the parsed passages. + handle_array(passages, accum = [], context = {}) { + var k, len, passage; +// `passages` is an array of passage objects. + for (k = 0, len = passages.length; k < len; k++) { + passage = passages[k]; + if (passage == null) { + // The grammar can sometimes emit `null`. + continue; + } + if (passage.type === "stop") { + // Each `passage` consists of passage objects and, possibly, strings. + break; + } + [accum, context] = this.handle_obj(passage, accum, context); } - ref = this.handle_obj(passage, accum, context), accum = ref[0], context = ref[1]; - } - return [accum, context]; - }; - - bcv_passage.prototype.handle_obj = function(passage, accum, context) { - if ((passage.type != null) && (this[passage.type] != null)) { - return this[passage.type](passage, accum, context); - } else { return [accum, context]; } - }; - bcv_passage.prototype.b = function(passage, accum, context) { - var alternates, b, k, len, obj, ref, valid; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - alternates = []; - ref = this.books[passage.value].parsed; - for (k = 0, len = ref.length; k < len; k++) { - b = ref[k]; - valid = this.validate_ref(passage.start_context.translations, { - b: b - }); - obj = { - start: { - b: b - }, - end: { - b: b - }, - valid: valid - }; - if (passage.passages.length === 0 && valid.valid) { - passage.passages.push(obj); + // Handle a typical passage object with an `index`, `type`, and array in `value`. + handle_obj(passage, accum, context) { + if ((passage.type != null) && (this[passage.type] != null)) { + return this[passage.type](passage, accum, context); } else { - alternates.push(obj); + return [accum, context]; } } - if (passage.passages.length === 0) { - passage.passages.push(alternates.shift()); - } - if (alternates.length > 0) { - passage.passages[0].alternates = alternates; - } - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); - } - accum.push(passage); - context = { - b: passage.passages[0].start.b - }; - if (passage.start_context.translations != null) { - context.translations = passage.start_context.translations; - } - return [accum, context]; - }; - - bcv_passage.prototype.b_range = function(passage, accum, context) { - return this.range(passage, accum, context); - }; - bcv_passage.prototype.b_range_pre = function(passage, accum, context) { - var book, end, ref, ref1, start_obj; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - book = this.pluck("b", passage.value); - ref = this.b(book, [], context), (ref1 = ref[0], end = ref1[0]), context = ref[1]; - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); - } - start_obj = { - b: passage.value[0].value + end.passages[0].start.b.substr(1), - type: "b" - }; - passage.passages = [ - { - start: start_obj, - end: end.passages[0].end, - valid: end.passages[0].valid - } - ]; - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - accum.push(passage); - return [accum, context]; - }; - - bcv_passage.prototype.b_range_start = function(passage, accum, context) { - return this.range(passage, accum, context); - }; + // ## Types Returned from the PEG.js Grammar + // These functions correspond to `type` attributes returned from the grammar. They're designed to be called multiple times if necessary. - bcv_passage.prototype.base = function(passage, accum, context) { - this.indices = this.calculate_indices(passage.match, passage.start_index); - return this.handle_array(passage.value, accum, context); - }; - - bcv_passage.prototype.bc = function(passage, accum, context) { - var alternates, b, c, context_key, k, len, obj, ref, ref1, valid; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - this.reset_context(context, ["b", "c", "v"]); - c = this.pluck("c", passage.value).value; - alternates = []; - ref = this.books[this.pluck("b", passage.value).value].parsed; - for (k = 0, len = ref.length; k < len; k++) { - b = ref[k]; - context_key = "c"; - valid = this.validate_ref(passage.start_context.translations, { - b: b, - c: c - }); - obj = { - start: { - b: b - }, - end: { + // Handle a book on its own ("Gen"). + b(passage, accum, context) { + var alternates, b, k, len, obj, ref, valid; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + alternates = []; + ref = this.books[passage.value].parsed; + for (k = 0, len = ref.length; k < len; k++) { + b = ref[k]; + valid = this.validate_ref(passage.start_context.translations, { b: b - }, - valid: valid - }; - if (valid.messages.start_chapter_not_exist_in_single_chapter_book || valid.messages.start_chapter_1) { - obj.valid = this.validate_ref(passage.start_context.translations, { - b: b, - v: c }); - if (valid.messages.start_chapter_not_exist_in_single_chapter_book) { - obj.valid.messages.start_chapter_not_exist_in_single_chapter_book = 1; + obj = { + start: { + b: b + }, + end: { + b: b + }, + valid: valid + }; + // Use the first valid book. + if (passage.passages.length === 0 && valid.valid) { + passage.passages.push(obj); + } else { + alternates.push(obj); } - obj.start.c = 1; - obj.end.c = 1; - context_key = "v"; } - obj.start[context_key] = c; - ref1 = this.fix_start_zeroes(obj.valid, obj.start.c, obj.start.v), obj.start.c = ref1[0], obj.start.v = ref1[1]; - if (obj.start.v == null) { - delete obj.start.v; + if (passage.passages.length === 0) { + // If none are valid, use the first one. + passage.passages.push(alternates.shift()); } - obj.end[context_key] = obj.start[context_key]; - if (passage.passages.length === 0 && obj.valid.valid) { - passage.passages.push(obj); - } else { - alternates.push(obj); + if (alternates.length > 0) { + passage.passages[0].alternates = alternates; } - } - if (passage.passages.length === 0) { - passage.passages.push(alternates.shift()); - } - if (alternates.length > 0) { - passage.passages[0].alternates = alternates; - } - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); - } - this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); - accum.push(passage); - return [accum, context]; - }; - - bcv_passage.prototype.bc_title = function(passage, accum, context) { - var bc, i, k, ref, ref1, ref2, title; - passage.start_context = bcv_utils.shallow_clone(context); - ref = this.bc(this.pluck("bc", passage.value), [], context), (ref1 = ref[0], bc = ref1[0]), context = ref[1]; - if (bc.passages[0].start.b.substr(0, 2) !== "Ps" && (bc.passages[0].alternates != null)) { - for (i = k = 0, ref2 = bc.passages[0].alternates.length; 0 <= ref2 ? k < ref2 : k > ref2; i = 0 <= ref2 ? ++k : --k) { - if (bc.passages[0].alternates[i].start.b.substr(0, 2) !== "Ps") { - continue; - } - bc.passages[0] = bc.passages[0].alternates[i]; - break; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + accum.push(passage); + context = { + b: passage.passages[0].start.b + }; + if (passage.start_context.translations != null) { + context.translations = passage.start_context.translations; } - } - if (bc.passages[0].start.b.substr(0, 2) !== "Ps") { - accum.push(bc); return [accum, context]; } - this.books[this.pluck("b", bc.value).value].parsed = ["Ps"]; - title = this.pluck("title", passage.value); - if (title == null) { - title = this.pluck("v", passage.value); + + // Handle book-only ranges ("Gen-Exod"). + b_range(passage, accum, context) { + return this.range(passage, accum, context); } - passage.value[1] = { - type: "v", - value: [ - { - type: "integer", - value: 1, - indices: title.indices - } - ], - indices: title.indices - }; - passage.type = "bcv"; - return this.bcv(passage, accum, passage.start_context); - }; - bcv_passage.prototype.bcv = function(passage, accum, context) { - var alternates, b, bc, c, k, len, obj, ref, ref1, v, valid; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - this.reset_context(context, ["b", "c", "v"]); - bc = this.pluck("bc", passage.value); - c = this.pluck("c", bc.value).value; - v = this.pluck("v", passage.value).value; - alternates = []; - ref = this.books[this.pluck("b", bc.value).value].parsed; - for (k = 0, len = ref.length; k < len; k++) { - b = ref[k]; - valid = this.validate_ref(passage.start_context.translations, { - b: b, - c: c, - v: v - }); - ref1 = this.fix_start_zeroes(valid, c, v), c = ref1[0], v = ref1[1]; - obj = { - start: { - b: b, - c: c, - v: v - }, - end: { - b: b, - c: c, - v: v - }, - valid: valid + // Handle book-only ranges like "1-2 Samuel". It doesn't support multiple ambiguous ranges (like "1-2C"), which it probably shouldn't, anyway. + b_range_pre(passage, accum, context) { + var book, end, start_obj; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + book = this.pluck("b", passage.value); + [[end], context] = this.b(book, [], context); + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + start_obj = { + b: passage.value[0].value + end.passages[0].start.b.substr(1), + type: "b" }; - if (passage.passages.length === 0 && valid.valid) { - passage.passages.push(obj); - } else { - alternates.push(obj); + passage.passages = [ + { + start: start_obj, + end: end.passages[0].end, + valid: end.passages[0].valid + } + ]; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; } + accum.push(passage); + return [accum, context]; } - if (passage.passages.length === 0) { - passage.passages.push(alternates.shift()); - } - if (alternates.length > 0) { - passage.passages[0].alternates = alternates; - } - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + + // Handle ranges with a book as the start of the range ("Gen-Exod 2"). + b_range_start(passage, accum, context) { + return this.range(passage, accum, context); } - this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); - accum.push(passage); - return [accum, context]; - }; - bcv_passage.prototype.bv = function(passage, accum, context) { - var b, bcv, ref, ref1, ref2, v; - passage.start_context = bcv_utils.shallow_clone(context); - ref = passage.value, b = ref[0], v = ref[1]; - bcv = { - indices: passage.indices, - value: [ - { - type: "bc", - value: [ - b, { - type: "c", - value: [ - { - type: "integer", - value: 1 - } - ] - } - ] - }, v - ] - }; - ref1 = this.bcv(bcv, [], context), (ref2 = ref1[0], bcv = ref2[0]), context = ref1[1]; - passage.passages = bcv.passages; - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + // The base (root) object in the grammar controls the base indices. + base(passage, accum, context) { + this.indices = this.calculate_indices(passage.match, passage.start_index); + return this.handle_array(passage.value, accum, context); } - accum.push(passage); - return [accum, context]; - }; - bcv_passage.prototype.c = function(passage, accum, context) { - var c, valid; - passage.start_context = bcv_utils.shallow_clone(context); - c = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; - valid = this.validate_ref(passage.start_context.translations, { - b: context.b, - c: c - }); - if (!valid.valid && valid.messages.start_chapter_not_exist_in_single_chapter_book) { - return this.v(passage, accum, context); - } - c = this.fix_start_zeroes(valid, c)[0]; - passage.passages = [ - { - start: { - b: context.b, - c: c - }, - end: { - b: context.b, + // Handle book-chapter ("Gen 1"). + bc(passage, accum, context) { + var alternates, b, c, context_key, k, len, obj, ref, valid; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + this.reset_context(context, ["b", "c", "v"]); + c = this.pluck("c", passage.value).value; + alternates = []; + ref = this.books[this.pluck("b", passage.value).value].parsed; + for (k = 0, len = ref.length; k < len; k++) { + b = ref[k]; + context_key = "c"; + valid = this.validate_ref(passage.start_context.translations, { + b: b, c: c - }, - valid: valid + }); + obj = { + start: { + b: b + }, + end: { + b: b + }, + valid: valid + }; + // Is it really a `bv` object? + if (valid.messages.start_chapter_not_exist_in_single_chapter_book || valid.messages.start_chapter_1) { + obj.valid = this.validate_ref(passage.start_context.translations, { + b: b, + v: c + }); + // If it's `Jude 2`, then note that the chapter doesn't exist. + if (valid.messages.start_chapter_not_exist_in_single_chapter_book) { + obj.valid.messages.start_chapter_not_exist_in_single_chapter_book = 1; + } + obj.start.c = 1; + obj.end.c = 1; + context_key = "v"; + } + obj.start[context_key] = c; + // If it's zero, fix it before assigning the end. + [obj.start.c, obj.start.v] = this.fix_start_zeroes(obj.valid, obj.start.c, obj.start.v); + if (obj.start.v == null) { + // Don't want an undefined key hanging around the object. + delete obj.start.v; + } + obj.end[context_key] = obj.start[context_key]; + if (passage.passages.length === 0 && obj.valid.valid) { + passage.passages.push(obj); + } else { + alternates.push(obj); + } } - ]; - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - accum.push(passage); - context.c = c; - this.reset_context(context, ["v"]); - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + if (passage.passages.length === 0) { + passage.passages.push(alternates.shift()); + } + if (alternates.length > 0) { + passage.passages[0].alternates = alternates; + } + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); + accum.push(passage); + return [accum, context]; } - return [accum, context]; - }; - bcv_passage.prototype.c_psalm = function(passage, accum, context) { - var c; - passage.type = "bc"; - c = parseInt(this.books[passage.value].value.match(/^\d+/)[0], 10); - passage.value = [ - { - type: "b", - value: passage.value, - indices: passage.indices - }, { - type: "c", + // Handle "Ps 3 title" + bc_title(passage, accum, context) { + var bc, i, k, ref, title; + passage.start_context = bcv_utils.shallow_clone(context); + // First, check to see whether we're dealing with Psalms. If not, treat it as a straight `bc`. + [[bc], context] = this.bc(this.pluck("bc", passage.value), [], context); + // We check the first two characters to handle both `Ps` and `Ps151`. + if (bc.passages[0].start.b.substr(0, 2) !== "Ps" && (bc.passages[0].alternates != null)) { + for (i = k = 0, ref = bc.passages[0].alternates.length; (0 <= ref ? k < ref : k > ref); i = 0 <= ref ? ++k : --k) { + if (bc.passages[0].alternates[i].start.b.substr(0, 2) !== "Ps") { + continue; + } + // If Psalms is one of the alternates, promote it to the primary passage and discard the others--we know it's right. + bc.passages[0] = bc.passages[0].alternates[i]; + break; + } + } + if (bc.passages[0].start.b.substr(0, 2) !== "Ps") { + accum.push(bc); + return [accum, context]; + } + // Overwrite all the other book possibilities; the presence of "title" indicates a Psalm. If the previous possibilities were `["Song", "Ps"]`, they're now just `["Ps"]`. Even if it's really `Ps151`, we want `Ps` here because other functions expect it. + this.books[this.pluck("b", bc.value).value].parsed = ["Ps"]; + // Set the `indices` of the new `v` object to the indices of the `title`. We won't actually use these indices anywhere. + title = this.pluck("title", passage.value); + // The `title` will be null if it's being reparsed from a future translation because we rewrite it as a `bcv` while discarding the original `title` object. + if (title == null) { + title = this.pluck("v", passage.value); + } + passage.value[1] = { + type: "v", value: [ { type: "integer", - value: c, - indices: passage.indices + value: 1, + indices: title.indices } ], - indices: passage.indices - } - ]; - return this.bc(passage, accum, context); - }; - - bcv_passage.prototype.c_title = function(passage, accum, context) { - var title; - passage.start_context = bcv_utils.shallow_clone(context); - if (context.b !== "Ps") { - return this.c(passage.value[0], accum, context); - } - title = this.pluck("title", passage.value); - passage.value[1] = { - type: "v", - value: [ - { - type: "integer", - value: 1, - indices: title.indices - } - ], - indices: title.indices - }; - passage.type = "cv"; - return this.cv(passage, accum, passage.start_context); - }; - - bcv_passage.prototype.cv = function(passage, accum, context) { - var c, ref, v, valid; - passage.start_context = bcv_utils.shallow_clone(context); - c = this.pluck("c", passage.value).value; - v = this.pluck("v", passage.value).value; - valid = this.validate_ref(passage.start_context.translations, { - b: context.b, - c: c, - v: v - }); - ref = this.fix_start_zeroes(valid, c, v), c = ref[0], v = ref[1]; - passage.passages = [ - { - start: { - b: context.b, - c: c, - v: v - }, - end: { - b: context.b, + indices: title.indices + }; + // We don't need to preserve the original `type` for reparsing; if it gets here, it'll always be a `bcv`. + passage.type = "bcv"; + // Treat it as a standard `bcv`. + return this.bcv(passage, accum, passage.start_context); + } + + // Handle book chapter:verse ("Gen 1:1"). + bcv(passage, accum, context) { + var alternates, b, bc, c, k, len, obj, ref, v, valid; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + this.reset_context(context, ["b", "c", "v"]); + bc = this.pluck("bc", passage.value); + c = this.pluck("c", bc.value).value; + v = this.pluck("v", passage.value).value; + alternates = []; + ref = this.books[this.pluck("b", bc.value).value].parsed; + for (k = 0, len = ref.length; k < len; k++) { + b = ref[k]; + valid = this.validate_ref(passage.start_context.translations, { + b: b, c: c, v: v - }, - valid: valid + }); + [c, v] = this.fix_start_zeroes(valid, c, v); + obj = { + start: { + b: b, + c: c, + v: v + }, + end: { + b: b, + c: c, + v: v + }, + valid: valid + }; + // Use the first valid option. + if (passage.passages.length === 0 && valid.valid) { + passage.passages.push(obj); + } else { + alternates.push(obj); + } } - ]; - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - accum.push(passage); - context.c = c; - context.v = v; - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); - } - return [accum, context]; - }; - - bcv_passage.prototype.cb_range = function(passage, accum, context) { - var b, end_c, ref, start_c; - passage.type = "range"; - ref = passage.value, b = ref[0], start_c = ref[1], end_c = ref[2]; - passage.value = [ - { - type: "bc", - value: [b, start_c], - indices: passage.indices - }, end_c - ]; - end_c.indices[1] = passage.indices[1]; - return this.range(passage, accum, context); - }; - - bcv_passage.prototype.context = function(passage, accum, context) { - var key, ref; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - ref = this.books[passage.value].context; - for (key in ref) { - if (!hasProp.call(ref, key)) continue; - context[key] = this.books[passage.value].context[key]; - } - accum.push(passage); - return [accum, context]; - }; - - bcv_passage.prototype.cv_psalm = function(passage, accum, context) { - var bc, c_psalm, ref, v; - passage.start_context = bcv_utils.shallow_clone(context); - passage.type = "bcv"; - ref = passage.value, c_psalm = ref[0], v = ref[1]; - bc = this.c_psalm(c_psalm, [], passage.start_context)[0][0]; - passage.value = [bc, v]; - return this.bcv(passage, accum, context); - }; - - bcv_passage.prototype.ff = function(passage, accum, context) { - var ref, ref1; - passage.start_context = bcv_utils.shallow_clone(context); - passage.value.push({ - type: "integer", - indices: passage.indices, - value: 999 - }); - ref = this.range(passage, [], passage.start_context), (ref1 = ref[0], passage = ref1[0]), context = ref[1]; - passage.value[0].indices = passage.value[1].indices; - passage.value[0].absolute_indices = passage.value[1].absolute_indices; - passage.value.pop(); - if (passage.passages[0].valid.messages.end_verse_not_exist != null) { - delete passage.passages[0].valid.messages.end_verse_not_exist; - } - if (passage.passages[0].valid.messages.end_chapter_not_exist != null) { - delete passage.passages[0].valid.messages.end_chapter_not_exist; - } - if (passage.passages[0].end.original_c != null) { - delete passage.passages[0].end.original_c; - } - accum.push(passage); - return [accum, context]; - }; - - bcv_passage.prototype.integer_title = function(passage, accum, context) { - passage.start_context = bcv_utils.shallow_clone(context); - if (context.b !== "Ps") { - return this.integer(passage.value[0], accum, context); - } - passage.value[0] = { - type: "c", - value: [passage.value[0]], - indices: [passage.value[0].indices[0], passage.value[0].indices[1]] - }; - passage.value[1].type = "v"; - passage.value[1].original_type = "title"; - passage.value[1].value = [ - { - type: "integer", - value: 1, - indices: passage.value[1].value.indices + if (passage.passages.length === 0) { + // If there are no valid options, use the first one. + passage.passages.push(alternates.shift()); } - ]; - passage.type = "cv"; - return this.cv(passage, accum, passage.start_context); - }; - - bcv_passage.prototype.integer = function(passage, accum, context) { - if (context.v != null) { - return this.v(passage, accum, context); + if (alternates.length > 0) { + passage.passages[0].alternates = alternates; + } + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + this.set_context_from_object(context, ["b", "c", "v"], passage.passages[0].start); + accum.push(passage); + return [accum, context]; } - return this.c(passage, accum, context); - }; - bcv_passage.prototype.next_v = function(passage, accum, context) { - var prev_integer, psg, ref, ref1, ref2, ref3; - passage.start_context = bcv_utils.shallow_clone(context); - prev_integer = this.pluck_last_recursively("integer", passage.value); - if (prev_integer == null) { - prev_integer = { - value: 1 - }; - } - passage.value.push({ - type: "integer", - indices: passage.indices, - value: prev_integer.value + 1 - }); - ref = this.range(passage, [], passage.start_context), (ref1 = ref[0], psg = ref1[0]), context = ref[1]; - if ((psg.passages[0].valid.messages.end_verse_not_exist != null) && (psg.passages[0].valid.messages.start_verse_not_exist == null) && (psg.passages[0].valid.messages.start_chapter_not_exist == null) && (context.c != null)) { - passage.value.pop(); - passage.value.push({ - type: "cv", + // Handle "Philemon verse 6." This is unusual. + bv(passage, accum, context) { + var b, bcv, v; + passage.start_context = bcv_utils.shallow_clone(context); + [b, v] = passage.value; + // Construct a virtual BCV object with a chapter of 1. + bcv = { indices: passage.indices, value: [ { - type: "c", - value: [ - { - type: "integer", - value: context.c + 1, - indices: passage.indices - } - ], - indices: passage.indices - }, { - type: "v", + type: "bc", value: [ + b, { - type: "integer", - value: 1, - indices: passage.indices + type: "c", + value: [ + { + type: "integer", + value: 1 + } + ] } - ], - indices: passage.indices - } + ] + }, + v ] - }); - ref2 = this.range(passage, [], passage.start_context), (ref3 = ref2[0], psg = ref3[0]), context = ref2[1]; - } - psg.value[0].indices = psg.value[1].indices; - psg.value[0].absolute_indices = psg.value[1].absolute_indices; - psg.value.pop(); - if (psg.passages[0].valid.messages.end_verse_not_exist != null) { - delete psg.passages[0].valid.messages.end_verse_not_exist; - } - if (psg.passages[0].valid.messages.end_chapter_not_exist != null) { - delete psg.passages[0].valid.messages.end_chapter_not_exist; - } - if (psg.passages[0].end.original_c != null) { - delete psg.passages[0].end.original_c; + }; + [[bcv], context] = this.bcv(bcv, [], context); + passage.passages = bcv.passages; + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + accum.push(passage); + return [accum, context]; } - accum.push(psg); - return [accum, context]; - }; - bcv_passage.prototype.sequence = function(passage, accum, context) { - var k, l, len, len1, obj, psg, ref, ref1, ref2, ref3, sub_psg; - passage.start_context = bcv_utils.shallow_clone(context); - passage.passages = []; - ref = passage.value; - for (k = 0, len = ref.length; k < len; k++) { - obj = ref[k]; - ref1 = this.handle_array(obj, [], context), (ref2 = ref1[0], psg = ref2[0]), context = ref1[1]; - ref3 = psg.passages; - for (l = 0, len1 = ref3.length; l < len1; l++) { - sub_psg = ref3[l]; - if (sub_psg.type == null) { - sub_psg.type = psg.type; - } - if (sub_psg.absolute_indices == null) { - sub_psg.absolute_indices = psg.absolute_indices; - } - if (psg.start_context.translations != null) { - sub_psg.translations = psg.start_context.translations; - } - sub_psg.enclosed_absolute_indices = psg.type === "sequence_post_enclosed" ? psg.absolute_indices : [-1, -1]; - passage.passages.push(sub_psg); - } - } - if (passage.absolute_indices == null) { - if (passage.passages.length > 0 && passage.type === "sequence") { - passage.absolute_indices = [passage.passages[0].absolute_indices[0], passage.passages[passage.passages.length - 1].absolute_indices[1]]; - } else { + // Handle a chapter. + c(passage, accum, context) { + var c, valid; + // This can happen in places like `chapt. 11-1040 of II Kings`, where the invalid range separates the `b` and the `c`. + passage.start_context = bcv_utils.shallow_clone(context); + // If it's an actual chapter object, the value we want is in the integer object inside it. + c = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; + valid = this.validate_ref(passage.start_context.translations, { + b: context.b, + c: c + }); + // If it's a single-chapter book, then treat it as a verse even if it looks like a chapter (unless its value is `1`). + if (!valid.valid && valid.messages.start_chapter_not_exist_in_single_chapter_book) { + return this.v(passage, accum, context); + } + [c] = this.fix_start_zeroes(valid, c); + passage.passages = [ + { + start: { + b: context.b, + c: c + }, + end: { + b: context.b, + c: c + }, + valid: valid + } + ]; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + accum.push(passage); + context.c = c; + this.reset_context(context, ["v"]); + if (passage.absolute_indices == null) { passage.absolute_indices = this.get_absolute_indices(passage.indices); } + return [accum, context]; } - accum.push(passage); - return [accum, context]; - }; - bcv_passage.prototype.sequence_post_enclosed = function(passage, accum, context) { - return this.sequence(passage, accum, context); - }; - - bcv_passage.prototype.v = function(passage, accum, context) { - var c, no_c, ref, v, valid; - v = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; - passage.start_context = bcv_utils.shallow_clone(context); - c = context.c != null ? context.c : 1; - valid = this.validate_ref(passage.start_context.translations, { - b: context.b, - c: c, - v: v - }); - ref = this.fix_start_zeroes(valid, 0, v), no_c = ref[0], v = ref[1]; - passage.passages = [ - { - start: { - b: context.b, - c: c, - v: v - }, - end: { - b: context.b, - c: c, - v: v + // Handle "23rd Psalm" by recasting it as a `bc`. + c_psalm(passage, accum, context) { + var c; + // We don't need to preserve the original `type` for reparsing. + passage.type = "bc"; + // This string always starts with the chapter number, followed by other letters. + c = parseInt(this.books[passage.value].value.match(/^\d+/)[0], 10); + passage.value = [ + { + type: "b", + value: passage.value, + indices: passage.indices }, - valid: valid - } - ]; - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; + { + type: "c", + value: [ + { + type: "integer", + value: c, + indices: passage.indices + } + ], + indices: passage.indices + } + ]; + return this.bc(passage, accum, context); } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + + // Handle "Ps 3, ch 4:title" + c_title(passage, accum, context) { + var title; + passage.start_context = bcv_utils.shallow_clone(context); + // If it's not a Psalm, treat it as a regular chapter. + if (context.b !== "Ps") { + // Don't change the `type` here because we're not updating the structure to match the `c` expectation if reparsing later. + return this.c(passage.value[0], accum, context); + } + // Add a `v` object and treat it as a regular `cv`. + title = this.pluck("title", passage.value); + passage.value[1] = { + type: "v", + value: [ + { + type: "integer", + value: 1, + indices: title.indices + } + ], + indices: title.indices + }; + // Change the type to match the new parsing strategy. + passage.type = "cv"; + return this.cv(passage, accum, passage.start_context); } - accum.push(passage); - context.v = v; - return [accum, context]; - }; - bcv_passage.prototype.range = function(passage, accum, context) { - var end, end_obj, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, return_now, return_value, start, start_obj, valid; - passage.start_context = bcv_utils.shallow_clone(context); - ref = passage.value, start = ref[0], end = ref[1]; - ref1 = this.handle_obj(start, [], context), (ref2 = ref1[0], start = ref2[0]), context = ref1[1]; - if (end.type === "v" && ((start.type === "bc" && !((ref3 = start.passages) != null ? (ref4 = ref3[0]) != null ? (ref5 = ref4.valid) != null ? (ref6 = ref5.messages) != null ? ref6.start_chapter_not_exist_in_single_chapter_book : void 0 : void 0 : void 0 : void 0)) || start.type === "c") && this.options.end_range_digits_strategy === "verse") { - passage.value[0] = start; - return this.range_change_integer_end(passage, accum); - } - ref7 = this.handle_obj(end, [], context), (ref8 = ref7[0], end = ref8[0]), context = ref7[1]; - passage.value = [start, end]; - passage.indices = [start.indices[0], end.indices[1]]; - delete passage.absolute_indices; - start_obj = { - b: start.passages[0].start.b, - c: start.passages[0].start.c, - v: start.passages[0].start.v, - type: start.type - }; - end_obj = { - b: end.passages[0].end.b, - c: end.passages[0].end.c, - v: end.passages[0].end.v, - type: end.type - }; - if (end.passages[0].valid.messages.start_chapter_is_zero) { - end_obj.c = 0; + // Handle a chapter:verse. + cv(passage, accum, context) { + var c, v, valid; + passage.start_context = bcv_utils.shallow_clone(context); + c = this.pluck("c", passage.value).value; + v = this.pluck("v", passage.value).value; + valid = this.validate_ref(passage.start_context.translations, { + b: context.b, + c: c, + v: v + }); + [c, v] = this.fix_start_zeroes(valid, c, v); + passage.passages = [ + { + start: { + b: context.b, + c: c, + v: v + }, + end: { + b: context.b, + c: c, + v: v + }, + valid: valid + } + ]; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + accum.push(passage); + context.c = c; + context.v = v; + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + return [accum, context]; } - if (end.passages[0].valid.messages.start_verse_is_zero) { - end_obj.v = 0; + + // Handle "Chapters 1-2 from Daniel". + cb_range(passage, accum, context) { + var b, end_c, start_c; + // We don't need to preserve the original `type` for reparsing. + passage.type = "range"; + [b, start_c, end_c] = passage.value; + passage.value = [ + { + type: "bc", + value: [b, + start_c], + indices: passage.indices + }, + end_c + ]; + end_c.indices[1] = passage.indices[1]; + return this.range(passage, accum, context); } - valid = this.validate_ref(passage.start_context.translations, start_obj, end_obj); - if (valid.valid) { - ref9 = this.range_handle_valid(valid, passage, start, start_obj, end, end_obj, accum), return_now = ref9[0], return_value = ref9[1]; - if (return_now) { - return return_value; + + // Use an object to establish context for later objects but don't otherwise use it. + context(passage, accum, context) { + var key, ref; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + ref = this.books[passage.value].context; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + context[key] = this.books[passage.value].context[key]; } - } else { - return this.range_handle_invalid(valid, passage, start, start_obj, end, end_obj, accum); + accum.push(passage); + return [accum, context]; } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + + // Handle "23rd Psalm verse 1" by recasting it as a `bcv`. + cv_psalm(passage, accum, context) { + var bc, c_psalm, v; + passage.start_context = bcv_utils.shallow_clone(context); + // We don't need to preserve the original `type` for reparsing. + passage.type = "bcv"; + [c_psalm, v] = passage.value; + [[bc]] = this.c_psalm(c_psalm, [], passage.start_context); + passage.value = [bc, v]; + return this.bcv(passage, accum, context); } - passage.passages = [ - { - start: start_obj, - end: end_obj, - valid: valid + + // Handle "and following" (e.g., "Matt 1:1ff") by assuming it means to continue to the end of the current context (end of chapter if a verse is given, end of book if a chapter is given). + ff(passage, accum, context) { + passage.start_context = bcv_utils.shallow_clone(context); + // Create a virtual end to pass to `@range`. + passage.value.push({ + type: "integer", + indices: passage.indices, + value: 999 + }); + [[passage], context] = this.range(passage, [], passage.start_context); + // Set the indices to include the end of the range (the "ff"). + passage.value[0].indices = passage.value[1].indices; + passage.value[0].absolute_indices = passage.value[1].absolute_indices; + // And then get rid of the virtual end so it doesn't stick around if we need to reparse it later. + passage.value.pop(); + if (passage.passages[0].valid.messages.end_verse_not_exist != null) { + // Ignore any warnings that the end chapter / verse doesn't exist. + delete passage.passages[0].valid.messages.end_verse_not_exist; } - ]; - if (passage.start_context.translations != null) { - passage.passages[0].translations = passage.start_context.translations; - } - if (start_obj.type === "b") { - if (end_obj.type === "b") { - passage.type = "b_range"; - } else { - passage.type = "b_range_start"; + if (passage.passages[0].valid.messages.end_chapter_not_exist != null) { + delete passage.passages[0].valid.messages.end_chapter_not_exist; + } + if (passage.passages[0].end.original_c != null) { + delete passage.passages[0].end.original_c; } - } else if (end_obj.type === "b") { - passage.type = "range_end_b"; + // `translations` and `absolute_indices` are handled in `@range`. + accum.push(passage); + return [accum, context]; } - accum.push(passage); - return [accum, context]; - }; - - bcv_passage.prototype.range_change_end = function(passage, accum, new_end) { - var end, new_obj, ref, start; - ref = passage.value, start = ref[0], end = ref[1]; - if (end.type === "integer") { - end.original_value = end.value; - end.value = new_end; - } else if (end.type === "v") { - new_obj = this.pluck("integer", end.value); - new_obj.original_value = new_obj.value; - new_obj.value = new_end; - } else if (end.type === "cv") { - new_obj = this.pluck("c", end.value); - new_obj.original_value = new_obj.value; - new_obj.value = new_end; - } - return this.handle_obj(passage, accum, passage.start_context); - }; - bcv_passage.prototype.range_change_integer_end = function(passage, accum) { - var end, ref, start; - ref = passage.value, start = ref[0], end = ref[1]; - if (passage.original_type == null) { - passage.original_type = passage.type; - } - if (passage.original_value == null) { - passage.original_value = [start, end]; - } - passage.type = start.type === "integer" ? "cv" : start.type + "v"; - if (start.type === "integer") { + // Handle "Ps 3-4:title" or "Acts 2:22-27. Title" + integer_title(passage, accum, context) { + passage.start_context = bcv_utils.shallow_clone(context); + // If it's not Psalms, treat it as a straight integer, ignoring the "title". + if (context.b !== "Ps") { + return this.integer(passage.value[0], accum, context); + } + // Change the `integer` to a `c` object for later passing to `@cv`. passage.value[0] = { type: "c", - value: [start], - indices: start.indices - }; - } - if (end.type === "integer") { - passage.value[1] = { - type: "v", - value: [end], - indices: end.indices + value: [passage.value[0]], + indices: [passage.value[0].indices[0], passage.value[0].indices[1]] }; + // Change the `title` object to a `v` object. + passage.value[1].type = "v"; + passage.value[1].original_type = "title"; + passage.value[1].value = [ + { + type: "integer", + value: 1, + indices: passage.value[1].value.indices + } + ]; + // We don't need to preserve the original `type` for reparsing. + passage.type = "cv"; + return this.cv(passage, accum, passage.start_context); } - return this.handle_obj(passage, accum, passage.start_context); - }; - bcv_passage.prototype.range_check_new_end = function(translations, start_obj, end_obj, valid) { - var new_end, new_valid, obj_to_validate, type; - new_end = 0; - type = null; - if (valid.messages.end_chapter_before_start) { - type = "c"; - } else if (valid.messages.end_verse_before_start) { - type = "v"; - } - if (type != null) { - new_end = this.range_get_new_end_value(start_obj, end_obj, valid, type); - } - if (new_end > 0) { - obj_to_validate = { - b: end_obj.b, - c: end_obj.c, - v: end_obj.v - }; - obj_to_validate[type] = new_end; - new_valid = this.validate_ref(translations, obj_to_validate); - if (!new_valid.valid) { - new_end = 0; + // Pass the integer off to whichever handler is relevant. + integer(passage, accum, context) { + if (context.v != null) { + return this.v(passage, accum, context); } + return this.c(passage, accum, context); } - return new_end; - }; - bcv_passage.prototype.range_end_b = function(passage, accum, context) { - return this.range(passage, accum, context); - }; + // Handle "next verse" (e.g., in Polish, "Matt 1:1n" should be treated as "Matt 1:1-2"). It crosses chapter boundaries but not book boundaries. When given a whole chapter, it assumes the next chapter (again, not crossing book boundaries). The logic here is similar to that of `@ff`. + next_v(passage, accum, context) { + var prev_integer, psg; + passage.start_context = bcv_utils.shallow_clone(context); + // Create a virtual end to pass to `@range`. Start out by just incrementing the last integer in the `passage`. + prev_integer = this.pluck_last_recursively("integer", passage.value); + // The grammar should always produce at least one object in `passage` with an integer, so this shouldn't be necessary. + if (prev_integer == null) { + prev_integer = { + value: 1 + }; + } + // Add a temporary object to serve as the next verse or chapter. We set it to an integer so that we don't have to worry about whether to create a `c` or a `v`. + passage.value.push({ + type: "integer", + indices: passage.indices, + value: prev_integer.value + 1 + }); + // We don't overwrite the `passage` object here the way we do in `@ff` because the next `if` statement needs access to the original `passage`. + [[psg], context] = this.range(passage, [], passage.start_context); + // If it's at the end of the chapter, try the first verse of the next chapter (unless at the end of a book). Only try if the start verse is valid. + if ((psg.passages[0].valid.messages.end_verse_not_exist != null) && (psg.passages[0].valid.messages.start_verse_not_exist == null) && (psg.passages[0].valid.messages.start_chapter_not_exist == null) && (context.c != null)) { + // Get rid of the previous attempt to find the next verse. + passage.value.pop(); + // Construct a `cv` object that points to the first verse of the next chapter. The `context.c` always indicates the current chapter. The indices don't matter because we discard this entire object once we're done with it. + passage.value.push({ + type: "cv", + indices: passage.indices, + value: [ + { + type: "c", + value: [ + { + type: "integer", + value: context.c + 1, + indices: passage.indices + } + ], + indices: passage.indices + }, + { + type: "v", + value: [ + { + type: "integer", + value: 1, + indices: passage.indices + } + ], + indices: passage.indices + } + ] + }); + // And then try again, forcing `@range` to use the first verse of the next chapter. + [[psg], context] = this.range(passage, [], passage.start_context); + } + // Set the indices to include the end of the range (the "n" in Polish). + psg.value[0].indices = psg.value[1].indices; + psg.value[0].absolute_indices = psg.value[1].absolute_indices; + // And then get rid of the virtual end so it doesn't stick around if we need to reparse it later. + psg.value.pop(); + if (psg.passages[0].valid.messages.end_verse_not_exist != null) { + // Ignore any warnings that the end chapter / verse doesn't exist. + delete psg.passages[0].valid.messages.end_verse_not_exist; + } + if (psg.passages[0].valid.messages.end_chapter_not_exist != null) { + delete psg.passages[0].valid.messages.end_chapter_not_exist; + } + if (psg.passages[0].end.original_c != null) { + delete psg.passages[0].end.original_c; + } + // `translations` and `absolute_indices` are handled in `@range`. + accum.push(psg); + return [accum, context]; + } - bcv_passage.prototype.range_get_new_end_value = function(start_obj, end_obj, valid, key) { - var new_end; - new_end = 0; - if ((key === "c" && valid.messages.end_chapter_is_zero) || (key === "v" && valid.messages.end_verse_is_zero)) { - return new_end; + // Handle a sequence of references. This is the only function that can return more than one object in the `passage.passages` array. + sequence(passage, accum, context) { + var k, l, len, len1, obj, psg, ref, ref1, sub_psg; + passage.start_context = bcv_utils.shallow_clone(context); + passage.passages = []; + ref = passage.value; + for (k = 0, len = ref.length; k < len; k++) { + obj = ref[k]; + [[psg], context] = this.handle_array(obj, [], context); + ref1 = psg.passages; + // There's only more than one `sub_psg` if there was a range error. + for (l = 0, len1 = ref1.length; l < len1; l++) { + sub_psg = ref1[l]; + if (sub_psg.type == null) { + sub_psg.type = psg.type; + } + // Add the indices so we can possibly retrieve them later, depending on our `sequence_combination_strategy`. + if (sub_psg.absolute_indices == null) { + sub_psg.absolute_indices = psg.absolute_indices; + } + if (psg.start_context.translations != null) { + sub_psg.translations = psg.start_context.translations; + } + // Save the index of any closing punctuation if the sequence ends with a `sequence_post_enclosed`. + sub_psg.enclosed_absolute_indices = psg.type === "sequence_post_enclosed" ? psg.absolute_indices : [-1, -1]; + passage.passages.push(sub_psg); + } + } + if (passage.absolute_indices == null) { + // If it's `sequence_post_enclosed`, don't snap the end index; include the closing punctuation. + if (passage.passages.length > 0 && passage.type === "sequence") { + passage.absolute_indices = [passage.passages[0].absolute_indices[0], passage.passages[passage.passages.length - 1].absolute_indices[1]]; + } else { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + } + accum.push(passage); + return [accum, context]; } - if (start_obj[key] >= 10 && end_obj[key] < 10 && start_obj[key] - 10 * Math.floor(start_obj[key] / 10) < end_obj[key]) { - new_end = end_obj[key] + 10 * Math.floor(start_obj[key] / 10); - } else if (start_obj[key] >= 100 && end_obj[key] < 100 && start_obj[key] - 100 < end_obj[key]) { - new_end = end_obj[key] + 100; + + // Handle a sequence like "Ps 119 (118)," with parentheses. We want to include the closing parenthesis in the indices if `sequence_combination_strategy` is `combine` or if there's a consecutive. + sequence_post_enclosed(passage, accum, context) { + return this.sequence(passage, accum, context); } - return new_end; - }; - bcv_passage.prototype.range_handle_invalid = function(valid, passage, start, start_obj, end, end_obj, accum) { - var new_end, ref, temp_valid, temp_value; - if (valid.valid === false && (valid.messages.end_chapter_before_start || valid.messages.end_verse_before_start) && (end.type === "integer" || end.type === "v") || (valid.valid === false && valid.messages.end_chapter_before_start && end.type === "cv")) { - new_end = this.range_check_new_end(passage.start_context.translations, start_obj, end_obj, valid); - if (new_end > 0) { - return this.range_change_end(passage, accum, new_end); + // Handle a verse, either as part of a sequence or because someone explicitly wrote "verse". + v(passage, accum, context) { + var c, no_c, v, valid; + v = passage.type === "integer" ? passage.value : this.pluck("integer", passage.value).value; + passage.start_context = bcv_utils.shallow_clone(context); + // The chapter context might not be set if it follows a book in a sequence. + c = context.c != null ? context.c : 1; + valid = this.validate_ref(passage.start_context.translations, { + b: context.b, + c: c, + v: v + }); + [no_c, v] = this.fix_start_zeroes(valid, 0, v); + passage.passages = [ + { + start: { + b: context.b, + c: c, + v: v + }, + end: { + b: context.b, + c: c, + v: v + }, + valid: valid + } + ]; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); } + accum.push(passage); + context.v = v; + return [accum, context]; } - if (this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v")) { - temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; - temp_valid = this.validate_ref(passage.start_context.translations, { - b: start_obj.b, - c: start_obj.c, - v: temp_value - }); - if (temp_valid.valid) { + + // ## Ranges + // Handle any type of start and end range. It doesn't directly return multiple passages, but if there's an error parsing the range, we may convert it into a sequence. + range(passage, accum, context) { + var end, end_obj, ref, ref1, ref2, ref3, return_now, return_value, start, start_obj, valid; + passage.start_context = bcv_utils.shallow_clone(context); + [start, end] = passage.value; + // `@handle_obj` always returns exactly one object that we're interested in. + [[start], context] = this.handle_obj(start, [], context); + // Matt 5-verse 6 = Matt.5.6 + if (end.type === "v" && ((start.type === "bc" && !((ref = start.passages) != null ? (ref1 = ref[0]) != null ? (ref2 = ref1.valid) != null ? (ref3 = ref2.messages) != null ? ref3.start_chapter_not_exist_in_single_chapter_book : void 0 : void 0 : void 0 : void 0)) || start.type === "c") && this.options.end_range_digits_strategy === "verse") { + // If we had to change the `type`, reflect that here. + passage.value[0] = start; return this.range_change_integer_end(passage, accum); } + [[end], context] = this.handle_obj(end, [], context); + // If we had to change the start or end `type`s, make sure that's reflected in the `value`. + passage.value = [start, end]; + // Similarly, if we had to adjust the indices, make sure they're reflected in the indices for the range. + passage.indices = [start.indices[0], end.indices[1]]; + // We'll also need to recalculate these if they exist. + delete passage.absolute_indices; + // Create the prospective start and end objects that will end up in `passage.passages`. + start_obj = { + b: start.passages[0].start.b, + c: start.passages[0].start.c, + v: start.passages[0].start.v, + type: start.type + }; + end_obj = { + b: end.passages[0].end.b, + c: end.passages[0].end.c, + v: end.passages[0].end.v, + type: end.type + }; + if (end.passages[0].valid.messages.start_chapter_is_zero) { + // Make sure references like `Ps 20:1-0:4` don't change to `Ps 20:1-1:4`. In other words, don't upgrade zero end ranges. + end_obj.c = 0; + } + if (end.passages[0].valid.messages.start_verse_is_zero) { + end_obj.v = 0; + } + valid = this.validate_ref(passage.start_context.translations, start_obj, end_obj); + // If it's valid, sometimes we want to return the value from `@range_handle_valid_end`, and sometimes not; it depends on what kinds of corrections we need to make. + if (valid.valid) { + [return_now, return_value] = this.range_handle_valid(valid, passage, start, start_obj, end, end_obj, accum); + if (return_now) { + return return_value; + } + } else { + // If it's invalid, always return the value. + return this.range_handle_invalid(valid, passage, start, start_obj, end, end_obj, accum); + } + // We've already reset the indices to match the indices of the contained objects. + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + passage.passages = [ + { + start: start_obj, + end: end_obj, + valid: valid + } + ]; + if (passage.start_context.translations != null) { + passage.passages[0].translations = passage.start_context.translations; + } + // We may need to filter out books on their own depending on the `book_alone_strategy` or the `book_range_strategy`. + if (start_obj.type === "b") { + if (end_obj.type === "b") { + passage.type = "b_range"; + } else { + passage.type = "b_range_start"; + } + } else if (end_obj.type === "b") { + passage.type = "range_end_b"; + } + accum.push(passage); + return [accum, context]; } - if (passage.original_type == null) { - passage.original_type = passage.type; - } - passage.type = "sequence"; - ref = [[start, end], [[start], [end]]], passage.original_value = ref[0], passage.value = ref[1]; - return this.sequence(passage, accum, passage.start_context); - }; - bcv_passage.prototype.range_handle_valid = function(valid, passage, start, start_obj, end, end_obj, accum) { - var temp_valid, temp_value; - if (valid.messages.end_chapter_not_exist && this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v") && this.options.passage_existence_strategy.indexOf("v") >= 0) { - temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; - temp_valid = this.validate_ref(passage.start_context.translations, { - b: start_obj.b, - c: start_obj.c, - v: temp_value - }); - if (temp_valid.valid) { - return [true, this.range_change_integer_end(passage, accum)]; + // For Ps 122-23, treat the 23 as 123. + range_change_end(passage, accum, new_end) { + var end, new_obj, start; + [start, end] = passage.value; + if (end.type === "integer") { + end.original_value = end.value; + end.value = new_end; + } else if (end.type === "v") { + new_obj = this.pluck("integer", end.value); + new_obj.original_value = new_obj.value; + new_obj.value = new_end; + } else if (end.type === "cv") { + // Get the chapter object and assign it (in place) the new value. + new_obj = this.pluck("c", end.value); + new_obj.original_value = new_obj.value; + new_obj.value = new_end; + } + return this.handle_obj(passage, accum, passage.start_context); + } + + // For "Jer 33-11", treat the "11" as a verse. + range_change_integer_end(passage, accum) { + var end, start; + [start, end] = passage.value; + // We want to retain the originals beacuse a future reparsing may lead to a different outcome. + if (passage.original_type == null) { + passage.original_type = passage.type; + } + if (passage.original_value == null) { + passage.original_value = [start, end]; + } + // The start.type is only bc, c, or integer; we're just adding a v for the first two. + passage.type = start.type === "integer" ? "cv" : start.type + "v"; + if (start.type === "integer") { + // Create the object in the expected format if it's not already a verse. + passage.value[0] = { + type: "c", + value: [start], + indices: start.indices + }; + } + if (end.type === "integer") { + passage.value[1] = { + type: "v", + value: [end], + indices: end.indices + }; } + return this.handle_obj(passage, accum, passage.start_context); } - this.range_validate(valid, start_obj, end_obj, passage); - return [false, null]; - }; - bcv_passage.prototype.range_validate = function(valid, start_obj, end_obj, passage) { - var ref; - if (valid.messages.end_chapter_not_exist || valid.messages.end_chapter_not_exist_in_single_chapter_book) { - end_obj.original_c = end_obj.c; - end_obj.c = valid.messages.end_chapter_not_exist ? valid.messages.end_chapter_not_exist : valid.messages.end_chapter_not_exist_in_single_chapter_book; - if (end_obj.v != null) { - end_obj.v = this.validate_ref(passage.start_context.translations, { + // If a new end chapter/verse in a range may be necessary, calculate it. + range_check_new_end(translations, start_obj, end_obj, valid) { + var new_end, new_valid, obj_to_validate, type; + new_end = 0; + type = null; + // See whether a digit might be omitted (e.g., Gen 22-4 = Gen 22-24). + if (valid.messages.end_chapter_before_start) { + type = "c"; + } else if (valid.messages.end_verse_before_start) { + type = "v"; + } + if (type != null) { + new_end = this.range_get_new_end_value(start_obj, end_obj, valid, type); + } + if (new_end > 0) { + obj_to_validate = { b: end_obj.b, c: end_obj.c, - v: 999 - }).messages.end_verse_not_exist; - delete valid.messages.end_verse_is_zero; + v: end_obj.v + }; + obj_to_validate[type] = new_end; + new_valid = this.validate_ref(translations, obj_to_validate); + if (!new_valid.valid) { + new_end = 0; + } } - } else if (valid.messages.end_verse_not_exist) { - end_obj.original_v = end_obj.v; - end_obj.v = valid.messages.end_verse_not_exist; - } - if (valid.messages.end_verse_is_zero && this.options.zero_verse_strategy !== "allow") { - end_obj.v = valid.messages.end_verse_is_zero; + return new_end; } - if (valid.messages.end_chapter_is_zero) { - end_obj.c = valid.messages.end_chapter_is_zero; + + // Handle ranges with a book as the end of the range ("Gen 2-Exod"). It's not `b_range_end` because only objects that start with an explicit book name should start with `b`. + range_end_b(passage, accum, context) { + return this.range(passage, accum, context); } - ref = this.fix_start_zeroes(valid, start_obj.c, start_obj.v), start_obj.c = ref[0], start_obj.v = ref[1]; - return true; - }; - bcv_passage.prototype.translation_sequence = function(passage, accum, context) { - var k, l, len, len1, ref, translation, translations, val; - passage.start_context = bcv_utils.shallow_clone(context); - translations = []; - translations.push({ - translation: this.books[passage.value[0].value].parsed - }); - ref = passage.value[1]; - for (k = 0, len = ref.length; k < len; k++) { - val = ref[k]; - val = this.books[this.pluck("translation", val).value].parsed; - if (val != null) { - translations.push({ - translation: val - }); + // If a sequence has an end chapter/verse that's before the the start, check to see whether it can be salvaged: Gen 28-9 = Gen 28-29; Ps 101-24 = Ps 101-124. The `key` parameter is either `c` (for chapter) or `v` (for verse). + range_get_new_end_value(start_obj, end_obj, valid, key) { + var new_end; + // Return 0 unless it's salvageable. + new_end = 0; + if ((key === "c" && valid.messages.end_chapter_is_zero) || (key === "v" && valid.messages.end_verse_is_zero)) { + return new_end; } - } - for (l = 0, len1 = translations.length; l < len1; l++) { - translation = translations[l]; - if (this.translations.aliases[translation.translation] != null) { - translation.alias = this.translations.aliases[translation.translation].alias; - translation.osis = this.translations.aliases[translation.translation].osis || translation.translation.toUpperCase(); - } else { - translation.alias = "default"; - translation.osis = translation.translation.toUpperCase(); + // 54-5, not 54-43, 54-3, or 54-4. + if (start_obj[key] >= 10 && end_obj[key] < 10 && start_obj[key] - 10 * Math.floor(start_obj[key] / 10) < end_obj[key]) { + // Add the start tens digit to the original end value: 54-5 = 54 through 50 + 5. + new_end = end_obj[key] + 10 * Math.floor(start_obj[key] / 10); + // 123-40, not 123-22 or 123-23; 123-4 is taken care of in the first case. + } else if (start_obj[key] >= 100 && end_obj[key] < 100 && start_obj[key] - 100 < end_obj[key]) { + // Add 100 to the original end value: 100-12 = 100 through 100 + 12. + new_end = end_obj[key] + 100; } + return new_end; } - if (accum.length > 0) { - context = this.translation_sequence_apply(accum, translations); - } - if (passage.absolute_indices == null) { - passage.absolute_indices = this.get_absolute_indices(passage.indices); + + // The range doesn't look valid, but maybe we can fix it. If not, convert it to a sequence. + range_handle_invalid(valid, passage, start, start_obj, end, end_obj, accum) { + var new_end, temp_valid, temp_value; + // Is it not valid because the end is before the start and the `end` is an `integer` (Matt 15-6) or a `cv` (Matt 15-6:2) (since anything else resets our expectations)? + + // Only go with a `cv` if it's the chapter that's too low (to avoid doing weird things with 31:30-31:1). + if (valid.valid === false && (valid.messages.end_chapter_before_start || valid.messages.end_verse_before_start) && (end.type === "integer" || end.type === "v") || (valid.valid === false && valid.messages.end_chapter_before_start && end.type === "cv")) { + new_end = this.range_check_new_end(passage.start_context.translations, start_obj, end_obj, valid); + if (new_end > 0) { + // If that's the case, then reparse the current passage object after correcting the end value, which is an integer. + return this.range_change_end(passage, accum, new_end); + } + } + // If someone enters "Jer 33-11", they probably mean "Jer.33.11"; as in `@range_handle_valid`, this may be too clever for its own good. + if (this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v")) { + // I don't know that `end.type` can ever be `v` here. Such a `c-v` pattern is parsed as `cv`. + temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; + temp_valid = this.validate_ref(passage.start_context.translations, { + b: start_obj.b, + c: start_obj.c, + v: temp_value + }); + if (temp_valid.valid) { + return this.range_change_integer_end(passage, accum); + } + } + // Otherwise, if we couldn't fix the range, then treat the range as a sequence. We want to retain the original `type` and `value` in case we need to reparse it differently later. + if (passage.original_type == null) { + passage.original_type = passage.type; + } + passage.type = "sequence"; + // Construct the sequence value in the format expected. + [passage.original_value, passage.value] = [[start, end], [[start], [end]]]; + // Don't use the `context` object because we changed it in `@range`. + return this.sequence(passage, accum, passage.start_context); + } + + // The range looks valid, but we should check for some special cases. + range_handle_valid(valid, passage, start, start_obj, end, end_obj, accum) { + var temp_valid, temp_value; + // If Heb 13-15, treat it as Heb 13:15. This may be too clever for its own good. We check the `passage_existence_strategy` because otherwise `Gen 49-76` becomes `Gen.49.76`. + if (valid.messages.end_chapter_not_exist && this.options.end_range_digits_strategy === "verse" && (start_obj.v == null) && (end.type === "integer" || end.type === "v") && this.options.passage_existence_strategy.indexOf("v") >= 0) { + temp_value = end.type === "v" ? this.pluck("integer", end.value) : end.value; + temp_valid = this.validate_ref(passage.start_context.translations, { + b: start_obj.b, + c: start_obj.c, + v: temp_value + }); + if (temp_valid.valid) { + return [true, this.range_change_integer_end(passage, accum)]; + } + } + // Otherwise, snap start/end chapters/verses if they're too high or low. + this.range_validate(valid, start_obj, end_obj, passage); + return [false, null]; + } + + // If the end object goes past the end of the book or chapter, snap it back to a verse that exists. + range_validate(valid, start_obj, end_obj, passage) { + // If it's valid but the end range goes too high, snap it back to the appropriate chapter or verse. + if (valid.messages.end_chapter_not_exist || valid.messages.end_chapter_not_exist_in_single_chapter_book) { + // `end_chapter_not_exist` gives the highest chapter for the book. + end_obj.original_c = end_obj.c; + end_obj.c = valid.messages.end_chapter_not_exist ? valid.messages.end_chapter_not_exist : valid.messages.end_chapter_not_exist_in_single_chapter_book; + // If we've snapped it back to the last chapter and there's a verse, also snap to the end of that chapter. If we've already overshot the chapter, there's no reason to think we've gotten the verse right; Gen 50:1-51:1 = Gen 50:1-26 = Gen 50. If there's no verse, we don't need to worry about it. + if (end_obj.v != null) { + // `end_verse_not_exist` gives the maximum verse for the chapter. + end_obj.v = this.validate_ref(passage.start_context.translations, { + b: end_obj.b, + c: end_obj.c, + v: 999 + }).messages.end_verse_not_exist; + // If the range ended at Exodus 41:0, make sure we're not going to change it to Exodus 40:1. + delete valid.messages.end_verse_is_zero; + } + // If the end verse is too high, snap back to the maximum verse. + } else if (valid.messages.end_verse_not_exist) { + end_obj.original_v = end_obj.v; + end_obj.v = valid.messages.end_verse_not_exist; + } + if (valid.messages.end_verse_is_zero && this.options.zero_verse_strategy !== "allow") { + end_obj.v = valid.messages.end_verse_is_zero; + } + if (valid.messages.end_chapter_is_zero) { + end_obj.c = valid.messages.end_chapter_is_zero; + } + [start_obj.c, start_obj.v] = this.fix_start_zeroes(valid, start_obj.c, start_obj.v); + return true; } - accum.push(passage); - this.reset_context(context, ["translations"]); - return [accum, context]; - }; - bcv_passage.prototype.translation_sequence_apply = function(accum, translations) { - var context, i, k, new_accum, ref, ref1, use_i; - use_i = 0; - for (i = k = ref = accum.length - 1; ref <= 0 ? k <= 0 : k >= 0; i = ref <= 0 ? ++k : --k) { - if (accum[i].original_type != null) { - accum[i].type = accum[i].original_type; + // ## Translations + // Even a single translation ("NIV") appears as part of a translation sequence. Here we handle the sequence and apply the translations to any previous passages lacking an explicit translation: in "Matt 1, 5 ESV," both `Matt 1` and `5` get applied, but in "Matt 1 NIV, 5 ESV," NIV only applies to Matt 1, and ESV only applies to Matt 5. + translation_sequence(passage, accum, context) { + var k, l, len, len1, ref, translation, translations, val; + passage.start_context = bcv_utils.shallow_clone(context); + translations = []; + // First get all the translations in the sequence; the first one is separate from the others (which may not exist). + translations.push({ + translation: this.books[passage.value[0].value].parsed + }); + ref = passage.value[1]; + for (k = 0, len = ref.length; k < len; k++) { + val = ref[k]; + // `val` at this point is an array. + val = this.books[this.pluck("translation", val).value].parsed; + if (val != null) { + // And now `val` is the literal, lower-cased match. + translations.push({ + translation: val + }); + } } - if (accum[i].original_value != null) { - accum[i].value = accum[i].original_value; +// We need some metadata to do this right. + for (l = 0, len1 = translations.length; l < len1; l++) { + translation = translations[l]; + // Do we know anything about this translation? If so, use that. If not, use the default. + if (this.translations.aliases[translation.translation] != null) { + // `alias` is what we use internally to get bcv data for the translation. + translation.alias = this.translations.aliases[translation.translation].alias; + // `osis` is what we'll eventually use in output. + translation.osis = this.translations.aliases[translation.translation].osis || translation.translation.toUpperCase(); + } else { + translation.alias = "default"; + // If we don't know what the correct abbreviation should be, then just upper-case what we have. + translation.osis = translation.translation.toUpperCase(); + } } - if (accum[i].type !== "translation_sequence") { - continue; + if (accum.length > 0) { + // Apply the new translations to the existing objects. + context = this.translation_sequence_apply(accum, translations); } - use_i = i + 1; - break; - } - if (use_i < accum.length) { - accum[use_i].start_context.translations = translations; - ref1 = this.handle_array(accum.slice(use_i), [], accum[use_i].start_context), new_accum = ref1[0], context = ref1[1]; - } else { - context = bcv_utils.shallow_clone(accum[accum.length - 1].start_context); + // We may need these indices later, depending on how we want to output the data. + if (passage.absolute_indices == null) { + passage.absolute_indices = this.get_absolute_indices(passage.indices); + } + // Include the `translation_sequence` object in `accum` so that we can handle any later `translation_sequence` objects without overlapping this one. + accum.push(passage); + // Don't carry over the translations into any later references; translations only apply backwards. + this.reset_context(context, ["translations"]); + return [accum, context]; } - return context; - }; - bcv_passage.prototype.pluck = function(type, passages) { - var k, len, passage; - for (k = 0, len = passages.length; k < len; k++) { - passage = passages[k]; - if (!((passage != null) && (passage.type != null) && passage.type === type)) { - continue; + // Go back and find the earliest already-parsed passage without a translation. We start with 0 because the below loop will never yield a 0. + translation_sequence_apply(accum, translations) { + var context, i, k, new_accum, ref, use_i; + use_i = 0; +// Start with the most recent and go backward--we don't want to overlap another `translation_sequence`. + for (i = k = ref = accum.length - 1; (ref <= 0 ? k <= 0 : k >= 0); i = ref <= 0 ? ++k : --k) { + if (accum[i].original_type != null) { + // With a new translation comes the possibility that a previously invalid reference will become valid, so reset it to its original type. For example, a multi-book range may be correct in a different translation because the books are in a different order. + accum[i].type = accum[i].original_type; + } + if (accum[i].original_value != null) { + accum[i].value = accum[i].original_value; + } + if (accum[i].type !== "translation_sequence") { + continue; + } + // If we made it here, then we hit a translation sequence, and we know that the item following it is the first one we care about. + use_i = i + 1; + break; } - if (type === "c" || type === "v") { - return this.pluck("integer", passage.value); + // Include the translations in the start context. + + // `use_i` == `accum.length` if there are two translations sequences in a row separated by, e.g., numbers ("Matt 1 ESV 2-3 NIV"). This is unusual. + if (use_i < accum.length) { + accum[use_i].start_context.translations = translations; + // The objects in accum are replaced in-place, so we don't need to try to merge them back. We re-parse them because the translation may cause previously valid (or invalid) references to flip the other way--if the new translation includes (or doesn't) the Deuterocanonicals, for example. We ignore the `new_accum`, but we definitely care about the new `context`. + [new_accum, context] = this.handle_array(accum.slice(use_i), [], accum[use_i].start_context); + } else { + // Use the start context from the last translation_sequence if that's all that's available. + context = bcv_utils.shallow_clone(accum[accum.length - 1].start_context); } - return passage; + // We modify `accum` in-place but return the new `context` to the calling function. + return context; } - return null; - }; - bcv_passage.prototype.pluck_last_recursively = function(type, passages) { - var k, passage, value; - for (k = passages.length - 1; k >= 0; k += -1) { - passage = passages[k]; - if (!((passage != null) && (passage.type != null))) { - continue; - } - if (passage.type === type) { - return this.pluck(type, [passage]); - } - value = this.pluck_last_recursively(type, passage.value); - if (value != null) { - return value; + // ## Utilities + // Pluck the object or value matching a type from an array. + pluck(type, passages) { + var k, len, passage; + for (k = 0, len = passages.length; k < len; k++) { + passage = passages[k]; + if (!((passage != null) && (passage.type != null) && passage.type === type)) { + // `passage` can be null if a range needed to be adjusted into a sequence. + continue; + } + if (type === "c" || type === "v") { + return this.pluck("integer", passage.value); + } + return passage; } + return null; } - return null; - }; - bcv_passage.prototype.set_context_from_object = function(context, keys, obj) { - var k, len, results, type; - results = []; - for (k = 0, len = keys.length; k < len; k++) { - type = keys[k]; - if (obj[type] == null) { - continue; + // Pluck the last object or value matching a type, descending as needed into objects. + pluck_last_recursively(type, passages) { + var k, passage, value; +// The `-1` means: walk backwards through the array. + for (k = passages.length - 1; k >= 0; k += -1) { + passage = passages[k]; + if (!((passage != null) && (passage.type != null))) { + // Skip null values. + continue; + } + if (passage.type === type) { + // Rely on `@pluck` if we've found a match. It expects an array. + return this.pluck(type, [passage]); + } + // If `passage.type` exists, we know that `passage.value` exists. + value = this.pluck_last_recursively(type, passage.value); + if (value != null) { + return value; + } } - results.push(context[type] = obj[type]); + return null; } - return results; - }; - bcv_passage.prototype.reset_context = function(context, keys) { - var k, len, results, type; - results = []; - for (k = 0, len = keys.length; k < len; k++) { - type = keys[k]; - results.push(delete context[type]); + // Set all the available context keys. + set_context_from_object(context, keys, obj) { + var k, len, results, type; + results = []; + for (k = 0, len = keys.length; k < len; k++) { + type = keys[k]; + if (obj[type] == null) { + continue; + } + results.push(context[type] = obj[type]); + } + return results; } - return results; - }; - bcv_passage.prototype.fix_start_zeroes = function(valid, c, v) { - if (valid.messages.start_chapter_is_zero && this.options.zero_chapter_strategy === "upgrade") { - c = valid.messages.start_chapter_is_zero; + // Delete all the existing context keys if, for example, starting with a new book. + reset_context(context, keys) { + var k, len, results, type; + results = []; + for (k = 0, len = keys.length; k < len; k++) { + type = keys[k]; + results.push(delete context[type]); + } + return results; } - if (valid.messages.start_verse_is_zero && this.options.zero_verse_strategy === "upgrade") { - v = valid.messages.start_verse_is_zero; + + // If the start chapter or verse is 0 and the appropriate option is set to `upgrade`, convert it to a 1. + fix_start_zeroes(valid, c, v) { + if (valid.messages.start_chapter_is_zero && this.options.zero_chapter_strategy === "upgrade") { + c = valid.messages.start_chapter_is_zero; + } + if (valid.messages.start_verse_is_zero && this.options.zero_verse_strategy === "upgrade") { + v = valid.messages.start_verse_is_zero; + } + return [c, v]; } - return [c, v]; - }; - bcv_passage.prototype.calculate_indices = function(match, adjust) { - var character, end_index, indices, k, l, len, len1, len2, m, match_index, part, part_length, parts, ref, switch_type, temp; - switch_type = "book"; - indices = []; - match_index = 0; - adjust = parseInt(adjust, 10); - parts = [match]; - ref = ["\x1e", "\x1f"]; - for (k = 0, len = ref.length; k < len; k++) { - character = ref[k]; - temp = []; - for (l = 0, len1 = parts.length; l < len1; l++) { - part = parts[l]; - temp = temp.concat(part.split(character)); - } - parts = temp; - } - for (m = 0, len2 = parts.length; m < len2; m++) { - part = parts[m]; - switch_type = switch_type === "book" ? "rest" : "book"; - part_length = part.length; - if (part_length === 0) { - continue; - } - if (switch_type === "book") { - part = part.replace(/\/\d+$/, ""); - end_index = match_index + part_length; - if (indices.length > 0 && indices[indices.length - 1].index === adjust) { - indices[indices.length - 1].end = end_index; - } else { - indices.push({ - start: match_index, - end: end_index, - index: adjust - }); + // Given a string and initial index, calculate indices for parts of the string. For example, a string that starts at index 10 might have a book that pushes it to index 12 starting at its third character. + calculate_indices(match, adjust) { + var character, end_index, indices, k, l, len, len1, len2, m, match_index, part, part_length, parts, ref, switch_type, temp; + // This gets switched out the first time in the loop; the first item is never a book even if a book is the first part of the string--there's an empty string before it. + switch_type = "book"; + indices = []; + match_index = 0; + adjust = parseInt(adjust, 10); + // It would be easier to do `for part in match.split /[\x1e\x1f]/`, but IE doesn't return empty matches when using `split`, throwing off the rest of the logic. + parts = [match]; + ref = ["\x1e", "\x1f"]; + for (k = 0, len = ref.length; k < len; k++) { + character = ref[k]; + temp = []; + for (l = 0, len1 = parts.length; l < len1; l++) { + part = parts[l]; + temp = temp.concat(part.split(character)); } - match_index += part_length + 2; - adjust = this.books[part].start_index + this.books[part].value.length - match_index; - indices.push({ - start: end_index + 1, - end: end_index + 1, - index: adjust - }); - } else { - end_index = match_index + part_length - 1; - if (indices.length > 0 && indices[indices.length - 1].index === adjust) { - indices[indices.length - 1].end = end_index; - } else { + parts = temp; + } + for (m = 0, len2 = parts.length; m < len2; m++) { + part = parts[m]; + // Start off assuming it's not a book. + switch_type = switch_type === "book" ? "rest" : "book"; + // Empty strings don't move the index. This could happen with consecutive books. + part_length = part.length; + if (part_length === 0) { + continue; + } + // If it's a book, then get the start index of the actual book, add the length of the actual string, then subtract the length of the integer id and the two surrounding characters. + if (switch_type === "book") { + // Remove any stray extra indicators. + part = part.replace(/\/\d+$/, ""); + // Get the length of the id + the surrounding characters. We want the `end` to be the position, not the length. If the part starts at position 0 and is one character (i.e., three characters total, or `\x1f0\x1f`), `end` should be 1, since it occupies positions 0, 1, and 2, and we want the last character to be part of the next index so that we keep track of the end. For example, with "Genesis" at start index 0, the index starting at position 6 ("s") should be 4. Keep the adjust as-is, but set it next. + end_index = match_index + part_length; + if (indices.length > 0 && indices[indices.length - 1].index === adjust) { + indices[indices.length - 1].end = end_index; + } else { + indices.push({ + start: match_index, + end: end_index, + index: adjust + }); + } + // If the part is one character (three characters total) starting at `match_index` 0, we want the next `match_index` to be 3; it occupies positions 0, 1, and 2. Similarly, if it's two characters, it should be four characters total. + match_index += part_length + 2; + // Use the known `start_index` from the book, subtracting the current index in the match, to get the new. So if the previous `match_index` == 5 and the book's id is 0, the book's `start_index` == 10, and the book's length == 7, we want the next adjust to be 10 + 7 - 8 = 9 (the 8 is the `match_index` where the new `adjust` starts): 4(+5) = 9, 5(+5) = 10, 6(+5) = 11, 7(+5) = 12, 8(+9) = 17. + adjust = this.books[part].start_index + this.books[part].value.length - match_index; indices.push({ - start: match_index, - end: end_index, + start: end_index + 1, + end: end_index + 1, index: adjust }); + } else { + // The `- 1` is because we want the `end` to be the position of the last character. If the part starts at position 0 and is three characters long, the `end` should be two, since it occupies positions 0, 1, and 2. + end_index = match_index + part_length - 1; + if (indices.length > 0 && indices[indices.length - 1].index === adjust) { + indices[indices.length - 1].end = end_index; + } else { + indices.push({ + start: match_index, + end: end_index, + index: adjust + }); + } + match_index += part_length; } - match_index += part_length; } + return indices; } - return indices; - }; - bcv_passage.prototype.get_absolute_indices = function(arg1) { - var end, end_out, index, k, len, ref, start, start_out; - start = arg1[0], end = arg1[1]; - start_out = null; - end_out = null; - ref = this.indices; - for (k = 0, len = ref.length; k < len; k++) { - index = ref[k]; - if (start_out === null && (index.start <= start && start <= index.end)) { - start_out = start + index.index; - } - if ((index.start <= end && end <= index.end)) { - end_out = end + index.index + 1; - break; + // Find the absolute string indices of start and end points. + get_absolute_indices([start, end]) { + var end_out, index, k, len, ref, start_out; + start_out = null; + end_out = null; + ref = this.indices; + // `@indices` contains the absolute indices for each range of indices in the string. + for (k = 0, len = ref.length; k < len; k++) { + index = ref[k]; + // If we haven't found the absolute start index yet, set it. + if (start_out === null && (index.start <= start && start <= index.end)) { + start_out = start + index.index; + } + // This may be in the same loop iteration as `start`. The `+ 1` matches Twitter's implementation of indices, where start is the character index and end is the character after the index. So `Gen` is `[0, 3]`. + if ((index.start <= end && end <= index.end)) { + end_out = end + index.index + 1; + break; + } } + return [start_out, end_out]; } - return [start_out, end_out]; - }; - bcv_passage.prototype.validate_ref = function(translations, start, end) { - var k, len, messages, temp_valid, translation, valid; - if (!((translations != null) && translations.length > 0)) { - translations = [ - { - translation: "default", - osis: "", - alias: "default" - } - ]; - } - valid = false; - messages = {}; - for (k = 0, len = translations.length; k < len; k++) { - translation = translations[k]; - if (translation.alias == null) { - translation.alias = "default"; + // ## Validators + // Given a start and optional end bcv object, validate that the verse exists and is valid. It returns a `true` value for `valid` if any of the translations is valid. + validate_ref(translations, start, end) { + var k, len, messages, temp_valid, translation, valid; + if (!((translations != null) && translations.length > 0)) { + // The `translation` key is optional; if it doesn't exist, assume the default translation. + translations = [ + { + translation: "default", + osis: "", + alias: "default" + } + ]; } - if (translation.alias == null) { - if (messages.translation_invalid == null) { - messages.translation_invalid = []; + valid = false; + messages = {}; +// `translation` is a translation object, but all we care about is the string. + for (k = 0, len = translations.length; k < len; k++) { + translation = translations[k]; + if (translation.alias == null) { + translation.alias = "default"; + } + // Only true if `translation` isn't the right type. + if (translation.alias == null) { + if (messages.translation_invalid == null) { + messages.translation_invalid = []; + } + messages.translation_invalid.push(translation); + continue; + } + // Not a fatal error because we assume that translations match the default unless we know differently. But we still record it because we may want to know about it later. Translations in `alternates` get generated on-demand. + if (this.translations.aliases[translation.alias] == null) { + translation.alias = "default"; + if (messages.translation_unknown == null) { + messages.translation_unknown = []; + } + messages.translation_unknown.push(translation); + } + [temp_valid] = this.validate_start_ref(translation.alias, start, messages); + if (end) { + [temp_valid] = this.validate_end_ref(translation.alias, start, end, temp_valid, messages); } - messages.translation_invalid.push(translation); - continue; - } - if (this.translations.aliases[translation.alias] == null) { - translation.alias = "default"; - if (messages.translation_unknown == null) { - messages.translation_unknown = []; + if (temp_valid === true) { + valid = true; } - messages.translation_unknown.push(translation); - } - temp_valid = this.validate_start_ref(translation.alias, start, messages)[0]; - if (end) { - temp_valid = this.validate_end_ref(translation.alias, start, end, temp_valid, messages)[0]; - } - if (temp_valid === true) { - valid = true; } + return { + valid: valid, + messages: messages + }; } - return { - valid: valid, - messages: messages - }; - }; - bcv_passage.prototype.validate_start_ref = function(translation, start, messages) { - var ref, ref1, translation_order, valid; - valid = true; - if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters[start.b] : void 0) == null)) { - this.promote_book_to_translation(start.b, translation); - } - translation_order = ((ref1 = this.translations[translation]) != null ? ref1.order : void 0) != null ? translation : "default"; - if (start.v != null) { - start.v = parseInt(start.v, 10); - } - if (this.translations[translation_order].order[start.b] != null) { - if (start.c == null) { - start.c = 1; + // Make sure that the start ref exists in the given translation. + validate_start_ref(translation, start, messages) { + var ref, ref1, translation_order, valid; + valid = true; + if (translation !== "default" && (((ref = this.translations[translation]) != null ? ref.chapters[start.b] : void 0) == null)) { + this.promote_book_to_translation(start.b, translation); } - start.c = parseInt(start.c, 10); - if (isNaN(start.c)) { - valid = false; - messages.start_chapter_not_numeric = true; - return [valid, messages]; + translation_order = ((ref1 = this.translations[translation]) != null ? ref1.order : void 0) != null ? translation : "default"; + if (start.v != null) { + start.v = parseInt(start.v, 10); } - if (start.c === 0) { - messages.start_chapter_is_zero = 1; - if (this.options.zero_chapter_strategy === "error") { - valid = false; - } else { + // Matt + if (this.translations[translation_order].order[start.b] != null) { + if (start.c == null) { start.c = 1; } - } - if ((start.v != null) && start.v === 0) { - messages.start_verse_is_zero = 1; - if (this.options.zero_verse_strategy === "error") { + start.c = parseInt(start.c, 10); + // Matt five + if (isNaN(start.c)) { valid = false; - } else if (this.options.zero_verse_strategy === "upgrade") { - start.v = 1; + messages.start_chapter_not_numeric = true; + return [valid, messages]; } - } - if (start.c > 0 && (this.translations[translation].chapters[start.b][start.c - 1] != null)) { - if (start.v != null) { - if (isNaN(start.v)) { + // Matt 0 + if (start.c === 0) { + messages.start_chapter_is_zero = 1; + if (this.options.zero_chapter_strategy === "error") { + valid = false; + } else { + start.c = 1; + } + } + // Matt 5:0 + if ((start.v != null) && start.v === 0) { + messages.start_verse_is_zero = 1; + if (this.options.zero_verse_strategy === "error") { valid = false; - messages.start_verse_not_numeric = true; - } else if (start.v > this.translations[translation].chapters[start.b][start.c - 1]) { - if (this.options.passage_existence_strategy.indexOf("v") >= 0) { + // Can't just have `else` because `allow` is a valid `zero_verse_strategy`. + } else if (this.options.zero_verse_strategy === "upgrade") { + start.v = 1; + } + } + // Matt 5 + if (start.c > 0 && (this.translations[translation].chapters[start.b][start.c - 1] != null)) { + // Matt 5:10 + if (start.v != null) { + // Matt 5:ten + if (isNaN(start.v)) { valid = false; - messages.start_verse_not_exist = this.translations[translation].chapters[start.b][start.c - 1]; + messages.start_verse_not_numeric = true; + // Matt 5:100 + } else if (start.v > this.translations[translation].chapters[start.b][start.c - 1]) { + // Not part of the same `if` statement in case we ever add a new `else` condition. + if (this.options.passage_existence_strategy.indexOf("v") >= 0) { + valid = false; + messages.start_verse_not_exist = this.translations[translation].chapters[start.b][start.c - 1]; + } } + // Jude 1 when wanting to treat the `1` as a verse rather than a chapter. + } else if (start.c === 1 && this.options.single_chapter_1_strategy === "verse" && this.translations[translation].chapters[start.b].length === 1) { + messages.start_chapter_1 = 1; + } + } else { + // Matt 50 + if (start.c !== 1 && this.translations[translation].chapters[start.b].length === 1) { + valid = false; + messages.start_chapter_not_exist_in_single_chapter_book = 1; + } else if (start.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { + valid = false; + messages.start_chapter_not_exist = this.translations[translation].chapters[start.b].length; } - } else if (start.c === 1 && this.options.single_chapter_1_strategy === "verse" && this.translations[translation].chapters[start.b].length === 1) { - messages.start_chapter_1 = 1; } + // An unusual situation in which there's no defined start book. This only happens when a `c` becomes dissociated from its `b`. + } else if (start.b == null) { + valid = false; + messages.start_book_not_defined = true; } else { - if (start.c !== 1 && this.translations[translation].chapters[start.b].length === 1) { - valid = false; - messages.start_chapter_not_exist_in_single_chapter_book = 1; - } else if (start.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { + if (this.options.passage_existence_strategy.indexOf("b") >= 0) { + // None 2:1 valid = false; - messages.start_chapter_not_exist = this.translations[translation].chapters[start.b].length; } + messages.start_book_not_exist = true; } - } else if (start.b == null) { - valid = false; - messages.start_book_not_defined = true; - } else { - if (this.options.passage_existence_strategy.indexOf("b") >= 0) { - valid = false; - } - messages.start_book_not_exist = true; + // We return an array to make unit testing easier; we only use `valid`. + return [valid, messages]; } - return [valid, messages]; - }; - bcv_passage.prototype.validate_end_ref = function(translation, start, end, valid, messages) { - var ref, translation_order; - translation_order = ((ref = this.translations[translation]) != null ? ref.order : void 0) != null ? translation : "default"; - if (end.c != null) { - end.c = parseInt(end.c, 10); - if (isNaN(end.c)) { - valid = false; - messages.end_chapter_not_numeric = true; - } else if (end.c === 0) { - messages.end_chapter_is_zero = 1; - if (this.options.zero_chapter_strategy === "error") { + // The end ref pretty much just has to be after the start ref; beyond the book, we don't require the chapter or verse to exist. This approach is useful when people get end verses wrong. + validate_end_ref(translation, start, end, valid, messages) { + var ref, translation_order; + // It's not necessary to check for whether the book exists in a non-default translation here because we've already validated that it works as a `start_ref`, which created the book if it didn't exist. So we don't call `@promote_book_to_translation`. + translation_order = ((ref = this.translations[translation]) != null ? ref.order : void 0) != null ? translation : "default"; + // Matt 0 + if (end.c != null) { + end.c = parseInt(end.c, 10); + // Matt 2-four + if (isNaN(end.c)) { valid = false; - } else { - end.c = 1; + messages.end_chapter_not_numeric = true; + } else if (end.c === 0) { + messages.end_chapter_is_zero = 1; + if (this.options.zero_chapter_strategy === "error") { + valid = false; + } else { + end.c = 1; + } } } - } - if (end.v != null) { - end.v = parseInt(end.v, 10); - if (isNaN(end.v)) { - valid = false; - messages.end_verse_not_numeric = true; - } else if (end.v === 0) { - messages.end_verse_is_zero = 1; - if (this.options.zero_verse_strategy === "error") { + // Matt 5:0 + if (end.v != null) { + end.v = parseInt(end.v, 10); + // Matt 5:7-eight + if (isNaN(end.v)) { valid = false; - } else if (this.options.zero_verse_strategy === "upgrade") { - end.v = 1; + messages.end_verse_not_numeric = true; + } else if (end.v === 0) { + messages.end_verse_is_zero = 1; + if (this.options.zero_verse_strategy === "error") { + valid = false; + } else if (this.options.zero_verse_strategy === "upgrade") { + end.v = 1; + } } } - } - if (this.translations[translation_order].order[end.b] != null) { - if ((end.c == null) && this.translations[translation].chapters[end.b].length === 1) { - end.c = 1; - } - if ((this.translations[translation_order].order[start.b] != null) && this.translations[translation_order].order[start.b] > this.translations[translation_order].order[end.b]) { - if (this.options.passage_existence_strategy.indexOf("b") >= 0) { - valid = false; + // Matt-Mark + if (this.translations[translation_order].order[end.b] != null) { + if ((end.c == null) && this.translations[translation].chapters[end.b].length === 1) { + // Even if the `passage_existence_strategy` doesn't include `c`, make sure to treat single-chapter books as single-chapter books. + end.c = 1; } - messages.end_book_before_start = true; - } - if (start.b === end.b && (end.c != null) && !isNaN(end.c)) { - if (start.c == null) { - start.c = 1; + // Mark 4-Matt 5, None 4-Matt 5 + if ((this.translations[translation_order].order[start.b] != null) && this.translations[translation_order].order[start.b] > this.translations[translation_order].order[end.b]) { + if (this.options.passage_existence_strategy.indexOf("b") >= 0) { + valid = false; + } + messages.end_book_before_start = true; } - if (!isNaN(parseInt(start.c, 10)) && start.c > end.c) { - valid = false; - messages.end_chapter_before_start = true; - } else if (start.c === end.c && (end.v != null) && !isNaN(end.v)) { - if (start.v == null) { - start.v = 1; + // Matt 5-6 + if (start.b === end.b && (end.c != null) && !isNaN(end.c)) { + // Matt-Matt 4 + if (start.c == null) { + start.c = 1; } - if (!isNaN(parseInt(start.v, 10)) && start.v > end.v) { + // Matt 5-4 + if (!isNaN(parseInt(start.c, 10)) && start.c > end.c) { valid = false; - messages.end_verse_before_start = true; + messages.end_chapter_before_start = true; + // Matt 5:7-5:8 + } else if (start.c === end.c && (end.v != null) && !isNaN(end.v)) { + // Matt 5-5:8 + if (start.v == null) { + start.v = 1; + } + // Matt 5:8-7 + if (!isNaN(parseInt(start.v, 10)) && start.v > end.v) { + valid = false; + messages.end_verse_before_start = true; + } } } - } - if ((end.c != null) && !isNaN(end.c)) { - if (this.translations[translation].chapters[end.b][end.c - 1] == null) { - if (this.translations[translation].chapters[end.b].length === 1) { - messages.end_chapter_not_exist_in_single_chapter_book = 1; - } else if (end.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { - messages.end_chapter_not_exist = this.translations[translation].chapters[end.b].length; + if ((end.c != null) && !isNaN(end.c)) { + if (this.translations[translation].chapters[end.b][end.c - 1] == null) { + if (this.translations[translation].chapters[end.b].length === 1) { + messages.end_chapter_not_exist_in_single_chapter_book = 1; + } else if (end.c > 0 && this.options.passage_existence_strategy.indexOf("c") >= 0) { + messages.end_chapter_not_exist = this.translations[translation].chapters[end.b].length; + } } } - } - if ((end.v != null) && !isNaN(end.v)) { - if (end.c == null) { - end.c = this.translations[translation].chapters[end.b].length; - } - if (end.v > this.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0) { - messages.end_verse_not_exist = this.translations[translation].chapters[end.b][end.c - 1]; + if ((end.v != null) && !isNaN(end.v)) { + if (end.c == null) { + end.c = this.translations[translation].chapters[end.b].length; + } + if (end.v > this.translations[translation].chapters[end.b][end.c - 1] && this.options.passage_existence_strategy.indexOf("v") >= 0) { + messages.end_verse_not_exist = this.translations[translation].chapters[end.b][end.c - 1]; + } } + } else { + // Matt 5:1-None 6 + valid = false; + messages.end_book_not_exist = true; } - } else { - valid = false; - messages.end_book_not_exist = true; + // We return an array to make unit testing easier; we only use `valid`. + return [valid, messages]; } - return [valid, messages]; - }; - bcv_passage.prototype.promote_book_to_translation = function(book, translation) { - var base, base1; - if ((base = this.translations)[translation] == null) { - base[translation] = {}; - } - if ((base1 = this.translations[translation]).chapters == null) { - base1.chapters = {}; - } - if (this.translations[translation].chapters[book] == null) { - return this.translations[translation].chapters[book] = bcv_utils.shallow_clone_array(this.translations["default"].chapters[book]); + // Gradually add books to translations as they're needed. + promote_book_to_translation(book, translation) { + var base, base1; + if ((base = this.translations)[translation] == null) { + base[translation] = {}; + } + if ((base1 = this.translations[translation]).chapters == null) { + base1.chapters = {}; + } + // If the translation specifically overrides the default, use that. Otherwise stick with the default. + if (this.translations[translation].chapters[book] == null) { + return this.translations[translation].chapters[book] = bcv_utils.shallow_clone_array(this.translations.default.chapters[book]); + } } + }; + bcv_passage.prototype.books = []; + + bcv_passage.prototype.indices = {}; + + // `bcv_parser` sets these two. + bcv_passage.prototype.options = {}; + + bcv_passage.prototype.translations = {}; + return bcv_passage; - })(); + }).call(this); bcv_utils = { + // Make a shallow clone of an object. Nested objects are referenced, not cloned. shallow_clone: function(obj) { var key, out, val; if (obj == null) { @@ -2172,13 +2597,14 @@ } return out; }, + // Make a shallow clone of an array. Nested objects are referenced, not cloned. shallow_clone_array: function(arr) { var i, k, out, ref; if (arr == null) { return arr; } out = []; - for (i = k = 0, ref = arr.length; 0 <= ref ? k <= ref : k >= ref; i = 0 <= ref ? ++k : --k) { + for (i = k = 0, ref = arr.length; (0 <= ref ? k <= ref : k >= ref); i = 0 <= ref ? ++k : --k) { if (typeof arr[i] !== "undefined") { out[i] = arr[i]; } @@ -2187,17 +2613,18 @@ } }; + // When adding a new translation, add it both here and bcv_parser::translations.aliases bcv_parser.prototype.regexps.translations = /(?:(?:SEB))\b/gi; bcv_parser.prototype.translations = { aliases: { - "default": { + default: { osis: "", alias: "default" } }, alternates: {}, - "default": { + default: { order: { "Gen": 1, "Exod": 2, @@ -2369,7 +2796,7 @@ "1Esd": [58, 30, 24, 63, 73, 34, 15, 96, 55], "2Esd": [40, 48, 36, 52, 56, 59, 70, 63, 47, 59, 46, 51, 58, 48, 63, 78], "PrMan": [15], - "Ps151": [7] + "Ps151": [7] //Never actually a book--we add this to Psalms if needed. } }, vulgate: { @@ -2567,24 +2994,34 @@ bcv_parser.prototype.regexps.space = "[\\s\\xa0]"; - bcv_parser.prototype.regexps.escaped_passage = /(?:^|[^\x1f\x1e\dA-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:[\u2013\u2014\-]|through|thru|to)\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:\d+(?:th|nd|st)\s*ch(?:apter|a?pt\.?|a?p?\.?)?\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*))?\x1f(\d+)(?:\/\d+)?\x1f(?:\/\d+\x1f|[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014]|title(?![a-z])|ver[šs]ov|kapitoly|kapitole|kapitolu|kapitol|hlavy|a[žz]|porov|pozri|alebo|kap|ff|-|a|[b-e](?!\w)|$)+)/gi; + bcv_parser.prototype.regexps.escaped_passage = /(?:^|[^\x1f\x1e\dA-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:[\u2013\u2014\-]|through|thru|to)\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:ch(?:apters?|a?pts?\.?|a?p?s?\.?)?\s*\d+\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*)|(?:\d+(?:th|nd|st)\s*ch(?:apter|a?pt\.?|a?p?\.?)?\s*(?:from|of|in)(?:\s+the\s+book\s+of)?\s*))?\x1f(\d+)(?:\/\d+)?\x1f(?:\/\d+\x1f|[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014]|title(?![a-z])|ver[šs]ov|kapitoly|kapitole|kapitolu|kapitol|hlavy|a[žz]|porov|pozri|alebo|kap|ff|-|a|[b-e](?!\w)|$)+)/gi; // Beginning of string or not in the middle of a word or immediately following another book. Only count a book if it's part of a sequence: `Matt5John3` is OK, but not `1Matt5John3` + // Start inverted book/chapter (cb) + //no plurals here since it's a single chapter + // End inverted book/chapter (cb) + //book + //special Psalm chapters + //could be followed by a number + //a-e allows 1:1a + //or the end of the string - bcv_parser.prototype.regexps.match_end_split = /\d\W*title|\d\W*ff(?:[\s\xa0*]*\.)?|\d[\s\xa0*]*[b-e](?!\w)|\x1e(?:[\s\xa0*]*[)\]\uff09])?|[\d\x1f]/gi; + // These are the only valid ways to end a potential passage match. The closing parenthesis allows for fully capturing parentheses surrounding translations (ESV**)**. The last one, `[\d\x1f]` needs not to be +; otherwise `Gen5ff` becomes `\x1f0\x1f5ff`, and `adjust_regexp_end` matches the `\x1f5` and incorrectly dangles the ff. + bcv_parser.prototype.regexps.match_end_split = /\d\W*title|\d\W*ff(?:[\s\xa0*]*\.)?|\d[\s\xa0*]*[b-e](?!\w)|\x1e(?:[\s\xa0*]*[)\]\uff09])?|[\d\x1f]/gi; //ff09 is a full-width closing parenthesis bcv_parser.prototype.regexps.control = /[\x1e\x1f]/g; bcv_parser.prototype.regexps.pre_book = "[^A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ]"; - bcv_parser.prototype.regexps.first = "(?:Prv[áa]" + bcv_parser.prototype.regexps.space + "+kniha|Prv[ýy]" + bcv_parser.prototype.regexps.space + "+list|Prv[áa]|Prv[ýy]|1" + bcv_parser.prototype.regexps.space + "+k|I|1)\\.?" + bcv_parser.prototype.regexps.space + "*"; + bcv_parser.prototype.regexps.first = `(?:Prv[áa]${bcv_parser.prototype.regexps.space}+kniha|Prv[ýy]${bcv_parser.prototype.regexps.space}+list|Prv[áa]|Prv[ýy]|1${bcv_parser.prototype.regexps.space}+k|I|1)\\.?${bcv_parser.prototype.regexps.space}*`; - bcv_parser.prototype.regexps.second = "(?:Druh[áa]" + bcv_parser.prototype.regexps.space + "+kniha|Druh[ýy]" + bcv_parser.prototype.regexps.space + "+list|Druh[áa]|Druh[ýy]|2" + bcv_parser.prototype.regexps.space + "+k|II|2)\\.?" + bcv_parser.prototype.regexps.space + "*"; + bcv_parser.prototype.regexps.second = `(?:Druh[áa]${bcv_parser.prototype.regexps.space}+kniha|Druh[ýy]${bcv_parser.prototype.regexps.space}+list|Druh[áa]|Druh[ýy]|2${bcv_parser.prototype.regexps.space}+k|II|2)\\.?${bcv_parser.prototype.regexps.space}*`; - bcv_parser.prototype.regexps.third = "(?:Tretia" + bcv_parser.prototype.regexps.space + "+kniha|Tretia|Tret[íi]|3" + bcv_parser.prototype.regexps.space + "+k|III|3)\\.?" + bcv_parser.prototype.regexps.space + "*"; + bcv_parser.prototype.regexps.third = `(?:Tretia${bcv_parser.prototype.regexps.space}+kniha|Tretia|Tret[íi]|3${bcv_parser.prototype.regexps.space}+k|III|3)\\.?${bcv_parser.prototype.regexps.space}*`; bcv_parser.prototype.regexps.range_and = "(?:[&\u2013\u2014-]|(?:porov|pozri|alebo|a)|(?:a[žz]|-))"; bcv_parser.prototype.regexps.range_only = "(?:[\u2013\u2014-]|(?:a[žz]|-))"; + // Each book regexp should return two parenthesized objects: an optional preliminary character and the book itself. bcv_parser.prototype.regexps.get_books = function(include_apocrypha, case_sensitive) { var book, books, k, len, out; books = [ @@ -2592,282 +3029,425 @@ osis: ["Ps"], apocrypha: true, extra: "2", - regexp: /(\b)(Ps151)(?=\.1)/g - }, { + regexp: /(\b)(Ps151)(?=\.1)/g // Don't match a preceding \d like usual because we only want to match a valid OSIS, which will never have a preceding digit. // Case-sensitive because we only want to match a valid OSIS. + // Always follwed by ".1"; the regular Psalms parser can handle `Ps151` on its own. + }, + { osis: ["Gen"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1[\s\xa0]*Moj[zž]i[sš]ova)|(?:K(?:\.[\s\xa0]*p[o\xF4]|[\s\xa0]*p[o\xF4]|niha[\s\xa0]*p[o\xF4])vodu|G(?:enezis|n)|1[\s\xa0]*M|Gen|K(?:niha|\.)?[\s\xa0]*stvorenia|(?:1[\s\xa0]*k|I)[\s\xa0]*Moj[zž]i[sš]ova|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Moj[zž]i[sš]ova|Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš]|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš]))ova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|K(?:niha|\.)?[\s\xa0]*stvorenia|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:1[\s\xa0]*k|I)[\s\xa0]*Moj[zž]i[sš]ova|K(?:niha[\s\xa0]*p[o\xF4]|\.[\s\xa0]*p[o\xF4]|[\s\xa0]*p[o\xF4])vodu|1[\s\xa0]*Moj[zž]i[sš]ova|G(?:enezis|n)|Gen|1[\s\xa0]*M))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Exod"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2[\s\xa0]*Moj[zž]i[sš]ova|Exodus)|(?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš]|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš]))ova|(?:2[\s\xa0]*k|II)[\s\xa0]*Moj[zž]i[sš]ova|Exod|2[\s\xa0]*M|Ex|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Moj[zž]i[sš]ova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:2[\s\xa0]*k|II)[\s\xa0]*Moj[zž]i[sš]ova|2[\s\xa0]*Moj[zž]i[sš]ova|Exodus|Ex(?:od)?|2[\s\xa0]*M))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Bel"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:B[e\\xE9]l(?:[\\s\\xa0]*a[\\s\\xa0]*drak)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:B[e\\xE9]l(?:[\\s\\xa0]*a[\\s\\xa0]*drak)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Lev"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:3[\s\xa0]*Moj[zž]i[sš]ova)|(?:(?:3[\s\xa0]*k|III)[\s\xa0]*Moj[zž]i[sš]ova|L(?:evitikus|v)|3[\s\xa0]*M|Lev|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*Moj[zž]i[sš]ova|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[\s\xa0]*Moj[zž]i[sš])|\xED[\s\xa0]*Moj[zž]i[sš])ova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[\s\xa0]*Moj[zž]i[sš])|\xED[\s\xa0]*Moj[zž]i[sš])ova|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:III|3[\s\xa0]*k)[\s\xa0]*Moj[zž]i[sš]ova|3[\s\xa0]*Moj[zž]i[sš]ova|L(?:evitikus|v)|Lev|3[\s\xa0]*M))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Num"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:4[\s\xa0]*Moj[zž]i[sš]ova)|(?:(?:4[\s\xa0]*k|IV)[\s\xa0]*Moj[zž]i[sš]ova|N(?:umeri|m)|4[\s\xa0]*M|Num|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Moj[zž]i[sš]ova|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:4[\s\xa0]*k|IV)[\s\xa0]*Moj[zž]i[sš]ova|4[\s\xa0]*Moj[zž]i[sš]ova|N(?:umeri|m)|Num|4[\s\xa0]*M))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Sir"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:K(?:\\.[\\s\\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\\s\\xa0]*syn)a|Ekleziastikus)|[\\s\\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\\s\\xa0]*syn)a|Ekleziastikus)|niha[\\s\\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\\s\\xa0]*syn)a|Ekleziastikus))|Sir(?:achovcova|achovec)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:niha[\\s\\xa0]*(?:Sirachov(?:ho[\\s\\xa0]*syn|c(?:ov)?)a|Ekleziastikus)|\\.[\\s\\xa0]*(?:Sirachov(?:ho[\\s\\xa0]*syn|c(?:ov)?)a|Ekleziastikus)|[\\s\\xa0]*(?:Sirachov(?:ho[\\s\\xa0]*syn|c(?:ov)?)a|Ekleziastikus))|Sir(?:achovcova|achovec)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Wis"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:M[u\\xFA]d(?:ros(?:ti?|ť))?|Wis))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:M[u\\xFA]d(?:ros(?:ti?|ť))?|Wis))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Lam"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:K(?:\\.[\\s\\xa0]*n[a\\xE1]|[\\s\\xa0]*n[a\\xE1]|niha[\\s\\xa0]*n[a\\xE1])rekov|N[a\\xE1]reky|Lam|[ZŽ]alospevy|Pla[cč][\\s\\xa0]*Jeremi[a\\xE1][sš]ov|[ZŽ]alosp|N[a\\xE1]r|Jeremi[a\\xE1][sš]ov[\\s\\xa0]*Pla[cč])|(?:Pla[cč]))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Pla[cč][\\s\\xa0]*Jeremi[a\\xE1][sš]ov|Jeremi[a\\xE1][sš]ov[\\s\\xa0]*Pla[cč]|K(?:niha[\\s\\xa0]*n[a\\xE1]|\\.[\\s\\xa0]*n[a\\xE1]|[\\s\\xa0]*n[a\\xE1])rekov|[ZŽ]alospevy|[ZŽ]alosp|N[a\\xE1]reky|N[a\\xE1]r|Lam)|(?:Pla[cč]))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["EpJer"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Jeremi[a\\xE1][sš]ov[\\s\\xa0]*list|EpJer))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Jeremi[a\\xE1][sš]ov[\\s\\xa0]*list|EpJer))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Rev"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Zj(?:av(?:enie(?:[\\s\\xa0]*(?:sv[a\\xE4]t[e\\xE9]ho[\\s\\xa0]*J[a\\xE1]|J[a\\xE1]|Apo[sš]tola[\\s\\xa0]*J[a\\xE1])na)?)?|v)?|Apokalypsa|Rev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Zj(?:av(?:enie(?:[\\s\\xa0]*(?:Apo[sš]tola[\\s\\xa0]*J[a\\xE1]|sv[a\\xE4]t[e\\xE9]ho[\\s\\xa0]*J[a\\xE1]|J[a\\xE1])na)?)?|v)?|Apokalypsa|Rev))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["PrMan"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Manasesova[\\s\\xa0]*modlitba|PrMan))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Manasesova[\\s\\xa0]*modlitba|PrMan))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Deut"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:5[\s\xa0]*Moj[zž]i[sš]ova)|(?:D(?:euteron[o\xF3]mium|t)|5[\s\xa0]*M|Deut|(?:5[\s\xa0]*k|V)[\s\xa0]*Moj[zž]i[sš]ova|(?:5(?:[\s\xa0]*k)?|V)\.[\s\xa0]*Moj[zž]i[sš]ova|Piata[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Piata[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova|(?:5(?:[\s\xa0]*k)?|V)\.[\s\xa0]*Moj[zž]i[sš]ova|D(?:euteron[o\xF3]mium|t)|(?:5[\s\xa0]*k|V)[\s\xa0]*Moj[zž]i[sš]ova|5[\s\xa0]*Moj[zž]i[sš]ova|Deut|5[\s\xa0]*M))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Josh"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:J(?:o(?:z(?:u[ae]|uova)?|šu(?:ov)?a|s(?:u(?:ov)?a|h))|\\xF3zu(?:ov)?a)|Iosua))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:J(?:\\xF3zu(?:ov)?a|o(?:z(?:uova|u[ae])?|šu(?:ov)?a|s(?:u(?:ov)?a|h)))|Iosua))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Judg"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:S(?:udcovia|dc)|Judg|Sud(?:cov)?|K\\.?[\\s\\xa0]*sudcov))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K\\.?[\\s\\xa0]*sudcov|S(?:udcovia|dc)|Sud(?:cov)?|Judg))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Ruth"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:R(?:\\xFAt|uth?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:R(?:uth?|\\xFAt)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["1Esd"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?))|(?:1[\s\xa0]*k|I)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|1(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?)|[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|(?:1[\s\xa0]*k|I)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|1(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["2Esd"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?))|(?:2[\s\xa0]*k|II)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|2(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?)|[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|(?:2[\s\xa0]*k|II)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|2(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Isa"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:I(?:z(?:a[ij][a\\xE1][sš])?|sa)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:I(?:z(?:a[ij][a\\xE1][sš])?|sa)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["2Sam"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2[\s\xa0]*Samuelova)|(?:(?:2[\s\xa0]*k|II)[\s\xa0]*Samuelova|2(?:[\s\xa0]*?Sam|[\s\xa0]*S)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Samuelova|Druh(?:(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?)Samuelova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*)Samuelova|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Samuelova|(?:2[\s\xa0]*k|II)[\s\xa0]*Samuelova|2(?:[\s\xa0]*Samuelova|[\s\xa0]*S(?:am)?|Sam)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Sam"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1[\s\xa0]*Samuelova)|(?:(?:1[\s\xa0]*k|I)[\s\xa0]*Samuelova|1(?:[\s\xa0]*?Sam|[\s\xa0]*S)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Samuelova|Prv(?:(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?)Samuelova))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*)Samuelova|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Samuelova|(?:1[\s\xa0]*k|I)[\s\xa0]*Samuelova|1(?:[\s\xa0]*Samuelova|[\s\xa0]*S(?:am)?|Sam)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["2Kgs"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|Kgs|[\s\xa0]*Kr)|(?:Druh[y\xFD]|4)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:I[IV]|4[\s\xa0]*k|2[\s\xa0]*k)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:(?:I[IV]|4[\s\xa0]*k|4|2(?:[\s\xa0]*k)?)\.|Druh[y\xFD][\s\xa0]*list)[\s\xa0]*Kr[a\xE1][lľ]ov|Druh[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|Druh[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|(?:Druh[y\xFD][\s\xa0]*list|(?:4[\s\xa0]*k|2(?:[\s\xa0]*k)?|I[IV]|4)\.)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:Druh[y\xFD]|4)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:4[\s\xa0]*k|2[\s\xa0]*k|I[IV])[\s\xa0]*Kr[a\xE1][lľ]ov|2(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|[\s\xa0]*Kr|Kgs)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Kgs"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|Kgs|[\s\xa0]*Kr)|(?:Prv[y\xFD]|3)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:3[\s\xa0]*k|III|I|1[\s\xa0]*k)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:(?:3[\s\xa0]*k|III|[3I]|1(?:[\s\xa0]*k)?)\.|Prv[y\xFD][\s\xa0]*list)[\s\xa0]*Kr[a\xE1][lľ]ov|Prv[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])|[\s\xa0]*Kr[a\xE1][lľ])|\xED[\s\xa0]*Kr[a\xE1][lľ])ov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])|[\s\xa0]*Kr[a\xE1][lľ])|\xED[\s\xa0]*Kr[a\xE1][lľ])ov|Prv[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|(?:Prv[y\xFD][\s\xa0]*list|(?:III|3[\s\xa0]*k|1(?:[\s\xa0]*k)?|[3I])\.)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:Prv[y\xFD]|3)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:III|3[\s\xa0]*k|1[\s\xa0]*k|I)[\s\xa0]*Kr[a\xE1][lľ]ov|1(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|[\s\xa0]*Kr|Kgs)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["2Chr"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|[y\xFD][\s\xa0]*Paralipomenon|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon))|2(?:[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Krn|Chr|[\s\xa0]*Kron|[\s\xa0]*Paralipomenon)|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*Paralipomenon|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|2(?:[\s\xa0]*Paralipomenon|[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Kron|[\s\xa0]*Krn|Chr)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Chr"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|[y\xFD][\s\xa0]*Paralipomenon|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon))|1(?:[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Krn|Chr|[\s\xa0]*Kron|[\s\xa0]*Paralipomenon)|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*Paralipomenon|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|1(?:[\s\xa0]*Paralipomenon|[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Kron|[\s\xa0]*Krn|Chr)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Ezra"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Ez(?:d(?:r[a\\xE1][sš])?|ra)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Ez(?:d(?:r[a\\xE1][sš])?|ra)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Neh"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Neh(?:emi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Neh(?:emi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["GkEsth"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:G(?:r[e\\xE9]cke[\\s\\xa0]*[cč]asti[\\s\\xa0]*knihy[\\s\\xa0]*Ester|kEsth)|Ester[\\s\\xa0]*gr))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:G(?:r[e\\xE9]cke[\\s\\xa0]*[cč]asti[\\s\\xa0]*knihy[\\s\\xa0]*Ester|kEsth)|Ester[\\s\\xa0]*gr))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Esth"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Est(?:er|h)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Est(?:er|h)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Job"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:K(?:\\.[\\s\\xa0]*J[o\\xF3]|[\\s\\xa0]*J[o\\xF3]|niha[\\s\\xa0]*J[o\\xF3])bova|J[o\\xF3]b))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:niha[\\s\\xa0]*J[o\\xF3]|\\.[\\s\\xa0]*J[o\\xF3]|[\\s\\xa0]*J[o\\xF3])bova|J[o\\xF3]b))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Ps"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:[ZŽ]al(?:t[a\\xE1]r|my)|Ps|[ZŽ](?:alm)?|K(?:\\.[\\s\\xa0]*[zž]|[\\s\\xa0]*[zž]|niha[\\s\\xa0]*[zž])almov))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:niha[\\s\\xa0]*[zž]|\\.[\\s\\xa0]*[zž]|[\\s\\xa0]*[zž])almov|[ZŽ]al(?:t[a\\xE1]r|my)|[ZŽ](?:alm)?|Ps))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["PrAzar"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Azarj[a\\xE1][sš]ova[\\s\\xa0]*modlitba|PrAzar))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Azarj[a\\xE1][sš]ova[\\s\\xa0]*modlitba|PrAzar))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Prov"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:K(?:\\.[\\s\\xa0]*pr[i\\xED]slov[i\\xED]|[\\s\\xa0]*pr[i\\xED]slov[i\\xED]|niha[\\s\\xa0]*pr[i\\xED]slov[i\\xED])|Pr(?:[i\\xED]slovia|ov|[i\\xED]s)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:niha[\\s\\xa0]*pr[i\\xED]slov[i\\xED]|\\.[\\s\\xa0]*pr[i\\xED]slov[i\\xED]|[\\s\\xa0]*pr[i\\xED]slov[i\\xED])|Pr(?:[i\\xED]slovia|[i\\xED]s|ov)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Eccl"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Kazate[lľ])|(?:K(?:[\\s\\xa0]*kazate[lľ]ova|az|\\.[\\s\\xa0]*kazate[lľ]ova|niha[\\s\\xa0]*kazate[lľ]ova|oh(?:elet(?:[\\s\\xa0]*—[\\s\\xa0]*Kazate[lľ])?)?)|E(?:kleziastes|ccl)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:oh(?:elet(?:[\\s\\xa0]*—[\\s\\xa0]*Kazate[lľ])?)?|(?:niha[\\s\\xa0]*kazate[lľ]|\\.[\\s\\xa0]*kazate[lľ]|[\\s\\xa0]*kazate[lľ])ova|azate[lľ]|az)|E(?:kleziastes|ccl)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["SgThree"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Piese[nň][\\s\\xa0]*ml[a\\xE1]dencov[\\s\\xa0]*v[\\s\\xa0]*ohnivej[\\s\\xa0]*peci|SgThree|Traja[\\s\\xa0]*ml[a\\xE1]denci[\\s\\xa0]*v[\\s\\xa0]*rozp[a\\xE1]lenej[\\s\\xa0]*peci))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Traja[\\s\\xa0]*ml[a\\xE1]denci[\\s\\xa0]*v[\\s\\xa0]*rozp[a\\xE1]lenej[\\s\\xa0]*peci|Piese[nň][\\s\\xa0]*ml[a\\xE1]dencov[\\s\\xa0]*v[\\s\\xa0]*ohnivej[\\s\\xa0]*peci|SgThree))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Song"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Piese[nň][\\s\\xa0]*[SŠ]alam[u\\xFA]nova)|(?:V(?:e[lľ]p(?:iese[nň][\\s\\xa0]*[SŠ]alam[u\\xFA]nova)?|[lľ]p)|P(?:iese[nň][\\s\\xa0]*piesn[i\\xED]|Š)|Song|Pies)|(?:Ve[lľ]piese[nň]|Piese[nň]))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:V(?:e[lľ]p(?:iese[nň][\\s\\xa0]*[SŠ]alam[u\\xFA]nova)?|[lľ]p)|Piese[nň][\\s\\xa0]*[SŠ]alam[u\\xFA]nova|P(?:iese[nň][\\s\\xa0]*piesn[i\\xED]|Š)|Pies|Song)|(?:Ve[lľ]piese[nň]|Piese[nň]))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Jer"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Jer(?:emi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Jer(?:emi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Ezek"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Ez(?:e(?:chiel|k))?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Ez(?:e(?:ch(?:iel)?|k))?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Dan"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Dan(?:iel)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Dan(?:iel)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Hos"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Ho(?:ze[a\\xE1][sš]|s)|Oz(?:e[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Ho(?:ze[a\\xE1][sš]|s)|Oz(?:e[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Joel"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Joel))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Joel))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Amos"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:[A\\xC1]m(?:os)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:[A\\xC1]m(?:os)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Obad"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Ob(?:ad(?:i[a\\xE1][sš])?|edi[a\\xE1][sš])|Abd(?:i[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Ob(?:edi[a\\xE1][sš]|ad(?:i[a\\xE1][sš])?)|Abd(?:i[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Jonah"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Jon(?:\\xE1[sš]|a[hsš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Jon(?:\\xE1[sš]|a[hsš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Mic"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Mic(?:h(?:e[a\\xE1][sš])?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Mic(?:h(?:e[a\\xE1][sš])?)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Nah"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:N(?:ah(?:um)?|\\xE1hum)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:N(?:\\xE1hum|ah(?:um)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Hab"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Hab(?:akuk)?|Ab(?:akuk)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Hab(?:akuk)?|Ab(?:akuk)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Zeph"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Sof(?:oni[a\\xE1][sš])?|Zeph))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Sof(?:oni[a\\xE1][sš])?|Zeph))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Hag"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Ag(?:geus|eus)?|Hag(?:geus)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Hag(?:geus)?|Ag(?:geus|eus)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Zech"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Z(?:ach(?:ari[a\\xE1][sš])?|ech)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Z(?:ach(?:ari[a\\xE1][sš])?|ech)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Mal"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Mal(?:achi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Mal(?:achi[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Matt"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:M(?:at(?:[u\\xFA][sš]a|t)|t|at[u\\xFA][sš])|Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Mat[u\\xFA][sš]a))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Mat[u\\xFA][sš]a|M(?:at(?:[u\\xFA][sš]a|t)|at[u\\xFA][sš]|t)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Mark"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Marka|M(?:ar(?:ek|ka)|k|ark)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Marka|M(?:ar(?:ka|ek)|ark|k)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Luke"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:L(?:uk(?:[a\\xE1][sš]a|e)|k|uk[a\\xE1][sš])|Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Luk[a\\xE1][sš]a))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*Luk[a\\xE1][sš]a|L(?:uk(?:[a\\xE1][sš]a|e)|uk(?:[a\\xE1][sš])?|k)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["1John"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1[\s\xa0]*J[a\xE1]nov)|(?:Prv(?:[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov)|(?:1[\s\xa0]*k|I)[\s\xa0]*J[a\xE1]nov|1(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*J[a\xE1]nov)|(?:Prv[y\xFD][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*J[a\xE1]nov|(?:1[\s\xa0]*k|I)[\s\xa0]*J[a\xE1]nov|1(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Prv[y\xFD][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["2John"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2[\s\xa0]*J[a\xE1]nov)|(?:Druh(?:[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov)|(?:2[\s\xa0]*k|II)[\s\xa0]*J[a\xE1]nov|2(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*J[a\xE1]nov)|(?:Druh[y\xFD][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*J[a\xE1]nov|(?:2[\s\xa0]*k|II)[\s\xa0]*J[a\xE1]nov|2(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Druh[y\xFD][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["3John"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:3[\s\xa0]*J[a\xE1]nov)|(?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|\xED[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|(?:3[\s\xa0]*k|III)[\s\xa0]*J[a\xE1]nov|3(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*J[a\xE1]nov)|(?:Tret[i\xED][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|\xED[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*J[a\xE1]nov|(?:III|3[\s\xa0]*k)[\s\xa0]*J[a\xE1]nov|3(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Tret[i\xED][\s\xa0]*J[a\xE1]nov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["John"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:J(?:(?:oh)?n|[a\\xE1]na|[a\\xE1]n)|Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*J[a\\xE1]na))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Evanjelium[\\s\\xa0]*Pod[lľ]a[\\s\\xa0]*J[a\\xE1]na|J(?:(?:oh)?n|[a\\xE1]na|[a\\xE1]n)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Acts"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Sk(?:utky(?:[\\s\\xa0]*apo[sš]tolov)?)?|Acts))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Sk(?:utky(?:[\\s\\xa0]*apo[sš]tolov)?)?|Acts))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Rom"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Rimanom)|(?:(?:R(?:\\xEDmsky|o|imsky|i)|List[\\s\\xa0]*Rimano)m))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:(?:List[\\s\\xa0]*Rimano|R(?:\\xEDmsky|imsky|imano|i|o))m))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["2Cor"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[y\xFD][\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|Korin(?:t(?:sk[y\xFD]|ano)|ťano)))m|2(?:[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:[\s\xa0]*K|C)or)|(?:2[\s\xa0]*k|II)[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|Korin(?:ťano|t(?:sk[y\xFD]|ano)))|[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|[y\xFD][\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano)))m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:2[\s\xa0]*k|II)[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|2(?:[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:[\s\xa0]*K|C)or)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Cor"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[y\xFD][\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|Korin(?:t(?:sk[y\xFD]|ano)|ťano)))m|1(?:[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:[\s\xa0]*K|C)or)|(?:1[\s\xa0]*k|I)[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|Korin(?:ťano|t(?:sk[y\xFD]|ano)))|[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|[y\xFD][\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano)))m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:1[\s\xa0]*k|I)[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|1(?:[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:[\s\xa0]*K|C)or)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Gal"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Gala[tť]anom)|(?:Ga(?:latsk[y\\xFD]m|l)?|List[\\s\\xa0]*Gala[tť]anom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Gala[tť]anom|Ga(?:latsk[y\\xFD]m|latanom|laťanom|l)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Eph"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Efezanom)|(?:E(?:fezsk[y\\xFD]m|ph|f)|List[\\s\\xa0]*Efezanom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Efezanom|E(?:fezsk[y\\xFD]m|fezanom|ph|f)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Phil"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Filipsk[y\\xFD]m|Phil|Flp|Filipanom|List[\\s\\xa0]*Filipanom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Filipanom|Filipsk[y\\xFD]m|Filipanom|Phil|Flp))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Col"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Kolosanom)|(?:Kolosensk[y\\xFD]m|[CK]ol|List[\\s\\xa0]*Kolosanom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Kolosanom|Kolosensk[y\\xFD]m|Kolosanom|[CK]ol))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["2Thess"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m)|(?:Druh(?:[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky|[y\xFD][\s\xa0]*Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky)))m|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|2(?:[\s\xa0]*(?:Sol|Tes)|Thess)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))|[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky)m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|2(?:[\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))m|[\s\xa0]*Sol[u\xFA]n[cč]anom|[\s\xa0]*Sol[u\xFA]nskym|Thess|[\s\xa0]*(?:Sol|Tes))))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Thess"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m)|(?:Prv(?:[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky|[y\xFD][\s\xa0]*Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky)))m|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|1(?:[\s\xa0]*(?:Sol|Tes)|Thess)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))|[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky)m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|1(?:[\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))m|[\s\xa0]*Sol[u\xFA]n[cč]anom|[\s\xa0]*Sol[u\xFA]nskym|Thess|[\s\xa0]*(?:Sol|Tes))))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["2Tim"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?))ovi|2(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)|(?:2[\s\xa0]*k|II)[\s\xa0]*Timotej?ovi|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Timotej?ovi))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?)|[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?)ovi|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Timotej?ovi|(?:2[\s\xa0]*k|II)[\s\xa0]*Timotej?ovi|2(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Tim"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?))ovi|1(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)|(?:1[\s\xa0]*k|I)[\s\xa0]*Timotej?ovi|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Timotej?ovi))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?)|[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?)ovi|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Timotej?ovi|(?:1[\s\xa0]*k|I)[\s\xa0]*Timotej?ovi|1(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Titus"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:T(?:it(?:ovi|us)|\\xEDtovi))|(?:List[\\s\\xa0]*T[i\\xED]tovi|T[i\\xED]t))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*T[i\\xED]tovi|T(?:[i\\xED]tovi|itus|[i\\xED]t)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Phlm"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Filemonovi)|(?:List[\\s\\xa0]*Filem[o\\xF3]novi|(?:F(?:ile|l)|Phl)m))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Filem[o\\xF3]novi|Filemonovi|(?:File|(?:Ph|F)l)m))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Heb"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:(?:Hebrej|[ZŽ]id)om)|(?:[ZŽ]id|Hebr|Heb|List[\\s\\xa0]*Hebrejom))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:List[\\s\\xa0]*Hebrejom|Hebrejom|[ZŽ]idom|Hebr?|[ZŽ]id))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Jas"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:J(?:a(?:k(?:ubov(?:[\\s\\xa0]*List)?)?|s)|k)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:J(?:a(?:k(?:ubov(?:[\\s\\xa0]*List)?)?|s)|k)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["2Pet"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*Petrov|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov)|2(?:(?:[\s\xa0]*P|Pe)t|[\s\xa0]*Petrov)|(?:2[\s\xa0]*k|II)[\s\xa0]*Petrov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Petrov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov|[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[y\xFD][\s\xa0]*Petrov)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Petrov|(?:2[\s\xa0]*k|II)[\s\xa0]*Petrov|2(?:[\s\xa0]*Petrov|(?:[\s\xa0]*P|Pe)t)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Pet"], - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*Petrov|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov)|1(?:(?:[\s\xa0]*P|Pe)t|[\s\xa0]*Petrov)|(?:1[\s\xa0]*k|I)[\s\xa0]*Petrov|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Petrov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov|[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[y\xFD][\s\xa0]*Petrov)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Petrov|(?:1[\s\xa0]*k|I)[\s\xa0]*Petrov|1(?:[\s\xa0]*Petrov|(?:[\s\xa0]*P|Pe)t)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["Jude"], - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:J(?:\\xFAd(?:ov(?:[\\s\\xa0]*List)?)?|ud(?:ov(?:[\\s\\xa0]*List)?|e)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:J(?:\\xFAd(?:ov(?:[\\s\\xa0]*List)?)?|ud(?:ov(?:[\\s\\xa0]*List)?|e)?)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Tob"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Tob(?:i[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Tob(?:i[a\\xE1][sš])?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Jdt"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:K(?:niha|\\.)?[\\s\\xa0]*Juditina|J(?:udita|dt|udit)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:K(?:niha|\\.)?[\\s\\xa0]*Juditina|J(?:udita|udit|dt)))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Bar"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Proroctvo[\\s\\xa0]*Baruchovo|Bar(?:uch)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Proroctvo[\\s\\xa0]*Baruchovo|Bar(?:uch)?))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["Sus"], apocrypha: true, - regexp: RegExp("(^|" + bcv_parser.prototype.regexps.pre_book + ")((?:Zuzan[ae]|Sus))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/\"'\\*=~\\-\\u2013\\u2014])|$)", "gi") - }, { + regexp: RegExp(`(^|${bcv_parser.prototype.regexps.pre_book})((?:Zuzan[ae]|Sus))(?:(?=[\\d\\s\\xa0.:,;\\x1e\\x1f&\\(\\)\\uff08\\uff09\\[\\]/"'\\*=~\\-\\u2013\\u2014])|$)`, + "gi") + }, + { osis: ["2Macc"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:2(?:[\s\xa0]*Ma(?:ch|k)abejcov|[\s\xa0]*Ma(?:ch|k)|Macc)|(?:2[\s\xa0]*k|II)[\s\xa0]*Ma(?:ch|k)abejcov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ma(?:ch|k)abejcov|Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ma(?:ch|k)|[y\xFD][\s\xa0]*Ma(?:ch|k)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ma(?:ch|k)|Ma(?:ch|k)))abejcov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ma(?:ch|k)|Ma(?:ch|k))|[y\xFD][\s\xa0]*list[\s\xa0]*Ma(?:ch|k)|[y\xFD][\s\xa0]*Ma(?:ch|k))abejcov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ma(?:ch|k)abejcov|(?:2[\s\xa0]*k|II)[\s\xa0]*Ma(?:ch|k)abejcov|2(?:[\s\xa0]*Ma(?:ch|k)abejcov|[\s\xa0]*Ma(?:ch|k)|Macc)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["3Macc"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:3[\s\xa0]*Machabejcov)|(?:(?:3[\s\xa0]*k|III)[\s\xa0]*Machabejcov|3(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*Machabejcov|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*)?|[\s\xa0]*)|\xED[\s\xa0]*)Machabejcov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*)?|[\s\xa0]*)|\xED[\s\xa0]*)Machabejcov|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*Machabejcov|(?:III|3[\s\xa0]*k)[\s\xa0]*Machabejcov|3(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["4Macc"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:4[\s\xa0]*Machabejcov)|(?:(?:4[\s\xa0]*k|IV)[\s\xa0]*Machabejcov|4(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Machabejcov|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Machabejcov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi - }, { + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Machabejcov|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Machabejcov|(?:4[\s\xa0]*k|IV)[\s\xa0]*Machabejcov|4(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + }, + { osis: ["1Macc"], apocrypha: true, - regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:1[\s\xa0]*Machabejcov)|(?:Prv(?:[a\xE1][\s\xa0]*(?:Ma(?:ch|k)|kniha[\s\xa0]*Mach)|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*Mach)abejcov|(?:1[\s\xa0]*k|I)[\s\xa0]*Machabejcov|1(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Machabejcov))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi + regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Mach|Ma(?:ch|k))|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*Mach)abejcov|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Machabejcov|(?:1[\s\xa0]*k|I)[\s\xa0]*Machabejcov|1(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)))(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]\/"'\*=~\-\u2013\u2014])|$)/gi } ]; if (include_apocrypha === true && case_sensitive === "none") { + // Short-circuit the look if we know we want all the books. return books; } + // Filter out books in the Apocrypha if we don't want them. `Array.map` isn't supported below IE9. out = []; for (k = 0, len = books.length; k < len; k++) { book = books[k]; @@ -2882,6 +3462,7 @@ return out; }; + // Default to not using the Apocrypha bcv_parser.prototype.regexps.books = bcv_parser.prototype.regexps.get_books(false, "none"); var grammar; /* diff --git a/package-lock.json b/package-lock.json index 5f87c42..cb1d355 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,131 +1,343 @@ { "name": "bible-passage-reference-parser", "version": "2.0.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "balanced-match": { + "packages": { + "": { + "name": "bible-passage-reference-parser", + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "cat": "^0.2.0", + "coffee": "^5.5.1", + "coffeescript": "^2.1.1", + "jasmine": "^2.8.0", + "pegjs": "^0.10.0", + "regexgen": "^1.3.0" + } + }, + "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "requires": { - "balanced-match": "1.0.0", + "node_modules/brace-expansion": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "coffeescript": { + "node_modules/cat": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/cat/-/cat-0.2.0.tgz", + "integrity": "sha512-FrG38TVBt6XKcbWHNZ1AsnFr+eozwypXhaMRHuJrC1JvC+3GaG8G/MwuChyJOVVdPT5VsH91PiRFaheQlK/6Gg==", + "bin": { + "cat": "bin.js" + } + }, + "node_modules/coffee": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/coffee/-/coffee-5.5.1.tgz", + "integrity": "sha512-ZKt9b/Iq0jhe7tYpDMXJggx8l/+YIcQFi2C+LvJRQ7lUSJnzayir1BGbsoHELKKyV+zevWMCsfmGAI1fREyRbw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^6.0.5", + "debug": "^4.1.0", + "is-type-of": "^1.2.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/coffeescript": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.1.1.tgz", - "integrity": "sha512-Tl2z6/rNMqJ2LqWlVxLKwLF9FniwJpweonfSLCwhX8NFCEsGBcFIErtfKd8+t4XHDSYRshj9FXxPX53BT3lC9w==" + "integrity": "sha512-Tl2z6/rNMqJ2LqWlVxLKwLF9FniwJpweonfSLCwhX8NFCEsGBcFIErtfKd8+t4XHDSYRshj9FXxPX53BT3lC9w==", + "bin": { + "cake": "bin/cake", + "coffee": "bin/coffee" + }, + "engines": { + "node": ">=6" + } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "exit": { + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "engines": { + "node": ">= 0.8.0" + } }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "glob": { + "node_modules/glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "jasmine": { + "node_modules/is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", + "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==", + "license": "MIT" + }, + "node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/jasmine": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", - "requires": { - "exit": "0.1.2", - "glob": "7.1.2", - "jasmine-core": "2.8.0" + "dependencies": { + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.8.0" + }, + "bin": { + "jasmine": "bin/jasmine.js" } }, - "jasmine-core": { + "node_modules/jasmine-core": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=" }, - "jsesc": { + "node_modules/jsesc": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", - "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=" + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "1.1.8" + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "once": { + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "license": "MIT" + }, + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" + "dependencies": { + "wrappy": "1" } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "license": "MIT", + "engines": { + "node": ">=4" + } }, - "pegjs": { + "node_modules/pegjs": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", - "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" + "integrity": "sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==", + "license": "MIT", + "bin": { + "pegjs": "bin/pegjs" + }, + "engines": { + "node": ">=0.10" + } }, - "regenerate": { + "node_modules/regenerate": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==" }, - "regexgen": { + "node_modules/regexgen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/regexgen/-/regexgen-1.3.0.tgz", - "integrity": "sha1-sCLzjlEgu0b9zTf6y5EWjxXm/no=", - "requires": { - "jsesc": "2.5.1", - "regenerate": "1.3.3" + "integrity": "sha512-0BNTvyQBE8StSpjC5wPhydCTKP3SueHNOyjRiTM+vV3nip9UgFOZOjN6WJB7ikgcsEy5N5W6cT6xZCIdHcbvHA==", + "license": "MIT", + "dependencies": { + "jsesc": "^2.3.0", + "regenerate": "^1.3.2" + }, + "bin": { + "regexgen": "bin/cli.js" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" diff --git a/package.json b/package.json index 1275d21..f2d9f7b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,8 @@ }, "homepage": "https://github.com/Adventech/Bible-Passage-Reference-Parser", "dependencies": { + "cat": "^0.2.0", + "coffee": "^5.5.1", "coffeescript": "^2.1.1", "jasmine": "^2.8.0", "pegjs": "^0.10.0", diff --git a/src/sk/book_names.txt b/src/sk/book_names.txt index e83f9b9..a3cb638 100644 --- a/src/sk/book_names.txt +++ b/src/sk/book_names.txt @@ -1446,6 +1446,7 @@ Exod Exod Exod 2 M Exod Ex Ezek Ezechiel +Ezek Ezech Ezek Ezek Ezek Ez Ezra Ezdras @@ -1735,6 +1736,7 @@ Luke Lukaš Luke Lukás Luke Lukáš Luke Luke +Luke Luk Luke Lk Mal Malachias Mal Malachiaš diff --git a/src/sk/data.txt b/src/sk/data.txt index 86e9eaa..7af9411 100644 --- a/src/sk/data.txt +++ b/src/sk/data.txt @@ -44,7 +44,7 @@ Song Veľpieseň Pieseň piesní Pieseň Pies Veľpieseň Šalamúnova Pieseň Isa Izaiáš Iz Izajáš Jer Jeremiáš Jer Lam Náreky Plač Nár Žalospevy Plač Jeremiášov Jeremiášov Plač $BOOK nárekov Žalosp -Ezek Ezechiel Ez +Ezek Ezechiel Ez Ezech Dan Daniel Dan Hos Ozeáš Hozeáš Oz Joel Joel @@ -60,7 +60,7 @@ Zech Zachariáš Zach Mal Malachiáš Mal Matt Evanjelium Podľa Matúša Matúš Matúša Mt Mark Evanjelium Podľa Marka Marek Marka Mk -Luke Evanjelium Podľa Lukáša Lukáš Lukáša Lk +Luke Evanjelium Podľa Lukáša Lukáš Lukáša Lk Luk John Evanjelium Podľa Jána Ján Jána Jn Acts Skutky apoštolov Skutky Sk Rom List Rimanom Rimanom Rim Rímskym diff --git a/src/sk/regexps.coffee b/src/sk/regexps.coffee index 688dd8a..c2ad357 100644 --- a/src/sk/regexps.coffee +++ b/src/sk/regexps.coffee @@ -54,12 +54,12 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Gen"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1[\s\xa0]*Moj[zž]i[sš]ova)|(?:K(?:\.[\s\xa0]*p[o\xF4]|[\s\xa0]*p[o\xF4]|niha[\s\xa0]*p[o\xF4])vodu|G(?:enezis|n)|1[\s\xa0]*M|Gen|K(?:niha|\.)?[\s\xa0]*stvorenia|(?:1[\s\xa0]*k|I)[\s\xa0]*Moj[zž]i[sš]ova|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Moj[zž]i[sš]ova|Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš]|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš]))ova) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|K(?:niha|\.)?[\s\xa0]*stvorenia|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:1[\s\xa0]*k|I)[\s\xa0]*Moj[zž]i[sš]ova|K(?:niha[\s\xa0]*p[o\xF4]|\.[\s\xa0]*p[o\xF4]|[\s\xa0]*p[o\xF4])vodu|1[\s\xa0]*Moj[zž]i[sš]ova|G(?:enezis|n)|Gen|1[\s\xa0]*M) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Exod"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2[\s\xa0]*Moj[zž]i[sš]ova|Exodus)|(?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš]|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš]))ova|(?:2[\s\xa0]*k|II)[\s\xa0]*Moj[zž]i[sš]ova|Exod|2[\s\xa0]*M|Ex|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Moj[zž]i[sš]ova) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:2[\s\xa0]*k|II)[\s\xa0]*Moj[zž]i[sš]ova|2[\s\xa0]*Moj[zž]i[sš]ova|Exodus|Ex(?:od)?|2[\s\xa0]*M) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Bel"] @@ -70,18 +70,18 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Lev"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:3[\s\xa0]*Moj[zž]i[sš]ova)|(?:(?:3[\s\xa0]*k|III)[\s\xa0]*Moj[zž]i[sš]ova|L(?:evitikus|v)|3[\s\xa0]*M|Lev|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*Moj[zž]i[sš]ova|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[\s\xa0]*Moj[zž]i[sš])|\xED[\s\xa0]*Moj[zž]i[sš])ova) + (?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[\s\xa0]*Moj[zž]i[sš])|\xED[\s\xa0]*Moj[zž]i[sš])ova|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:III|3[\s\xa0]*k)[\s\xa0]*Moj[zž]i[sš]ova|3[\s\xa0]*Moj[zž]i[sš]ova|L(?:evitikus|v)|Lev|3[\s\xa0]*M) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Num"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:4[\s\xa0]*Moj[zž]i[sš]ova)|(?:(?:4[\s\xa0]*k|IV)[\s\xa0]*Moj[zž]i[sš]ova|N(?:umeri|m)|4[\s\xa0]*M|Num|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Moj[zž]i[sš]ova|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova) + (?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:4[\s\xa0]*k|IV)[\s\xa0]*Moj[zž]i[sš]ova|4[\s\xa0]*Moj[zž]i[sš]ova|N(?:umeri|m)|Num|4[\s\xa0]*M) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Sir"] apocrypha: true regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:K(?:\.[\s\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\s\xa0]*syn)a|Ekleziastikus)|[\s\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\s\xa0]*syn)a|Ekleziastikus)|niha[\s\xa0]*(?:Sirachov(?:c(?:ov)?|ho[\s\xa0]*syn)a|Ekleziastikus))|Sir(?:achovcova|achovec)?) + (?:K(?:niha[\s\xa0]*(?:Sirachov(?:ho[\s\xa0]*syn|c(?:ov)?)a|Ekleziastikus)|\.[\s\xa0]*(?:Sirachov(?:ho[\s\xa0]*syn|c(?:ov)?)a|Ekleziastikus)|[\s\xa0]*(?:Sirachov(?:ho[\s\xa0]*syn|c(?:ov)?)a|Ekleziastikus))|Sir(?:achovcova|achovec)?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Wis"] @@ -92,7 +92,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Lam"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:K(?:\.[\s\xa0]*n[a\xE1]|[\s\xa0]*n[a\xE1]|niha[\s\xa0]*n[a\xE1])rekov|N[a\xE1]reky|Lam|[ZŽ]alospevy|Pla[cč][\s\xa0]*Jeremi[a\xE1][sš]ov|[ZŽ]alosp|N[a\xE1]r|Jeremi[a\xE1][sš]ov[\s\xa0]*Pla[cč])|(?:Pla[cč]) + (?:Pla[cč][\s\xa0]*Jeremi[a\xE1][sš]ov|Jeremi[a\xE1][sš]ov[\s\xa0]*Pla[cč]|K(?:niha[\s\xa0]*n[a\xE1]|\.[\s\xa0]*n[a\xE1]|[\s\xa0]*n[a\xE1])rekov|[ZŽ]alospevy|[ZŽ]alosp|N[a\xE1]reky|N[a\xE1]r|Lam)|(?:Pla[cč]) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["EpJer"] @@ -103,7 +103,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Rev"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Zj(?:av(?:enie(?:[\s\xa0]*(?:sv[a\xE4]t[e\xE9]ho[\s\xa0]*J[a\xE1]|J[a\xE1]|Apo[sš]tola[\s\xa0]*J[a\xE1])na)?)?|v)?|Apokalypsa|Rev) + (?:Zj(?:av(?:enie(?:[\s\xa0]*(?:Apo[sš]tola[\s\xa0]*J[a\xE1]|sv[a\xE4]t[e\xE9]ho[\s\xa0]*J[a\xE1]|J[a\xE1])na)?)?|v)?|Apokalypsa|Rev) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["PrMan"] @@ -114,34 +114,34 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Deut"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:5[\s\xa0]*Moj[zž]i[sš]ova)|(?:D(?:euteron[o\xF3]mium|t)|5[\s\xa0]*M|Deut|(?:5[\s\xa0]*k|V)[\s\xa0]*Moj[zž]i[sš]ova|(?:5(?:[\s\xa0]*k)?|V)\.[\s\xa0]*Moj[zž]i[sš]ova|Piata[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova) + (?:Piata[\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])ova|(?:5(?:[\s\xa0]*k)?|V)\.[\s\xa0]*Moj[zž]i[sš]ova|D(?:euteron[o\xF3]mium|t)|(?:5[\s\xa0]*k|V)[\s\xa0]*Moj[zž]i[sš]ova|5[\s\xa0]*Moj[zž]i[sš]ova|Deut|5[\s\xa0]*M) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Josh"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:J(?:o(?:z(?:u[ae]|uova)?|šu(?:ov)?a|s(?:u(?:ov)?a|h))|\xF3zu(?:ov)?a)|Iosua) + (?:J(?:\xF3zu(?:ov)?a|o(?:z(?:uova|u[ae])?|šu(?:ov)?a|s(?:u(?:ov)?a|h)))|Iosua) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Judg"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:S(?:udcovia|dc)|Judg|Sud(?:cov)?|K\.?[\s\xa0]*sudcov) + (?:K\.?[\s\xa0]*sudcov|S(?:udcovia|dc)|Sud(?:cov)?|Judg) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Ruth"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:R(?:\xFAt|uth?)) + (?:R(?:uth?|\xFAt)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Esd"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?))|(?:1[\s\xa0]*k|I)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|1(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?)|[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|(?:1[\s\xa0]*k|I)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|1(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Esd"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?))|(?:2[\s\xa0]*k|II)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|2(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Ezdr[a\xE1][sš](?:ova)?)|[y\xFD][\s\xa0]*list[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|[y\xFD][\s\xa0]*Ezdr[a\xE1][sš](?:ova)?)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|(?:2[\s\xa0]*k|II)[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|2(?:[\s\xa0]*Ezdr[a\xE1][sš](?:ova)?|Esd)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Isa"] @@ -151,32 +151,32 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["2Sam"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2[\s\xa0]*Samuelova)|(?:(?:2[\s\xa0]*k|II)[\s\xa0]*Samuelova|2(?:[\s\xa0]*?Sam|[\s\xa0]*S)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Samuelova|Druh(?:(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?)Samuelova) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*)Samuelova|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Samuelova|(?:2[\s\xa0]*k|II)[\s\xa0]*Samuelova|2(?:[\s\xa0]*Samuelova|[\s\xa0]*S(?:am)?|Sam)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Sam"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1[\s\xa0]*Samuelova)|(?:(?:1[\s\xa0]*k|I)[\s\xa0]*Samuelova|1(?:[\s\xa0]*?Sam|[\s\xa0]*S)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Samuelova|Prv(?:(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?)Samuelova) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*)Samuelova|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Samuelova|(?:1[\s\xa0]*k|I)[\s\xa0]*Samuelova|1(?:[\s\xa0]*Samuelova|[\s\xa0]*S(?:am)?|Sam)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Kgs"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|Kgs|[\s\xa0]*Kr)|(?:Druh[y\xFD]|4)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:I[IV]|4[\s\xa0]*k|2[\s\xa0]*k)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:(?:I[IV]|4[\s\xa0]*k|4|2(?:[\s\xa0]*k)?)\.|Druh[y\xFD][\s\xa0]*list)[\s\xa0]*Kr[a\xE1][lľ]ov|Druh[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov) + (?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|Druh[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|(?:Druh[y\xFD][\s\xa0]*list|(?:4[\s\xa0]*k|2(?:[\s\xa0]*k)?|I[IV]|4)\.)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:Druh[y\xFD]|4)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:4[\s\xa0]*k|2[\s\xa0]*k|I[IV])[\s\xa0]*Kr[a\xE1][lľ]ov|2(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|[\s\xa0]*Kr|Kgs)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Kgs"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|Kgs|[\s\xa0]*Kr)|(?:Prv[y\xFD]|3)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:3[\s\xa0]*k|III|I|1[\s\xa0]*k)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:(?:3[\s\xa0]*k|III|[3I]|1(?:[\s\xa0]*k)?)\.|Prv[y\xFD][\s\xa0]*list)[\s\xa0]*Kr[a\xE1][lľ]ov|Prv[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])|[\s\xa0]*Kr[a\xE1][lľ])|\xED[\s\xa0]*Kr[a\xE1][lľ])ov) + (?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])|[\s\xa0]*Kr[a\xE1][lľ])|\xED[\s\xa0]*Kr[a\xE1][lľ])ov|Prv[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Kr[a\xE1][lľ]|Kr[a\xE1][lľ])ov|(?:Prv[y\xFD][\s\xa0]*list|(?:III|3[\s\xa0]*k|1(?:[\s\xa0]*k)?|[3I])\.)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:Prv[y\xFD]|3)[\s\xa0]*Kr[a\xE1][lľ]ov|(?:III|3[\s\xa0]*k|1[\s\xa0]*k|I)[\s\xa0]*Kr[a\xE1][lľ]ov|1(?:[\s\xa0]*Kr[a\xE1][lľ]ov|[\s\xa0]*Kr[lľ]|[\s\xa0]*Kr|Kgs)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Chr"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|[y\xFD][\s\xa0]*Paralipomenon|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon))|2(?:[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Krn|Chr|[\s\xa0]*Kron|[\s\xa0]*Paralipomenon)|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*Paralipomenon|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|2(?:[\s\xa0]*Paralipomenon|[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Kron|[\s\xa0]*Krn|Chr)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Chr"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|[y\xFD][\s\xa0]*Paralipomenon|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon))|1(?:[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Krn|Chr|[\s\xa0]*Kron|[\s\xa0]*Paralipomenon)|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Kron(?:i(?:ck[a\xE1]|k)|\xEDk)|Paralipomenon)) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|[y\xFD][\s\xa0]*Paralipomenon|[y\xFD][\s\xa0]*Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Paralipomenon|Kron(?:i(?:ck[a\xE1]|k)|\xEDk))|1(?:[\s\xa0]*Paralipomenon|[\s\xa0]*Kroni(?:ck[a\xE1]|k)|[\s\xa0]*Kron\xEDk|[\s\xa0]*Kron|[\s\xa0]*Krn|Chr)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Ezra"] @@ -202,12 +202,12 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Job"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:K(?:\.[\s\xa0]*J[o\xF3]|[\s\xa0]*J[o\xF3]|niha[\s\xa0]*J[o\xF3])bova|J[o\xF3]b) + (?:K(?:niha[\s\xa0]*J[o\xF3]|\.[\s\xa0]*J[o\xF3]|[\s\xa0]*J[o\xF3])bova|J[o\xF3]b) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Ps"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:[ZŽ]al(?:t[a\xE1]r|my)|Ps|[ZŽ](?:alm)?|K(?:\.[\s\xa0]*[zž]|[\s\xa0]*[zž]|niha[\s\xa0]*[zž])almov) + (?:K(?:niha[\s\xa0]*[zž]|\.[\s\xa0]*[zž]|[\s\xa0]*[zž])almov|[ZŽ]al(?:t[a\xE1]r|my)|[ZŽ](?:alm)?|Ps) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["PrAzar"] @@ -218,23 +218,23 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Prov"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:K(?:\.[\s\xa0]*pr[i\xED]slov[i\xED]|[\s\xa0]*pr[i\xED]slov[i\xED]|niha[\s\xa0]*pr[i\xED]slov[i\xED])|Pr(?:[i\xED]slovia|ov|[i\xED]s)?) + (?:K(?:niha[\s\xa0]*pr[i\xED]slov[i\xED]|\.[\s\xa0]*pr[i\xED]slov[i\xED]|[\s\xa0]*pr[i\xED]slov[i\xED])|Pr(?:[i\xED]slovia|[i\xED]s|ov)?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Eccl"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Kazate[lľ])|(?:K(?:[\s\xa0]*kazate[lľ]ova|az|\.[\s\xa0]*kazate[lľ]ova|niha[\s\xa0]*kazate[lľ]ova|oh(?:elet(?:[\s\xa0]*—[\s\xa0]*Kazate[lľ])?)?)|E(?:kleziastes|ccl)) + (?:K(?:oh(?:elet(?:[\s\xa0]*—[\s\xa0]*Kazate[lľ])?)?|(?:niha[\s\xa0]*kazate[lľ]|\.[\s\xa0]*kazate[lľ]|[\s\xa0]*kazate[lľ])ova|azate[lľ]|az)|E(?:kleziastes|ccl)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["SgThree"] apocrypha: true regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Piese[nň][\s\xa0]*ml[a\xE1]dencov[\s\xa0]*v[\s\xa0]*ohnivej[\s\xa0]*peci|SgThree|Traja[\s\xa0]*ml[a\xE1]denci[\s\xa0]*v[\s\xa0]*rozp[a\xE1]lenej[\s\xa0]*peci) + (?:Traja[\s\xa0]*ml[a\xE1]denci[\s\xa0]*v[\s\xa0]*rozp[a\xE1]lenej[\s\xa0]*peci|Piese[nň][\s\xa0]*ml[a\xE1]dencov[\s\xa0]*v[\s\xa0]*ohnivej[\s\xa0]*peci|SgThree) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Song"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Piese[nň][\s\xa0]*[SŠ]alam[u\xFA]nova)|(?:V(?:e[lľ]p(?:iese[nň][\s\xa0]*[SŠ]alam[u\xFA]nova)?|[lľ]p)|P(?:iese[nň][\s\xa0]*piesn[i\xED]|Š)|Song|Pies)|(?:Ve[lľ]piese[nň]|Piese[nň]) + (?:V(?:e[lľ]p(?:iese[nň][\s\xa0]*[SŠ]alam[u\xFA]nova)?|[lľ]p)|Piese[nň][\s\xa0]*[SŠ]alam[u\xFA]nova|P(?:iese[nň][\s\xa0]*piesn[i\xED]|Š)|Pies|Song)|(?:Ve[lľ]piese[nň]|Piese[nň]) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Jer"] @@ -244,7 +244,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Ezek"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Ez(?:e(?:chiel|k))?) + (?:Ez(?:e(?:ch(?:iel)?|k))?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Dan"] @@ -269,7 +269,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Obad"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Ob(?:ad(?:i[a\xE1][sš])?|edi[a\xE1][sš])|Abd(?:i[a\xE1][sš])?) + (?:Ob(?:edi[a\xE1][sš]|ad(?:i[a\xE1][sš])?)|Abd(?:i[a\xE1][sš])?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Jonah"] @@ -284,7 +284,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Nah"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:N(?:ah(?:um)?|\xE1hum)) + (?:N(?:\xE1hum|ah(?:um)?)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Hab"] @@ -299,7 +299,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Hag"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Ag(?:geus|eus)?|Hag(?:geus)?) + (?:Hag(?:geus)?|Ag(?:geus|eus)?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Zech"] @@ -314,37 +314,37 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Matt"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:M(?:at(?:[u\xFA][sš]a|t)|t|at[u\xFA][sš])|Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Mat[u\xFA][sš]a) + (?:Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Mat[u\xFA][sš]a|M(?:at(?:[u\xFA][sš]a|t)|at[u\xFA][sš]|t)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Mark"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Marka|M(?:ar(?:ek|ka)|k|ark)) + (?:Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Marka|M(?:ar(?:ka|ek)|ark|k)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Luke"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:L(?:uk(?:[a\xE1][sš]a|e)|k|uk[a\xE1][sš])|Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Luk[a\xE1][sš]a) + (?:Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*Luk[a\xE1][sš]a|L(?:uk(?:[a\xE1][sš]a|e)|uk(?:[a\xE1][sš])?|k)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1John"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1[\s\xa0]*J[a\xE1]nov)|(?:Prv(?:[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov)|(?:1[\s\xa0]*k|I)[\s\xa0]*J[a\xE1]nov|1(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*J[a\xE1]nov)|(?:Prv[y\xFD][\s\xa0]*J[a\xE1]nov) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*J[a\xE1]nov|(?:1[\s\xa0]*k|I)[\s\xa0]*J[a\xE1]nov|1(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Prv[y\xFD][\s\xa0]*J[a\xE1]nov) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2John"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2[\s\xa0]*J[a\xE1]nov)|(?:Druh(?:[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov)|(?:2[\s\xa0]*k|II)[\s\xa0]*J[a\xE1]nov|2(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*J[a\xE1]nov)|(?:Druh[y\xFD][\s\xa0]*J[a\xE1]nov) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[y\xFD][\s\xa0]*J[a\xE1]nov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*J[a\xE1]nov)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*J[a\xE1]nov|(?:2[\s\xa0]*k|II)[\s\xa0]*J[a\xE1]nov|2(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Druh[y\xFD][\s\xa0]*J[a\xE1]nov) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["3John"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:3[\s\xa0]*J[a\xE1]nov)|(?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|\xED[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|(?:3[\s\xa0]*k|III)[\s\xa0]*J[a\xE1]nov|3(?:(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J)|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*J[a\xE1]nov)|(?:Tret[i\xED][\s\xa0]*J[a\xE1]nov) + (?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*J[a\xE1]|J[a\xE1])nov|[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|\xED[\s\xa0]*J[a\xE1]nov[\s\xa0]*list)|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*J[a\xE1]nov|(?:III|3[\s\xa0]*k)[\s\xa0]*J[a\xE1]nov|3(?:[\s\xa0]*J[a\xE1]nov|(?:Joh|[\s\xa0]*J)n|[\s\xa0]*J))|(?:Tret[i\xED][\s\xa0]*J[a\xE1]nov) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["John"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:J(?:(?:oh)?n|[a\xE1]na|[a\xE1]n)|Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*J[a\xE1]na) + (?:Evanjelium[\s\xa0]*Pod[lľ]a[\s\xa0]*J[a\xE1]na|J(?:(?:oh)?n|[a\xE1]na|[a\xE1]n)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Acts"] @@ -354,72 +354,72 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["Rom"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Rimanom)|(?:(?:R(?:\xEDmsky|o|imsky|i)|List[\s\xa0]*Rimano)m) + (?:(?:List[\s\xa0]*Rimano|R(?:\xEDmsky|imsky|imano|i|o))m) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Cor"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[y\xFD][\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|Korin(?:t(?:sk[y\xFD]|ano)|ťano)))m|2(?:[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:[\s\xa0]*K|C)or)|(?:2[\s\xa0]*k|II)[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|Korin(?:ťano|t(?:sk[y\xFD]|ano)))|[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|[y\xFD][\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano)))m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:2[\s\xa0]*k|II)[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|2(?:[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:[\s\xa0]*K|C)or)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Cor"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[y\xFD][\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)|Korin(?:t(?:sk[y\xFD]|ano)|ťano)))m|1(?:[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:[\s\xa0]*K|C)or)|(?:1[\s\xa0]*k|I)[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Korin(?:t(?:sk[y\xFD]|ano)|ťano)m) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|Korin(?:ťano|t(?:sk[y\xFD]|ano)))|[y\xFD][\s\xa0]*list[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))|[y\xFD][\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano)))m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:1[\s\xa0]*k|I)[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|1(?:[\s\xa0]*Korin(?:ťano|t(?:sk[y\xFD]|ano))m|(?:[\s\xa0]*K|C)or)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Gal"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Gala[tť]anom)|(?:Ga(?:latsk[y\xFD]m|l)?|List[\s\xa0]*Gala[tť]anom) + (?:List[\s\xa0]*Gala[tť]anom|Ga(?:latsk[y\xFD]m|latanom|laťanom|l)?) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Eph"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Efezanom)|(?:E(?:fezsk[y\xFD]m|ph|f)|List[\s\xa0]*Efezanom) + (?:List[\s\xa0]*Efezanom|E(?:fezsk[y\xFD]m|fezanom|ph|f)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Phil"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Filipsk[y\xFD]m|Phil|Flp|Filipanom|List[\s\xa0]*Filipanom) + (?:List[\s\xa0]*Filipanom|Filipsk[y\xFD]m|Filipanom|Phil|Flp) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Col"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Kolosanom)|(?:Kolosensk[y\xFD]m|[CK]ol|List[\s\xa0]*Kolosanom) + (?:List[\s\xa0]*Kolosanom|Kolosensk[y\xFD]m|Kolosanom|[CK]ol) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Thess"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m)|(?:Druh(?:[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky|[y\xFD][\s\xa0]*Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky)))m|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|2(?:[\s\xa0]*(?:Sol|Tes)|Thess)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))|[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky)m|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|(?:2[\s\xa0]*k|II)[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|2(?:[\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))m|[\s\xa0]*Sol[u\xFA]n[cč]anom|[\s\xa0]*Sol[u\xFA]nskym|Thess|[\s\xa0]*(?:Sol|Tes))) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Thess"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m)|(?:Prv(?:[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky|[y\xFD][\s\xa0]*Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky)))m|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|1(?:[\s\xa0]*(?:Sol|Tes)|Thess)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Tesaloni(?:c(?:k[y\xFD]|ano)|čano)|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*list[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))|[y\xFD][\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))|[y\xFD][\s\xa0]*Sol[u\xFA]n[cč]ano|[y\xFD][\s\xa0]*Sol[u\xFA]nsky)m|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|(?:1[\s\xa0]*k|I)[\s\xa0]*(?:Tesaloni(?:čano|c(?:ano|k[y\xFD]))|Sol(?:[u\xFA]n[cč]ano|[u\xFA]nsky))m|1(?:[\s\xa0]*Tesaloni(?:čano|c(?:ano|k[y\xFD]))m|[\s\xa0]*Sol[u\xFA]n[cč]anom|[\s\xa0]*Sol[u\xFA]nskym|Thess|[\s\xa0]*(?:Sol|Tes))) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["2Tim"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?))ovi|2(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)|(?:2[\s\xa0]*k|II)[\s\xa0]*Timotej?ovi|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Timotej?ovi) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?)|[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?)ovi|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Timotej?ovi|(?:2[\s\xa0]*k|II)[\s\xa0]*Timotej?ovi|2(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Tim"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Prv(?:[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?))ovi|1(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)|(?:1[\s\xa0]*k|I)[\s\xa0]*Timotej?ovi|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Timotej?ovi) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Timotej?|Timotej?)|[y\xFD][\s\xa0]*list[\s\xa0]*Timotej?|[y\xFD][\s\xa0]*Timotej?)ovi|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Timotej?ovi|(?:1[\s\xa0]*k|I)[\s\xa0]*Timotej?ovi|1(?:[\s\xa0]*Timotej?ovi|[\s\xa0]*?Tim)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Titus"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:T(?:it(?:ovi|us)|\xEDtovi))|(?:List[\s\xa0]*T[i\xED]tovi|T[i\xED]t) + (?:List[\s\xa0]*T[i\xED]tovi|T(?:[i\xED]tovi|itus|[i\xED]t)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Phlm"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:Filemonovi)|(?:List[\s\xa0]*Filem[o\xF3]novi|(?:F(?:ile|l)|Phl)m) + (?:List[\s\xa0]*Filem[o\xF3]novi|Filemonovi|(?:File|(?:Ph|F)l)m) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Heb"] regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:(?:Hebrej|[ZŽ]id)om)|(?:[ZŽ]id|Hebr|Heb|List[\s\xa0]*Hebrejom) + (?:List[\s\xa0]*Hebrejom|Hebrejom|[ZŽ]idom|Hebr?|[ZŽ]id) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Jas"] @@ -429,12 +429,12 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> , osis: ["2Pet"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Druh(?:[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*Petrov|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov)|2(?:(?:[\s\xa0]*P|Pe)t|[\s\xa0]*Petrov)|(?:2[\s\xa0]*k|II)[\s\xa0]*Petrov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Petrov) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov|[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[y\xFD][\s\xa0]*Petrov)|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Petrov|(?:2[\s\xa0]*k|II)[\s\xa0]*Petrov|2(?:[\s\xa0]*Petrov|(?:[\s\xa0]*P|Pe)t)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Pet"] regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:Prv(?:[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*Petrov|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov)|1(?:(?:[\s\xa0]*P|Pe)t|[\s\xa0]*Petrov)|(?:1[\s\xa0]*k|I)[\s\xa0]*Petrov|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Petrov) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Petrov|[y\xFD][\s\xa0]*Petrov[\s\xa0]*list|[y\xFD][\s\xa0]*list[\s\xa0]*Petrov|[y\xFD][\s\xa0]*Petrov)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Petrov|(?:1[\s\xa0]*k|I)[\s\xa0]*Petrov|1(?:[\s\xa0]*Petrov|(?:[\s\xa0]*P|Pe)t)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Jude"] @@ -451,7 +451,7 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> osis: ["Jdt"] apocrypha: true regexp: ///(^|#{bcv_parser::regexps.pre_book})( - (?:K(?:niha|\.)?[\s\xa0]*Juditina|J(?:udita|dt|udit)) + (?:K(?:niha|\.)?[\s\xa0]*Juditina|J(?:udita|udit|dt)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["Bar"] @@ -469,25 +469,25 @@ bcv_parser::regexps.get_books = (include_apocrypha, case_sensitive) -> osis: ["2Macc"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:2(?:[\s\xa0]*Ma(?:ch|k)abejcov|[\s\xa0]*Ma(?:ch|k)|Macc)|(?:2[\s\xa0]*k|II)[\s\xa0]*Ma(?:ch|k)abejcov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ma(?:ch|k)abejcov|Druh(?:[y\xFD][\s\xa0]*list[\s\xa0]*Ma(?:ch|k)|[y\xFD][\s\xa0]*Ma(?:ch|k)|[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ma(?:ch|k)|Ma(?:ch|k)))abejcov) + (?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Ma(?:ch|k)|Ma(?:ch|k))|[y\xFD][\s\xa0]*list[\s\xa0]*Ma(?:ch|k)|[y\xFD][\s\xa0]*Ma(?:ch|k))abejcov|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Ma(?:ch|k)abejcov|(?:2[\s\xa0]*k|II)[\s\xa0]*Ma(?:ch|k)abejcov|2(?:[\s\xa0]*Ma(?:ch|k)abejcov|[\s\xa0]*Ma(?:ch|k)|Macc)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["3Macc"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:3[\s\xa0]*Machabejcov)|(?:(?:3[\s\xa0]*k|III)[\s\xa0]*Machabejcov|3(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:3(?:[\s\xa0]*k)?|III)\.[\s\xa0]*Machabejcov|Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*)?|[\s\xa0]*)|\xED[\s\xa0]*)Machabejcov) + (?:Tret(?:i(?:a[\s\xa0]*(?:kniha[\s\xa0]*)?|[\s\xa0]*)|\xED[\s\xa0]*)Machabejcov|(?:III|3(?:[\s\xa0]*k)?)\.[\s\xa0]*Machabejcov|(?:III|3[\s\xa0]*k)[\s\xa0]*Machabejcov|3(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["4Macc"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:4[\s\xa0]*Machabejcov)|(?:(?:4[\s\xa0]*k|IV)[\s\xa0]*Machabejcov|4(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Machabejcov|[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Machabejcov) + (?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Machabejcov|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Machabejcov|(?:4[\s\xa0]*k|IV)[\s\xa0]*Machabejcov|4(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi , osis: ["1Macc"] apocrypha: true regexp: ///(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])( - (?:1[\s\xa0]*Machabejcov)|(?:Prv(?:[a\xE1][\s\xa0]*(?:Ma(?:ch|k)|kniha[\s\xa0]*Mach)|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*Mach)abejcov|(?:1[\s\xa0]*k|I)[\s\xa0]*Machabejcov|1(?:[\s\xa0]*Ma(?:ch|k)|Macc)|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Machabejcov) + (?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Mach|Ma(?:ch|k))|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*Mach)abejcov|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Machabejcov|(?:1[\s\xa0]*k|I)[\s\xa0]*Machabejcov|1(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak)) )(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)///gi ] # Short-circuit the look if we know we want all the books. diff --git a/src/sk/spec.coffee b/src/sk/spec.coffee index 21f4c94..f3212aa 100644 --- a/src/sk/spec.coffee +++ b/src/sk/spec.coffee @@ -2459,10 +2459,12 @@ describe "Localized book Ezek (sk)", -> it "should handle book: Ezek (sk)", -> ` expect(p.parse("Ezechiel 1:1").osis()).toEqual("Ezek.1.1") + expect(p.parse("Ezech 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("Ez 1:1").osis()).toEqual("Ezek.1.1") p.include_apocrypha(false) expect(p.parse("EZECHIEL 1:1").osis()).toEqual("Ezek.1.1") + expect(p.parse("EZECH 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("EZ 1:1").osis()).toEqual("Ezek.1.1") ` @@ -2849,6 +2851,7 @@ describe "Localized book Luke (sk)", -> expect(p.parse("Lukás 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Lukáš 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1") + expect(p.parse("Luk 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Lk 1:1").osis()).toEqual("Luke.1.1") p.include_apocrypha(false) expect(p.parse("EVANJELIUM PODLA LUKASA 1:1").osis()).toEqual("Luke.1.1") @@ -2868,6 +2871,7 @@ describe "Localized book Luke (sk)", -> expect(p.parse("LUKÁS 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LUKÁŠ 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1") + expect(p.parse("LUK 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LK 1:1").osis()).toEqual("Luke.1.1") ` true diff --git a/test/js/sk.spec.js b/test/js/sk.spec.js index 867431d..f2fb0af 100644 --- a/test/js/sk.spec.js +++ b/test/js/sk.spec.js @@ -7,7 +7,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.options.osis_compaction_strategy = "b"; return p.options.sequence_combination_strategy = "combine"; }); @@ -73,7 +73,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -232,7 +232,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -373,7 +373,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -397,7 +397,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -506,7 +506,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -647,7 +647,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -682,7 +682,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -711,7 +711,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -798,7 +798,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -823,7 +823,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -884,7 +884,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -906,7 +906,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1001,7 +1001,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1046,7 +1046,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1081,7 +1081,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1108,7 +1108,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1241,7 +1241,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1374,7 +1374,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1415,7 +1415,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1470,7 +1470,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1525,7 +1525,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1778,7 +1778,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -1999,7 +1999,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2166,7 +2166,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2333,7 +2333,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2366,7 +2366,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2397,7 +2397,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2424,7 +2424,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2451,7 +2451,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2488,7 +2488,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2543,7 +2543,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2568,7 +2568,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2625,7 +2625,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2676,7 +2676,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2705,7 +2705,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2808,7 +2808,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2839,7 +2839,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2851,10 +2851,12 @@ return it("should handle book: Ezek (sk)", function() { expect(p.parse("Ezechiel 1:1").osis()).toEqual("Ezek.1.1") + expect(p.parse("Ezech 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("Ez 1:1").osis()).toEqual("Ezek.1.1") p.include_apocrypha(false) expect(p.parse("EZECHIEL 1:1").osis()).toEqual("Ezek.1.1") + expect(p.parse("EZECH 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1") expect(p.parse("EZ 1:1").osis()).toEqual("Ezek.1.1") ; @@ -2866,7 +2868,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2891,7 +2893,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2932,7 +2934,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2955,7 +2957,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -2984,7 +2986,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3033,7 +3035,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3066,7 +3068,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3099,7 +3101,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3126,7 +3128,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3155,7 +3157,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3188,7 +3190,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3219,7 +3221,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3252,7 +3254,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3283,7 +3285,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3340,7 +3342,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3373,7 +3375,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3401,6 +3403,7 @@ expect(p.parse("Lukás 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Lukáš 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1") + expect(p.parse("Luk 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("Lk 1:1").osis()).toEqual("Luke.1.1") p.include_apocrypha(false) expect(p.parse("EVANJELIUM PODLA LUKASA 1:1").osis()).toEqual("Luke.1.1") @@ -3420,6 +3423,7 @@ expect(p.parse("LUKÁS 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LUKÁŠ 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1") + expect(p.parse("LUK 1:1").osis()).toEqual("Luke.1.1") expect(p.parse("LK 1:1").osis()).toEqual("Luke.1.1") ; return true; @@ -3430,7 +3434,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3521,7 +3525,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3612,7 +3616,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3687,7 +3691,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3728,7 +3732,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3759,7 +3763,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3792,7 +3796,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -3929,7 +3933,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4066,7 +4070,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4103,7 +4107,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4136,7 +4140,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4169,7 +4173,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4202,7 +4206,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4509,7 +4513,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4816,7 +4820,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4897,7 +4901,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -4978,7 +4982,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5013,7 +5017,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5046,7 +5050,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5083,7 +5087,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5114,7 +5118,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5171,7 +5175,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5228,7 +5232,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5263,7 +5267,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5288,7 +5292,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5314,7 +5318,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5337,7 +5341,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5360,7 +5364,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5411,7 +5415,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5444,7 +5448,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5481,7 +5485,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore", @@ -5520,7 +5524,7 @@ var p; p = {}; beforeEach(function() { - p = new bcv_parser; + p = new bcv_parser(); p.set_options({ book_alone_strategy: "ignore", book_sequence_strategy: "ignore",