bible-ref-parse
Version:
Identifies and parses Bible references (like John 3:16) in over 40 languages.
1,196 lines (1,147 loc) • 75.1 kB
JavaScript
(function() {
var bcv_parser;
bcv_parser = require("../../dist/mq-bcv-parser.js").bcv_parser;
describe("Parsing (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.options.osis_compaction_strategy = "b";
p.options.sequence_combination_strategy = "combine";
});
it("should round-trip OSIS references", function() {
var bc, bcv, bcv_range, book, books, i, len;
p.set_options({
osis_compaction_strategy: "bc"
});
books = ["Gen", "Exod", "Lev", "Num", "Deut", "Josh", "Judg", "Ruth", "1Sam", "2Sam", "1Kgs", "2Kgs", "1Chr", "2Chr", "Ezra", "Neh", "Esth", "Job", "Ps", "Prov", "Eccl", "Song", "Isa", "Jer", "Lam", "Ezek", "Dan", "Hos", "Joel", "Amos", "Obad", "Jonah", "Mic", "Nah", "Hab", "Zeph", "Hag", "Zech", "Mal", "Matt", "Mark", "Luke", "John", "Acts", "Rom", "1Cor", "2Cor", "Gal", "Eph", "Phil", "Col", "1Thess", "2Thess", "1Tim", "2Tim", "Titus", "Phlm", "Heb", "Jas", "1Pet", "2Pet", "1John", "2John", "3John", "Jude", "Rev"];
for (i = 0, len = books.length; i < len; i++) {
book = books[i];
bc = book + ".1";
bcv = bc + ".1";
bcv_range = bcv + "-" + bc + ".2";
expect(p.parse(bc).osis()).toEqual(bc);
expect(p.parse(bcv).osis()).toEqual(bcv);
expect(p.parse(bcv_range).osis()).toEqual(bcv_range);
}
});
it("should round-trip OSIS Apocrypha references", function() {
var bc, bcv, bcv_range, book, books, i, j, len, len1;
p.set_options({
osis_compaction_strategy: "bc",
ps151_strategy: "b"
});
p.include_apocrypha(true);
books = ["Tob", "Jdt", "GkEsth", "Wis", "Sir", "Bar", "PrAzar", "Sus", "Bel", "SgThree", "EpJer", "1Macc", "2Macc", "3Macc", "4Macc", "1Esd", "2Esd", "PrMan", "Ps151"];
for (i = 0, len = books.length; i < len; i++) {
book = books[i];
bc = book + ".1";
bcv = bc + ".1";
bcv_range = bcv + "-" + bc + ".2";
expect(p.parse(bc).osis()).toEqual(bc);
expect(p.parse(bcv).osis()).toEqual(bcv);
expect(p.parse(bcv_range).osis()).toEqual(bcv_range);
}
p.set_options({
ps151_strategy: "bc"
});
expect(p.parse("Ps151.1").osis()).toEqual("Ps.151");
expect(p.parse("Ps151.1.1").osis()).toEqual("Ps.151.1");
expect(p.parse("Ps151.1-Ps151.2").osis()).toEqual("Ps.151.1-Ps.151.2");
p.include_apocrypha(false);
for (j = 0, len1 = books.length; j < len1; j++) {
book = books[j];
bc = book + ".1";
expect(p.parse(bc).osis()).toEqual("");
}
});
it("should handle a preceding character", function() {
expect(p.parse(" Gen 1").osis()).toEqual("Gen.1");
expect(p.parse("Matt5John3").osis()).toEqual("Matt.5,John.3");
expect(p.parse("1Ps 1").osis()).toEqual("");
expect(p.parse("11Sam 1").osis()).toEqual("");
});
});
describe("Localized book Gen (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Gen (mq)", function() {
expect(p.parse("Genesis 1:1").osis()).toEqual("Gen.1.1", "parsing: 'Genesis 1:1'");
expect(p.parse("Gen 1:1").osis()).toEqual("Gen.1.1", "parsing: 'Gen 1:1'");
p.include_apocrypha(false);
expect(p.parse("GENESIS 1:1").osis()).toEqual("Gen.1.1", "parsing: 'GENESIS 1:1'");
expect(p.parse("GEN 1:1").osis()).toEqual("Gen.1.1", "parsing: 'GEN 1:1'");
});
});
describe("Localized book Exod (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Exod (mq)", function() {
expect(p.parse("�xodo 1:1").osis()).toEqual("Exod.1.1", "parsing: '�xodo 1:1'");
expect(p.parse("Exod 1:1").osis()).toEqual("Exod.1.1", "parsing: 'Exod 1:1'");
expect(p.parse("�xo 1:1").osis()).toEqual("Exod.1.1", "parsing: '�xo 1:1'");
p.include_apocrypha(false);
expect(p.parse("�XODO 1:1").osis()).toEqual("Exod.1.1", "parsing: '�XODO 1:1'");
expect(p.parse("EXOD 1:1").osis()).toEqual("Exod.1.1", "parsing: 'EXOD 1:1'");
expect(p.parse("�XO 1:1").osis()).toEqual("Exod.1.1", "parsing: '�XO 1:1'");
});
});
describe("Localized book Lev (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Lev (mq)", function() {
expect(p.parse("Lev�tico 1:1").osis()).toEqual("Lev.1.1", "parsing: 'Lev�tico 1:1'");
expect(p.parse("Lev 1:1").osis()).toEqual("Lev.1.1", "parsing: 'Lev 1:1'");
p.include_apocrypha(false);
expect(p.parse("LEV�TICO 1:1").osis()).toEqual("Lev.1.1", "parsing: 'LEV�TICO 1:1'");
expect(p.parse("LEV 1:1").osis()).toEqual("Lev.1.1", "parsing: 'LEV 1:1'");
});
});
describe("Localized book Num (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Num (mq)", function() {
expect(p.parse("N�meros 1:1").osis()).toEqual("Num.1.1", "parsing: 'N�meros 1:1'");
expect(p.parse("Num 1:1").osis()).toEqual("Num.1.1", "parsing: 'Num 1:1'");
expect(p.parse("N�m 1:1").osis()).toEqual("Num.1.1", "parsing: 'N�m 1:1'");
p.include_apocrypha(false);
expect(p.parse("N�MEROS 1:1").osis()).toEqual("Num.1.1", "parsing: 'N�MEROS 1:1'");
expect(p.parse("NUM 1:1").osis()).toEqual("Num.1.1", "parsing: 'NUM 1:1'");
expect(p.parse("N�M 1:1").osis()).toEqual("Num.1.1", "parsing: 'N�M 1:1'");
});
});
describe("Localized book Lam (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Lam (mq)", function() {
expect(p.parse("Lamentaciones 1:1").osis()).toEqual("Lam.1.1", "parsing: 'Lamentaciones 1:1'");
expect(p.parse("Lam 1:1").osis()).toEqual("Lam.1.1", "parsing: 'Lam 1:1'");
p.include_apocrypha(false);
expect(p.parse("LAMENTACIONES 1:1").osis()).toEqual("Lam.1.1", "parsing: 'LAMENTACIONES 1:1'");
expect(p.parse("LAM 1:1").osis()).toEqual("Lam.1.1", "parsing: 'LAM 1:1'");
});
});
describe("Localized book Rev (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Rev (mq)", function() {
expect(p.parse("Apocalipsis 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Apocalipsis 1:1'");
expect(p.parse("Apo 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Apo 1:1'");
expect(p.parse("Rev 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Rev 1:1'");
p.include_apocrypha(false);
expect(p.parse("APOCALIPSIS 1:1").osis()).toEqual("Rev.1.1", "parsing: 'APOCALIPSIS 1:1'");
expect(p.parse("APO 1:1").osis()).toEqual("Rev.1.1", "parsing: 'APO 1:1'");
expect(p.parse("REV 1:1").osis()).toEqual("Rev.1.1", "parsing: 'REV 1:1'");
});
});
describe("Localized book Deut (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Deut (mq)", function() {
expect(p.parse("Deuteronomio 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Deuteronomio 1:1'");
expect(p.parse("Deut 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Deut 1:1'");
expect(p.parse("Deu 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Deu 1:1'");
p.include_apocrypha(false);
expect(p.parse("DEUTERONOMIO 1:1").osis()).toEqual("Deut.1.1", "parsing: 'DEUTERONOMIO 1:1'");
expect(p.parse("DEUT 1:1").osis()).toEqual("Deut.1.1", "parsing: 'DEUT 1:1'");
expect(p.parse("DEU 1:1").osis()).toEqual("Deut.1.1", "parsing: 'DEU 1:1'");
});
});
describe("Localized book Josh (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Josh (mq)", function() {
expect(p.parse("Josu� 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Josu� 1:1'");
expect(p.parse("Josh 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Josh 1:1'");
expect(p.parse("Jos 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Jos 1:1'");
p.include_apocrypha(false);
expect(p.parse("JOSU� 1:1").osis()).toEqual("Josh.1.1", "parsing: 'JOSU� 1:1'");
expect(p.parse("JOSH 1:1").osis()).toEqual("Josh.1.1", "parsing: 'JOSH 1:1'");
expect(p.parse("JOS 1:1").osis()).toEqual("Josh.1.1", "parsing: 'JOS 1:1'");
});
});
describe("Localized book Judg (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Judg (mq)", function() {
expect(p.parse("Jueces 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Jueces 1:1'");
expect(p.parse("Judg 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Judg 1:1'");
expect(p.parse("Jue 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Jue 1:1'");
p.include_apocrypha(false);
expect(p.parse("JUECES 1:1").osis()).toEqual("Judg.1.1", "parsing: 'JUECES 1:1'");
expect(p.parse("JUDG 1:1").osis()).toEqual("Judg.1.1", "parsing: 'JUDG 1:1'");
expect(p.parse("JUE 1:1").osis()).toEqual("Judg.1.1", "parsing: 'JUE 1:1'");
});
});
describe("Localized book Ruth (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Ruth (mq)", function() {
expect(p.parse("Ruth 1:1").osis()).toEqual("Ruth.1.1", "parsing: 'Ruth 1:1'");
expect(p.parse("Rut 1:1").osis()).toEqual("Ruth.1.1", "parsing: 'Rut 1:1'");
p.include_apocrypha(false);
expect(p.parse("RUTH 1:1").osis()).toEqual("Ruth.1.1", "parsing: 'RUTH 1:1'");
expect(p.parse("RUT 1:1").osis()).toEqual("Ruth.1.1", "parsing: 'RUT 1:1'");
});
});
describe("Localized book Isa (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Isa (mq)", function() {
expect(p.parse("Isa�as 1:1").osis()).toEqual("Isa.1.1", "parsing: 'Isa�as 1:1'");
expect(p.parse("Isa 1:1").osis()).toEqual("Isa.1.1", "parsing: 'Isa 1:1'");
p.include_apocrypha(false);
expect(p.parse("ISA�AS 1:1").osis()).toEqual("Isa.1.1", "parsing: 'ISA�AS 1:1'");
expect(p.parse("ISA 1:1").osis()).toEqual("Isa.1.1", "parsing: 'ISA 1:1'");
});
});
describe("Localized book 2Sam (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 2Sam (mq)", function() {
expect(p.parse("2. Samuel 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. Samuel 1:1'");
expect(p.parse("2 Samuel 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 Samuel 1:1'");
expect(p.parse("2. Sa 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. Sa 1:1'");
expect(p.parse("2 Sa 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 Sa 1:1'");
expect(p.parse("2Sam 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2Sam 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. SAMUEL 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. SAMUEL 1:1'");
expect(p.parse("2 SAMUEL 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 SAMUEL 1:1'");
expect(p.parse("2. SA 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. SA 1:1'");
expect(p.parse("2 SA 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 SA 1:1'");
expect(p.parse("2SAM 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2SAM 1:1'");
});
});
describe("Localized book 1Sam (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 1Sam (mq)", function() {
expect(p.parse("1. Samuel 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. Samuel 1:1'");
expect(p.parse("1 Samuel 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 Samuel 1:1'");
expect(p.parse("1. Sa 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. Sa 1:1'");
expect(p.parse("1 Sa 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 Sa 1:1'");
expect(p.parse("1Sam 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1Sam 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. SAMUEL 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. SAMUEL 1:1'");
expect(p.parse("1 SAMUEL 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 SAMUEL 1:1'");
expect(p.parse("1. SA 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. SA 1:1'");
expect(p.parse("1 SA 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 SA 1:1'");
expect(p.parse("1SAM 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1SAM 1:1'");
});
});
describe("Localized book 2Kgs (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 2Kgs (mq)", function() {
expect(p.parse("2. Reyes 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. Reyes 1:1'");
expect(p.parse("2 Reyes 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 Reyes 1:1'");
expect(p.parse("2. Re 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. Re 1:1'");
expect(p.parse("2 Re 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 Re 1:1'");
expect(p.parse("2Kgs 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2Kgs 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. REYES 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. REYES 1:1'");
expect(p.parse("2 REYES 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 REYES 1:1'");
expect(p.parse("2. RE 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. RE 1:1'");
expect(p.parse("2 RE 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 RE 1:1'");
expect(p.parse("2KGS 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2KGS 1:1'");
});
});
describe("Localized book 1Kgs (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 1Kgs (mq)", function() {
expect(p.parse("1. Reyes 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. Reyes 1:1'");
expect(p.parse("1 Reyes 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 Reyes 1:1'");
expect(p.parse("1. Re 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. Re 1:1'");
expect(p.parse("1 Re 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 Re 1:1'");
expect(p.parse("1Kgs 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1Kgs 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. REYES 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. REYES 1:1'");
expect(p.parse("1 REYES 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 REYES 1:1'");
expect(p.parse("1. RE 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. RE 1:1'");
expect(p.parse("1 RE 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 RE 1:1'");
expect(p.parse("1KGS 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1KGS 1:1'");
});
});
describe("Localized book 2Chr (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 2Chr (mq)", function() {
expect(p.parse("2. Cr�nicas 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. Cr�nicas 1:1'");
expect(p.parse("2 Cr�nicas 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 Cr�nicas 1:1'");
expect(p.parse("2. Cr 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. Cr 1:1'");
expect(p.parse("2 Cr 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 Cr 1:1'");
expect(p.parse("2Chr 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2Chr 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. CR�NICAS 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. CR�NICAS 1:1'");
expect(p.parse("2 CR�NICAS 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 CR�NICAS 1:1'");
expect(p.parse("2. CR 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. CR 1:1'");
expect(p.parse("2 CR 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 CR 1:1'");
expect(p.parse("2CHR 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2CHR 1:1'");
});
});
describe("Localized book 1Chr (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 1Chr (mq)", function() {
expect(p.parse("1. Cr�nicas 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. Cr�nicas 1:1'");
expect(p.parse("1 Cr�nicas 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 Cr�nicas 1:1'");
expect(p.parse("1. Cr 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. Cr 1:1'");
expect(p.parse("1 Cr 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 Cr 1:1'");
expect(p.parse("1Chr 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1Chr 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. CR�NICAS 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. CR�NICAS 1:1'");
expect(p.parse("1 CR�NICAS 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 CR�NICAS 1:1'");
expect(p.parse("1. CR 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. CR 1:1'");
expect(p.parse("1 CR 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 CR 1:1'");
expect(p.parse("1CHR 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1CHR 1:1'");
});
});
describe("Localized book Ezra (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Ezra (mq)", function() {
expect(p.parse("Esdras 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'Esdras 1:1'");
expect(p.parse("Ezra 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'Ezra 1:1'");
expect(p.parse("Esd 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'Esd 1:1'");
p.include_apocrypha(false);
expect(p.parse("ESDRAS 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'ESDRAS 1:1'");
expect(p.parse("EZRA 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'EZRA 1:1'");
expect(p.parse("ESD 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'ESD 1:1'");
});
});
describe("Localized book Neh (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Neh (mq)", function() {
expect(p.parse("Nehem�as 1:1").osis()).toEqual("Neh.1.1", "parsing: 'Nehem�as 1:1'");
expect(p.parse("Neh 1:1").osis()).toEqual("Neh.1.1", "parsing: 'Neh 1:1'");
p.include_apocrypha(false);
expect(p.parse("NEHEM�AS 1:1").osis()).toEqual("Neh.1.1", "parsing: 'NEHEM�AS 1:1'");
expect(p.parse("NEH 1:1").osis()).toEqual("Neh.1.1", "parsing: 'NEH 1:1'");
});
});
describe("Localized book Esth (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Esth (mq)", function() {
expect(p.parse("Ester 1:1").osis()).toEqual("Esth.1.1", "parsing: 'Ester 1:1'");
expect(p.parse("Esth 1:1").osis()).toEqual("Esth.1.1", "parsing: 'Esth 1:1'");
expect(p.parse("Est 1:1").osis()).toEqual("Esth.1.1", "parsing: 'Est 1:1'");
p.include_apocrypha(false);
expect(p.parse("ESTER 1:1").osis()).toEqual("Esth.1.1", "parsing: 'ESTER 1:1'");
expect(p.parse("ESTH 1:1").osis()).toEqual("Esth.1.1", "parsing: 'ESTH 1:1'");
expect(p.parse("EST 1:1").osis()).toEqual("Esth.1.1", "parsing: 'EST 1:1'");
});
});
describe("Localized book Job (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Job (mq)", function() {
expect(p.parse("Job 1:1").osis()).toEqual("Job.1.1", "parsing: 'Job 1:1'");
p.include_apocrypha(false);
expect(p.parse("JOB 1:1").osis()).toEqual("Job.1.1", "parsing: 'JOB 1:1'");
});
});
describe("Localized book Ps (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Ps (mq)", function() {
expect(p.parse("Salmos 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Salmos 1:1'");
expect(p.parse("Sal 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Sal 1:1'");
expect(p.parse("Ps 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Ps 1:1'");
p.include_apocrypha(false);
expect(p.parse("SALMOS 1:1").osis()).toEqual("Ps.1.1", "parsing: 'SALMOS 1:1'");
expect(p.parse("SAL 1:1").osis()).toEqual("Ps.1.1", "parsing: 'SAL 1:1'");
expect(p.parse("PS 1:1").osis()).toEqual("Ps.1.1", "parsing: 'PS 1:1'");
});
});
describe("Localized book Prov (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Prov (mq)", function() {
expect(p.parse("Proverbios 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Proverbios 1:1'");
expect(p.parse("Prov 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Prov 1:1'");
expect(p.parse("Pro 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Pro 1:1'");
p.include_apocrypha(false);
expect(p.parse("PROVERBIOS 1:1").osis()).toEqual("Prov.1.1", "parsing: 'PROVERBIOS 1:1'");
expect(p.parse("PROV 1:1").osis()).toEqual("Prov.1.1", "parsing: 'PROV 1:1'");
expect(p.parse("PRO 1:1").osis()).toEqual("Prov.1.1", "parsing: 'PRO 1:1'");
});
});
describe("Localized book Eccl (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Eccl (mq)", function() {
expect(p.parse("Eclesiast�s 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Eclesiast�s 1:1'");
expect(p.parse("Eccl 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Eccl 1:1'");
expect(p.parse("Ecl 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Ecl 1:1'");
p.include_apocrypha(false);
expect(p.parse("ECLESIAST�S 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'ECLESIAST�S 1:1'");
expect(p.parse("ECCL 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'ECCL 1:1'");
expect(p.parse("ECL 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'ECL 1:1'");
});
});
describe("Localized book Song (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Song (mq)", function() {
expect(p.parse("Cantar de los Cantares 1:1").osis()).toEqual("Song.1.1", "parsing: 'Cantar de los Cantares 1:1'");
expect(p.parse("Song 1:1").osis()).toEqual("Song.1.1", "parsing: 'Song 1:1'");
expect(p.parse("Can 1:1").osis()).toEqual("Song.1.1", "parsing: 'Can 1:1'");
p.include_apocrypha(false);
expect(p.parse("CANTAR DE LOS CANTARES 1:1").osis()).toEqual("Song.1.1", "parsing: 'CANTAR DE LOS CANTARES 1:1'");
expect(p.parse("SONG 1:1").osis()).toEqual("Song.1.1", "parsing: 'SONG 1:1'");
expect(p.parse("CAN 1:1").osis()).toEqual("Song.1.1", "parsing: 'CAN 1:1'");
});
});
describe("Localized book Jer (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Jer (mq)", function() {
expect(p.parse("Jerem�as 1:1").osis()).toEqual("Jer.1.1", "parsing: 'Jerem�as 1:1'");
expect(p.parse("Jer 1:1").osis()).toEqual("Jer.1.1", "parsing: 'Jer 1:1'");
p.include_apocrypha(false);
expect(p.parse("JEREM�AS 1:1").osis()).toEqual("Jer.1.1", "parsing: 'JEREM�AS 1:1'");
expect(p.parse("JER 1:1").osis()).toEqual("Jer.1.1", "parsing: 'JER 1:1'");
});
});
describe("Localized book Ezek (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Ezek (mq)", function() {
expect(p.parse("Ezequiel 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Ezequiel 1:1'");
expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Ezek 1:1'");
expect(p.parse("Eze 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Eze 1:1'");
p.include_apocrypha(false);
expect(p.parse("EZEQUIEL 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'EZEQUIEL 1:1'");
expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'EZEK 1:1'");
expect(p.parse("EZE 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'EZE 1:1'");
});
});
describe("Localized book Dan (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Dan (mq)", function() {
expect(p.parse("Daniel 1:1").osis()).toEqual("Dan.1.1", "parsing: 'Daniel 1:1'");
expect(p.parse("Dan 1:1").osis()).toEqual("Dan.1.1", "parsing: 'Dan 1:1'");
p.include_apocrypha(false);
expect(p.parse("DANIEL 1:1").osis()).toEqual("Dan.1.1", "parsing: 'DANIEL 1:1'");
expect(p.parse("DAN 1:1").osis()).toEqual("Dan.1.1", "parsing: 'DAN 1:1'");
});
});
describe("Localized book Hos (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Hos (mq)", function() {
expect(p.parse("Oseas 1:1").osis()).toEqual("Hos.1.1", "parsing: 'Oseas 1:1'");
expect(p.parse("Hos 1:1").osis()).toEqual("Hos.1.1", "parsing: 'Hos 1:1'");
expect(p.parse("Ose 1:1").osis()).toEqual("Hos.1.1", "parsing: 'Ose 1:1'");
p.include_apocrypha(false);
expect(p.parse("OSEAS 1:1").osis()).toEqual("Hos.1.1", "parsing: 'OSEAS 1:1'");
expect(p.parse("HOS 1:1").osis()).toEqual("Hos.1.1", "parsing: 'HOS 1:1'");
expect(p.parse("OSE 1:1").osis()).toEqual("Hos.1.1", "parsing: 'OSE 1:1'");
});
});
describe("Localized book Joel (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Joel (mq)", function() {
expect(p.parse("Joel 1:1").osis()).toEqual("Joel.1.1", "parsing: 'Joel 1:1'");
expect(p.parse("Joe 1:1").osis()).toEqual("Joel.1.1", "parsing: 'Joe 1:1'");
p.include_apocrypha(false);
expect(p.parse("JOEL 1:1").osis()).toEqual("Joel.1.1", "parsing: 'JOEL 1:1'");
expect(p.parse("JOE 1:1").osis()).toEqual("Joel.1.1", "parsing: 'JOE 1:1'");
});
});
describe("Localized book Amos (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Amos (mq)", function() {
expect(p.parse("Amos 1:1").osis()).toEqual("Amos.1.1", "parsing: 'Amos 1:1'");
expect(p.parse("Am�s 1:1").osis()).toEqual("Amos.1.1", "parsing: 'Am�s 1:1'");
expect(p.parse("Am� 1:1").osis()).toEqual("Amos.1.1", "parsing: 'Am� 1:1'");
p.include_apocrypha(false);
expect(p.parse("AMOS 1:1").osis()).toEqual("Amos.1.1", "parsing: 'AMOS 1:1'");
expect(p.parse("AM�S 1:1").osis()).toEqual("Amos.1.1", "parsing: 'AM�S 1:1'");
expect(p.parse("AM� 1:1").osis()).toEqual("Amos.1.1", "parsing: 'AM� 1:1'");
});
});
describe("Localized book Obad (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Obad (mq)", function() {
expect(p.parse("Abd�as 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Abd�as 1:1'");
expect(p.parse("Obad 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Obad 1:1'");
expect(p.parse("Abd 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Abd 1:1'");
p.include_apocrypha(false);
expect(p.parse("ABD�AS 1:1").osis()).toEqual("Obad.1.1", "parsing: 'ABD�AS 1:1'");
expect(p.parse("OBAD 1:1").osis()).toEqual("Obad.1.1", "parsing: 'OBAD 1:1'");
expect(p.parse("ABD 1:1").osis()).toEqual("Obad.1.1", "parsing: 'ABD 1:1'");
});
});
describe("Localized book Jonah (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Jonah (mq)", function() {
expect(p.parse("Jonah 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Jonah 1:1'");
expect(p.parse("Jon�s 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Jon�s 1:1'");
expect(p.parse("Jon 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Jon 1:1'");
p.include_apocrypha(false);
expect(p.parse("JONAH 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'JONAH 1:1'");
expect(p.parse("JON�S 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'JON�S 1:1'");
expect(p.parse("JON 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'JON 1:1'");
});
});
describe("Localized book Mic (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Mic (mq)", function() {
expect(p.parse("Miqueas 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Miqueas 1:1'");
expect(p.parse("Mic 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Mic 1:1'");
expect(p.parse("Miq 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Miq 1:1'");
p.include_apocrypha(false);
expect(p.parse("MIQUEAS 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MIQUEAS 1:1'");
expect(p.parse("MIC 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MIC 1:1'");
expect(p.parse("MIQ 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MIQ 1:1'");
});
});
describe("Localized book Nah (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Nah (mq)", function() {
expect(p.parse("Nah�m 1:1").osis()).toEqual("Nah.1.1", "parsing: 'Nah�m 1:1'");
expect(p.parse("Nah 1:1").osis()).toEqual("Nah.1.1", "parsing: 'Nah 1:1'");
p.include_apocrypha(false);
expect(p.parse("NAH�M 1:1").osis()).toEqual("Nah.1.1", "parsing: 'NAH�M 1:1'");
expect(p.parse("NAH 1:1").osis()).toEqual("Nah.1.1", "parsing: 'NAH 1:1'");
});
});
describe("Localized book Hab (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Hab (mq)", function() {
expect(p.parse("Habacuc 1:1").osis()).toEqual("Hab.1.1", "parsing: 'Habacuc 1:1'");
expect(p.parse("Hab 1:1").osis()).toEqual("Hab.1.1", "parsing: 'Hab 1:1'");
p.include_apocrypha(false);
expect(p.parse("HABACUC 1:1").osis()).toEqual("Hab.1.1", "parsing: 'HABACUC 1:1'");
expect(p.parse("HAB 1:1").osis()).toEqual("Hab.1.1", "parsing: 'HAB 1:1'");
});
});
describe("Localized book Zeph (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Zeph (mq)", function() {
expect(p.parse("Sofon�as 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Sofon�as 1:1'");
expect(p.parse("Zeph 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Zeph 1:1'");
expect(p.parse("Sof 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Sof 1:1'");
p.include_apocrypha(false);
expect(p.parse("SOFON�AS 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'SOFON�AS 1:1'");
expect(p.parse("ZEPH 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'ZEPH 1:1'");
expect(p.parse("SOF 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'SOF 1:1'");
});
});
describe("Localized book Hag (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Hag (mq)", function() {
expect(p.parse("Hageo 1:1").osis()).toEqual("Hag.1.1", "parsing: 'Hageo 1:1'");
expect(p.parse("Hag 1:1").osis()).toEqual("Hag.1.1", "parsing: 'Hag 1:1'");
p.include_apocrypha(false);
expect(p.parse("HAGEO 1:1").osis()).toEqual("Hag.1.1", "parsing: 'HAGEO 1:1'");
expect(p.parse("HAG 1:1").osis()).toEqual("Hag.1.1", "parsing: 'HAG 1:1'");
});
});
describe("Localized book Zech (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Zech (mq)", function() {
expect(p.parse("Zacar�as 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Zacar�as 1:1'");
expect(p.parse("Zech 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Zech 1:1'");
expect(p.parse("Zac 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Zac 1:1'");
p.include_apocrypha(false);
expect(p.parse("ZACAR�AS 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZACAR�AS 1:1'");
expect(p.parse("ZECH 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZECH 1:1'");
expect(p.parse("ZAC 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZAC 1:1'");
});
});
describe("Localized book Mal (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Mal (mq)", function() {
expect(p.parse("Malaqu�as 1:1").osis()).toEqual("Mal.1.1", "parsing: 'Malaqu�as 1:1'");
expect(p.parse("Mal 1:1").osis()).toEqual("Mal.1.1", "parsing: 'Mal 1:1'");
p.include_apocrypha(false);
expect(p.parse("MALAQU�AS 1:1").osis()).toEqual("Mal.1.1", "parsing: 'MALAQU�AS 1:1'");
expect(p.parse("MAL 1:1").osis()).toEqual("Mal.1.1", "parsing: 'MAL 1:1'");
});
});
describe("Localized book Matt (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Matt (mq)", function() {
expect(p.parse("Mateo 1:1").osis()).toEqual("Matt.1.1", "parsing: 'Mateo 1:1'");
expect(p.parse("Matt 1:1").osis()).toEqual("Matt.1.1", "parsing: 'Matt 1:1'");
expect(p.parse("Mat 1:1").osis()).toEqual("Matt.1.1", "parsing: 'Mat 1:1'");
p.include_apocrypha(false);
expect(p.parse("MATEO 1:1").osis()).toEqual("Matt.1.1", "parsing: 'MATEO 1:1'");
expect(p.parse("MATT 1:1").osis()).toEqual("Matt.1.1", "parsing: 'MATT 1:1'");
expect(p.parse("MAT 1:1").osis()).toEqual("Matt.1.1", "parsing: 'MAT 1:1'");
});
});
describe("Localized book Mark (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Mark (mq)", function() {
expect(p.parse("Marcos 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Marcos 1:1'");
expect(p.parse("Mark 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Mark 1:1'");
expect(p.parse("Mar 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Mar 1:1'");
p.include_apocrypha(false);
expect(p.parse("MARCOS 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MARCOS 1:1'");
expect(p.parse("MARK 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MARK 1:1'");
expect(p.parse("MAR 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MAR 1:1'");
});
});
describe("Localized book Luke (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: Luke (mq)", function() {
expect(p.parse("Lucas 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Lucas 1:1'");
expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Luke 1:1'");
expect(p.parse("Luc 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Luc 1:1'");
p.include_apocrypha(false);
expect(p.parse("LUCAS 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUCAS 1:1'");
expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUKE 1:1'");
expect(p.parse("LUC 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUC 1:1'");
});
});
describe("Localized book 1John (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 1John (mq)", function() {
expect(p.parse("1. Juan 1:1").osis()).toEqual("1John.1.1", "parsing: '1. Juan 1:1'");
expect(p.parse("1 Juan 1:1").osis()).toEqual("1John.1.1", "parsing: '1 Juan 1:1'");
expect(p.parse("1. Ju 1:1").osis()).toEqual("1John.1.1", "parsing: '1. Ju 1:1'");
expect(p.parse("1John 1:1").osis()).toEqual("1John.1.1", "parsing: '1John 1:1'");
expect(p.parse("1 Ju 1:1").osis()).toEqual("1John.1.1", "parsing: '1 Ju 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. JUAN 1:1").osis()).toEqual("1John.1.1", "parsing: '1. JUAN 1:1'");
expect(p.parse("1 JUAN 1:1").osis()).toEqual("1John.1.1", "parsing: '1 JUAN 1:1'");
expect(p.parse("1. JU 1:1").osis()).toEqual("1John.1.1", "parsing: '1. JU 1:1'");
expect(p.parse("1JOHN 1:1").osis()).toEqual("1John.1.1", "parsing: '1JOHN 1:1'");
expect(p.parse("1 JU 1:1").osis()).toEqual("1John.1.1", "parsing: '1 JU 1:1'");
});
});
describe("Localized book 2John (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 2John (mq)", function() {
expect(p.parse("2. Juan 1:1").osis()).toEqual("2John.1.1", "parsing: '2. Juan 1:1'");
expect(p.parse("2 Juan 1:1").osis()).toEqual("2John.1.1", "parsing: '2 Juan 1:1'");
expect(p.parse("2. Ju 1:1").osis()).toEqual("2John.1.1", "parsing: '2. Ju 1:1'");
expect(p.parse("2John 1:1").osis()).toEqual("2John.1.1", "parsing: '2John 1:1'");
expect(p.parse("2 Ju 1:1").osis()).toEqual("2John.1.1", "parsing: '2 Ju 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. JUAN 1:1").osis()).toEqual("2John.1.1", "parsing: '2. JUAN 1:1'");
expect(p.parse("2 JUAN 1:1").osis()).toEqual("2John.1.1", "parsing: '2 JUAN 1:1'");
expect(p.parse("2. JU 1:1").osis()).toEqual("2John.1.1", "parsing: '2. JU 1:1'");
expect(p.parse("2JOHN 1:1").osis()).toEqual("2John.1.1", "parsing: '2JOHN 1:1'");
expect(p.parse("2 JU 1:1").osis()).toEqual("2John.1.1", "parsing: '2 JU 1:1'");
});
});
describe("Localized book 3John (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: 3John (mq)", function() {
expect(p.parse("3. Juan 1:1").osis()).toEqual("3John.1.1", "parsing: '3. Juan 1:1'");
expect(p.parse("3 Juan 1:1").osis()).toEqual("3John.1.1", "parsing: '3 Juan 1:1'");
expect(p.parse("3. Ju 1:1").osis()).toEqual("3John.1.1", "parsing: '3. Ju 1:1'");
expect(p.parse("3John 1:1").osis()).toEqual("3John.1.1", "parsing: '3John 1:1'");
expect(p.parse("3 Ju 1:1").osis()).toEqual("3John.1.1", "parsing: '3 Ju 1:1'");
p.include_apocrypha(false);
expect(p.parse("3. JUAN 1:1").osis()).toEqual("3John.1.1", "parsing: '3. JUAN 1:1'");
expect(p.parse("3 JUAN 1:1").osis()).toEqual("3John.1.1", "parsing: '3 JUAN 1:1'");
expect(p.parse("3. JU 1:1").osis()).toEqual("3John.1.1", "parsing: '3. JU 1:1'");
expect(p.parse("3JOHN 1:1").osis()).toEqual("3John.1.1", "parsing: '3JOHN 1:1'");
expect(p.parse("3 JU 1:1").osis()).toEqual("3John.1.1", "parsing: '3 JU 1:1'");
});
});
describe("Localized book John (mq)", function() {
var p;
p = {};
beforeEach(function() {
p = new bcv_parser();
p.set_options({
book_alone_strategy: "ignore",
book_sequence_strategy: "ignore",
osis_compaction_strategy: "bc",
captive_end_digits_strategy: "delete"
});
p.include_apocrypha(true);
});
it("should handle book: John (mq)", function() {
expect(p.parse("John 1:1").osis()).toEqual("John.1.1", "parsing: 'John 1:1'");
expect(p.parse("Juan 1:1").osis()).toEqual("John.1.1", "parsing: 'Juan 1:1'");
expect(p.parse("Jua 1:1").osis()).toEqual("John.1.1", "parsing: 'Jua 1:1'");
p.include_apocrypha(false);
expect(p.parse("JOHN 1:1").osis()).toEqual("