bible-ref-parse
Version:
Identifies and parses Bible references (like John 3:16) in over 40 languages.
1,758 lines • 75.9 kB
JavaScript
(function() {
var bcv_parser;
bcv_parser = require("../../dist/id-bcv-parser.js").bcv_parser;
describe("Parsing (id)", 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 (id)", 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 (id)", function() {
expect(p.parse("Kejadian 1:1").osis()).toEqual("Gen.1.1", "parsing: 'Kejadian 1:1'");
expect(p.parse("Gen 1:1").osis()).toEqual("Gen.1.1", "parsing: 'Gen 1:1'");
expect(p.parse("Kej 1:1").osis()).toEqual("Gen.1.1", "parsing: 'Kej 1:1'");
p.include_apocrypha(false);
expect(p.parse("KEJADIAN 1:1").osis()).toEqual("Gen.1.1", "parsing: 'KEJADIAN 1:1'");
expect(p.parse("GEN 1:1").osis()).toEqual("Gen.1.1", "parsing: 'GEN 1:1'");
expect(p.parse("KEJ 1:1").osis()).toEqual("Gen.1.1", "parsing: 'KEJ 1:1'");
});
});
describe("Localized book Exod (id)", 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 (id)", function() {
expect(p.parse("Keluaran 1:1").osis()).toEqual("Exod.1.1", "parsing: 'Keluaran 1:1'");
expect(p.parse("Exod 1:1").osis()).toEqual("Exod.1.1", "parsing: 'Exod 1:1'");
expect(p.parse("Kel 1:1").osis()).toEqual("Exod.1.1", "parsing: 'Kel 1:1'");
p.include_apocrypha(false);
expect(p.parse("KELUARAN 1:1").osis()).toEqual("Exod.1.1", "parsing: 'KELUARAN 1:1'");
expect(p.parse("EXOD 1:1").osis()).toEqual("Exod.1.1", "parsing: 'EXOD 1:1'");
expect(p.parse("KEL 1:1").osis()).toEqual("Exod.1.1", "parsing: 'KEL 1:1'");
});
});
describe("Localized book Lev (id)", 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 (id)", function() {
expect(p.parse("Imamat 1:1").osis()).toEqual("Lev.1.1", "parsing: 'Imamat 1:1'");
expect(p.parse("Lev 1:1").osis()).toEqual("Lev.1.1", "parsing: 'Lev 1:1'");
expect(p.parse("Im 1:1").osis()).toEqual("Lev.1.1", "parsing: 'Im 1:1'");
p.include_apocrypha(false);
expect(p.parse("IMAMAT 1:1").osis()).toEqual("Lev.1.1", "parsing: 'IMAMAT 1:1'");
expect(p.parse("LEV 1:1").osis()).toEqual("Lev.1.1", "parsing: 'LEV 1:1'");
expect(p.parse("IM 1:1").osis()).toEqual("Lev.1.1", "parsing: 'IM 1:1'");
});
});
describe("Localized book Num (id)", 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 (id)", function() {
expect(p.parse("Bilangan 1:1").osis()).toEqual("Num.1.1", "parsing: 'Bilangan 1:1'");
expect(p.parse("Bil 1:1").osis()).toEqual("Num.1.1", "parsing: 'Bil 1:1'");
expect(p.parse("Num 1:1").osis()).toEqual("Num.1.1", "parsing: 'Num 1:1'");
p.include_apocrypha(false);
expect(p.parse("BILANGAN 1:1").osis()).toEqual("Num.1.1", "parsing: 'BILANGAN 1:1'");
expect(p.parse("BIL 1:1").osis()).toEqual("Num.1.1", "parsing: 'BIL 1:1'");
expect(p.parse("NUM 1:1").osis()).toEqual("Num.1.1", "parsing: 'NUM 1:1'");
});
});
describe("Localized book Lam (id)", 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 (id)", function() {
expect(p.parse("Ratapan 1:1").osis()).toEqual("Lam.1.1", "parsing: 'Ratapan 1:1'");
expect(p.parse("Lam 1:1").osis()).toEqual("Lam.1.1", "parsing: 'Lam 1:1'");
expect(p.parse("Rat 1:1").osis()).toEqual("Lam.1.1", "parsing: 'Rat 1:1'");
p.include_apocrypha(false);
expect(p.parse("RATAPAN 1:1").osis()).toEqual("Lam.1.1", "parsing: 'RATAPAN 1:1'");
expect(p.parse("LAM 1:1").osis()).toEqual("Lam.1.1", "parsing: 'LAM 1:1'");
expect(p.parse("RAT 1:1").osis()).toEqual("Lam.1.1", "parsing: 'RAT 1:1'");
});
});
describe("Localized book Rev (id)", 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 (id)", function() {
expect(p.parse("Wahyu 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Wahyu 1:1'");
expect(p.parse("Rev 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Rev 1:1'");
expect(p.parse("Why 1:1").osis()).toEqual("Rev.1.1", "parsing: 'Why 1:1'");
p.include_apocrypha(false);
expect(p.parse("WAHYU 1:1").osis()).toEqual("Rev.1.1", "parsing: 'WAHYU 1:1'");
expect(p.parse("REV 1:1").osis()).toEqual("Rev.1.1", "parsing: 'REV 1:1'");
expect(p.parse("WHY 1:1").osis()).toEqual("Rev.1.1", "parsing: 'WHY 1:1'");
});
});
describe("Localized book Deut (id)", 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 (id)", function() {
expect(p.parse("Ulangan 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Ulangan 1:1'");
expect(p.parse("Deut 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Deut 1:1'");
expect(p.parse("Ul 1:1").osis()).toEqual("Deut.1.1", "parsing: 'Ul 1:1'");
p.include_apocrypha(false);
expect(p.parse("ULANGAN 1:1").osis()).toEqual("Deut.1.1", "parsing: 'ULANGAN 1:1'");
expect(p.parse("DEUT 1:1").osis()).toEqual("Deut.1.1", "parsing: 'DEUT 1:1'");
expect(p.parse("UL 1:1").osis()).toEqual("Deut.1.1", "parsing: 'UL 1:1'");
});
});
describe("Localized book Josh (id)", 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 (id)", function() {
expect(p.parse("Yosua 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Yosua 1:1'");
expect(p.parse("Josh 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Josh 1:1'");
expect(p.parse("Yos 1:1").osis()).toEqual("Josh.1.1", "parsing: 'Yos 1:1'");
p.include_apocrypha(false);
expect(p.parse("YOSUA 1:1").osis()).toEqual("Josh.1.1", "parsing: 'YOSUA 1:1'");
expect(p.parse("JOSH 1:1").osis()).toEqual("Josh.1.1", "parsing: 'JOSH 1:1'");
expect(p.parse("YOS 1:1").osis()).toEqual("Josh.1.1", "parsing: 'YOS 1:1'");
});
});
describe("Localized book Judg (id)", 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 (id)", function() {
expect(p.parse("Hakim hakim 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Hakim hakim 1:1'");
expect(p.parse("Judg 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Judg 1:1'");
expect(p.parse("Hak 1:1").osis()).toEqual("Judg.1.1", "parsing: 'Hak 1:1'");
p.include_apocrypha(false);
expect(p.parse("HAKIM HAKIM 1:1").osis()).toEqual("Judg.1.1", "parsing: 'HAKIM HAKIM 1:1'");
expect(p.parse("JUDG 1:1").osis()).toEqual("Judg.1.1", "parsing: 'JUDG 1:1'");
expect(p.parse("HAK 1:1").osis()).toEqual("Judg.1.1", "parsing: 'HAK 1:1'");
});
});
describe("Localized book Ruth (id)", 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 (id)", 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 (id)", 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 (id)", function() {
expect(p.parse("Yesaya 1:1").osis()).toEqual("Isa.1.1", "parsing: 'Yesaya 1:1'");
expect(p.parse("Isa 1:1").osis()).toEqual("Isa.1.1", "parsing: 'Isa 1:1'");
expect(p.parse("Yes 1:1").osis()).toEqual("Isa.1.1", "parsing: 'Yes 1:1'");
p.include_apocrypha(false);
expect(p.parse("YESAYA 1:1").osis()).toEqual("Isa.1.1", "parsing: 'YESAYA 1:1'");
expect(p.parse("ISA 1:1").osis()).toEqual("Isa.1.1", "parsing: 'ISA 1:1'");
expect(p.parse("YES 1:1").osis()).toEqual("Isa.1.1", "parsing: 'YES 1:1'");
});
});
describe("Localized book 2Sam (id)", 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 (id)", 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. Sam 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. Sam 1:1'");
expect(p.parse("2 Sam 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 Sam 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. SAM 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2. SAM 1:1'");
expect(p.parse("2 SAM 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2 SAM 1:1'");
expect(p.parse("2SAM 1:1").osis()).toEqual("2Sam.1.1", "parsing: '2SAM 1:1'");
});
});
describe("Localized book 1Sam (id)", 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 (id)", 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. Sam 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. Sam 1:1'");
expect(p.parse("1 Sam 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 Sam 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. SAM 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1. SAM 1:1'");
expect(p.parse("1 SAM 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1 SAM 1:1'");
expect(p.parse("1SAM 1:1").osis()).toEqual("1Sam.1.1", "parsing: '1SAM 1:1'");
});
});
describe("Localized book 2Kgs (id)", 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 (id)", function() {
expect(p.parse("2. Raja raja 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. Raja raja 1:1'");
expect(p.parse("2 Raja raja 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 Raja raja 1:1'");
expect(p.parse("2. Raj 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. Raj 1:1'");
expect(p.parse("2 Raj 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 Raj 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. RAJA RAJA 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. RAJA RAJA 1:1'");
expect(p.parse("2 RAJA RAJA 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 RAJA RAJA 1:1'");
expect(p.parse("2. RAJ 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2. RAJ 1:1'");
expect(p.parse("2 RAJ 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2 RAJ 1:1'");
expect(p.parse("2KGS 1:1").osis()).toEqual("2Kgs.1.1", "parsing: '2KGS 1:1'");
});
});
describe("Localized book 1Kgs (id)", 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 (id)", function() {
expect(p.parse("1. Raja raja 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. Raja raja 1:1'");
expect(p.parse("1 Raja raja 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 Raja raja 1:1'");
expect(p.parse("1. Raj 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. Raj 1:1'");
expect(p.parse("1 Raj 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 Raj 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. RAJA RAJA 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. RAJA RAJA 1:1'");
expect(p.parse("1 RAJA RAJA 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 RAJA RAJA 1:1'");
expect(p.parse("1. RAJ 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1. RAJ 1:1'");
expect(p.parse("1 RAJ 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1 RAJ 1:1'");
expect(p.parse("1KGS 1:1").osis()).toEqual("1Kgs.1.1", "parsing: '1KGS 1:1'");
});
});
describe("Localized book 2Chr (id)", 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 (id)", function() {
expect(p.parse("2. Tawarikh 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. Tawarikh 1:1'");
expect(p.parse("2 Tawarikh 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 Tawarikh 1:1'");
expect(p.parse("2. Taw 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. Taw 1:1'");
expect(p.parse("2 Taw 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 Taw 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. TAWARIKH 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. TAWARIKH 1:1'");
expect(p.parse("2 TAWARIKH 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 TAWARIKH 1:1'");
expect(p.parse("2. TAW 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2. TAW 1:1'");
expect(p.parse("2 TAW 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2 TAW 1:1'");
expect(p.parse("2CHR 1:1").osis()).toEqual("2Chr.1.1", "parsing: '2CHR 1:1'");
});
});
describe("Localized book 1Chr (id)", 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 (id)", function() {
expect(p.parse("1. Tawarikh 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. Tawarikh 1:1'");
expect(p.parse("1 Tawarikh 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 Tawarikh 1:1'");
expect(p.parse("1. Taw 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. Taw 1:1'");
expect(p.parse("1 Taw 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 Taw 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. TAWARIKH 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. TAWARIKH 1:1'");
expect(p.parse("1 TAWARIKH 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 TAWARIKH 1:1'");
expect(p.parse("1. TAW 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1. TAW 1:1'");
expect(p.parse("1 TAW 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1 TAW 1:1'");
expect(p.parse("1CHR 1:1").osis()).toEqual("1Chr.1.1", "parsing: '1CHR 1:1'");
});
});
describe("Localized book Ezra (id)", 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 (id)", function() {
expect(p.parse("Ezra 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'Ezra 1:1'");
expect(p.parse("Ezr 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'Ezr 1:1'");
p.include_apocrypha(false);
expect(p.parse("EZRA 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'EZRA 1:1'");
expect(p.parse("EZR 1:1").osis()).toEqual("Ezra.1.1", "parsing: 'EZR 1:1'");
});
});
describe("Localized book Neh (id)", 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 (id)", function() {
expect(p.parse("Nehemia 1:1").osis()).toEqual("Neh.1.1", "parsing: 'Nehemia 1:1'");
expect(p.parse("Neh 1:1").osis()).toEqual("Neh.1.1", "parsing: 'Neh 1:1'");
p.include_apocrypha(false);
expect(p.parse("NEHEMIA 1:1").osis()).toEqual("Neh.1.1", "parsing: 'NEHEMIA 1:1'");
expect(p.parse("NEH 1:1").osis()).toEqual("Neh.1.1", "parsing: 'NEH 1:1'");
});
});
describe("Localized book Esth (id)", 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 (id)", 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 (id)", 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 (id)", function() {
expect(p.parse("Ayub 1:1").osis()).toEqual("Job.1.1", "parsing: 'Ayub 1:1'");
expect(p.parse("Ayb 1:1").osis()).toEqual("Job.1.1", "parsing: 'Ayb 1:1'");
expect(p.parse("Job 1:1").osis()).toEqual("Job.1.1", "parsing: 'Job 1:1'");
p.include_apocrypha(false);
expect(p.parse("AYUB 1:1").osis()).toEqual("Job.1.1", "parsing: 'AYUB 1:1'");
expect(p.parse("AYB 1:1").osis()).toEqual("Job.1.1", "parsing: 'AYB 1:1'");
expect(p.parse("JOB 1:1").osis()).toEqual("Job.1.1", "parsing: 'JOB 1:1'");
});
});
describe("Localized book Ps (id)", 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 (id)", function() {
expect(p.parse("Mazmur 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Mazmur 1:1'");
expect(p.parse("Mzm 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Mzm 1:1'");
expect(p.parse("Ps 1:1").osis()).toEqual("Ps.1.1", "parsing: 'Ps 1:1'");
p.include_apocrypha(false);
expect(p.parse("MAZMUR 1:1").osis()).toEqual("Ps.1.1", "parsing: 'MAZMUR 1:1'");
expect(p.parse("MZM 1:1").osis()).toEqual("Ps.1.1", "parsing: 'MZM 1:1'");
expect(p.parse("PS 1:1").osis()).toEqual("Ps.1.1", "parsing: 'PS 1:1'");
});
});
describe("Localized book Prov (id)", 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 (id)", function() {
expect(p.parse("Amsal 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Amsal 1:1'");
expect(p.parse("Prov 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Prov 1:1'");
expect(p.parse("Ams 1:1").osis()).toEqual("Prov.1.1", "parsing: 'Ams 1:1'");
p.include_apocrypha(false);
expect(p.parse("AMSAL 1:1").osis()).toEqual("Prov.1.1", "parsing: 'AMSAL 1:1'");
expect(p.parse("PROV 1:1").osis()).toEqual("Prov.1.1", "parsing: 'PROV 1:1'");
expect(p.parse("AMS 1:1").osis()).toEqual("Prov.1.1", "parsing: 'AMS 1:1'");
});
});
describe("Localized book Eccl (id)", 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 (id)", function() {
expect(p.parse("Pengkhotbah 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Pengkhotbah 1:1'");
expect(p.parse("Eccl 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Eccl 1:1'");
expect(p.parse("Pkh 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'Pkh 1:1'");
p.include_apocrypha(false);
expect(p.parse("PENGKHOTBAH 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'PENGKHOTBAH 1:1'");
expect(p.parse("ECCL 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'ECCL 1:1'");
expect(p.parse("PKH 1:1").osis()).toEqual("Eccl.1.1", "parsing: 'PKH 1:1'");
});
});
describe("Localized book Song (id)", 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 (id)", function() {
expect(p.parse("Kidung Agung 1:1").osis()).toEqual("Song.1.1", "parsing: 'Kidung Agung 1:1'");
expect(p.parse("Song 1:1").osis()).toEqual("Song.1.1", "parsing: 'Song 1:1'");
expect(p.parse("Kid 1:1").osis()).toEqual("Song.1.1", "parsing: 'Kid 1:1'");
p.include_apocrypha(false);
expect(p.parse("KIDUNG AGUNG 1:1").osis()).toEqual("Song.1.1", "parsing: 'KIDUNG AGUNG 1:1'");
expect(p.parse("SONG 1:1").osis()).toEqual("Song.1.1", "parsing: 'SONG 1:1'");
expect(p.parse("KID 1:1").osis()).toEqual("Song.1.1", "parsing: 'KID 1:1'");
});
});
describe("Localized book Jer (id)", 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 (id)", function() {
expect(p.parse("Yeremia 1:1").osis()).toEqual("Jer.1.1", "parsing: 'Yeremia 1:1'");
expect(p.parse("Jer 1:1").osis()).toEqual("Jer.1.1", "parsing: 'Jer 1:1'");
expect(p.parse("Yer 1:1").osis()).toEqual("Jer.1.1", "parsing: 'Yer 1:1'");
p.include_apocrypha(false);
expect(p.parse("YEREMIA 1:1").osis()).toEqual("Jer.1.1", "parsing: 'YEREMIA 1:1'");
expect(p.parse("JER 1:1").osis()).toEqual("Jer.1.1", "parsing: 'JER 1:1'");
expect(p.parse("YER 1:1").osis()).toEqual("Jer.1.1", "parsing: 'YER 1:1'");
});
});
describe("Localized book Ezek (id)", 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 (id)", function() {
expect(p.parse("Yehezkiel 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Yehezkiel 1:1'");
expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Ezek 1:1'");
expect(p.parse("Yeh 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'Yeh 1:1'");
p.include_apocrypha(false);
expect(p.parse("YEHEZKIEL 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'YEHEZKIEL 1:1'");
expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'EZEK 1:1'");
expect(p.parse("YEH 1:1").osis()).toEqual("Ezek.1.1", "parsing: 'YEH 1:1'");
});
});
describe("Localized book Dan (id)", 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 (id)", 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 (id)", 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 (id)", function() {
expect(p.parse("Hosea 1:1").osis()).toEqual("Hos.1.1", "parsing: 'Hosea 1:1'");
expect(p.parse("Hos 1:1").osis()).toEqual("Hos.1.1", "parsing: 'Hos 1:1'");
p.include_apocrypha(false);
expect(p.parse("HOSEA 1:1").osis()).toEqual("Hos.1.1", "parsing: 'HOSEA 1:1'");
expect(p.parse("HOS 1:1").osis()).toEqual("Hos.1.1", "parsing: 'HOS 1:1'");
});
});
describe("Localized book Joel (id)", 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 (id)", function() {
expect(p.parse("Kejadian 1:1").osis()).toEqual("Joel.1.1", "parsing: 'Kejadian 1:1'");
expect(p.parse("Joel 1:1").osis()).toEqual("Joel.1.1", "parsing: 'Joel 1:1'");
expect(p.parse("Yl 1:1").osis()).toEqual("Joel.1.1", "parsing: 'Yl 1:1'");
p.include_apocrypha(false);
expect(p.parse("KEJADIAN 1:1").osis()).toEqual("Joel.1.1", "parsing: 'KEJADIAN 1:1'");
expect(p.parse("JOEL 1:1").osis()).toEqual("Joel.1.1", "parsing: 'JOEL 1:1'");
expect(p.parse("YL 1:1").osis()).toEqual("Joel.1.1", "parsing: 'YL 1:1'");
});
});
describe("Localized book Amos (id)", 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 (id)", function() {
expect(p.parse("Amos 1:1").osis()).toEqual("Amos.1.1", "parsing: 'Amos 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 1:1").osis()).toEqual("Amos.1.1", "parsing: 'AM 1:1'");
});
});
describe("Localized book Obad (id)", 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 (id)", function() {
expect(p.parse("Obaja 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Obaja 1:1'");
expect(p.parse("Obad 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Obad 1:1'");
expect(p.parse("Ob 1:1").osis()).toEqual("Obad.1.1", "parsing: 'Ob 1:1'");
p.include_apocrypha(false);
expect(p.parse("OBAJA 1:1").osis()).toEqual("Obad.1.1", "parsing: 'OBAJA 1:1'");
expect(p.parse("OBAD 1:1").osis()).toEqual("Obad.1.1", "parsing: 'OBAD 1:1'");
expect(p.parse("OB 1:1").osis()).toEqual("Obad.1.1", "parsing: 'OB 1:1'");
});
});
describe("Localized book Jonah (id)", 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 (id)", function() {
expect(p.parse("Jonah 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Jonah 1:1'");
expect(p.parse("Yunus 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Yunus 1:1'");
expect(p.parse("Yun 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'Yun 1:1'");
p.include_apocrypha(false);
expect(p.parse("JONAH 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'JONAH 1:1'");
expect(p.parse("YUNUS 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'YUNUS 1:1'");
expect(p.parse("YUN 1:1").osis()).toEqual("Jonah.1.1", "parsing: 'YUN 1:1'");
});
});
describe("Localized book Mic (id)", 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 (id)", function() {
expect(p.parse("Mikha 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Mikha 1:1'");
expect(p.parse("Mic 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Mic 1:1'");
expect(p.parse("Mi 1:1").osis()).toEqual("Mic.1.1", "parsing: 'Mi 1:1'");
p.include_apocrypha(false);
expect(p.parse("MIKHA 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MIKHA 1:1'");
expect(p.parse("MIC 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MIC 1:1'");
expect(p.parse("MI 1:1").osis()).toEqual("Mic.1.1", "parsing: 'MI 1:1'");
});
});
describe("Localized book Nah (id)", 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 (id)", function() {
expect(p.parse("Nahum 1:1").osis()).toEqual("Nah.1.1", "parsing: 'Nahum 1:1'");
expect(p.parse("Nah 1:1").osis()).toEqual("Nah.1.1", "parsing: 'Nah 1:1'");
p.include_apocrypha(false);
expect(p.parse("NAHUM 1:1").osis()).toEqual("Nah.1.1", "parsing: 'NAHUM 1:1'");
expect(p.parse("NAH 1:1").osis()).toEqual("Nah.1.1", "parsing: 'NAH 1:1'");
});
});
describe("Localized book Hab (id)", 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 (id)", function() {
expect(p.parse("Habakuk 1:1").osis()).toEqual("Hab.1.1", "parsing: 'Habakuk 1:1'");
expect(p.parse("Hab 1:1").osis()).toEqual("Hab.1.1", "parsing: 'Hab 1:1'");
p.include_apocrypha(false);
expect(p.parse("HABAKUK 1:1").osis()).toEqual("Hab.1.1", "parsing: 'HABAKUK 1:1'");
expect(p.parse("HAB 1:1").osis()).toEqual("Hab.1.1", "parsing: 'HAB 1:1'");
});
});
describe("Localized book Zeph (id)", 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 (id)", function() {
expect(p.parse("Zefanya 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Zefanya 1:1'");
expect(p.parse("Zeph 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Zeph 1:1'");
expect(p.parse("Zef 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'Zef 1:1'");
p.include_apocrypha(false);
expect(p.parse("ZEFANYA 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'ZEFANYA 1:1'");
expect(p.parse("ZEPH 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'ZEPH 1:1'");
expect(p.parse("ZEF 1:1").osis()).toEqual("Zeph.1.1", "parsing: 'ZEF 1:1'");
});
});
describe("Localized book Hag (id)", 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 (id)", function() {
expect(p.parse("Hagai 1:1").osis()).toEqual("Hag.1.1", "parsing: 'Hagai 1:1'");
expect(p.parse("Hag 1:1").osis()).toEqual("Hag.1.1", "parsing: 'Hag 1:1'");
p.include_apocrypha(false);
expect(p.parse("HAGAI 1:1").osis()).toEqual("Hag.1.1", "parsing: 'HAGAI 1:1'");
expect(p.parse("HAG 1:1").osis()).toEqual("Hag.1.1", "parsing: 'HAG 1:1'");
});
});
describe("Localized book Zech (id)", 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 (id)", function() {
expect(p.parse("Zakharia 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Zakharia 1:1'");
expect(p.parse("Zech 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Zech 1:1'");
expect(p.parse("Za 1:1").osis()).toEqual("Zech.1.1", "parsing: 'Za 1:1'");
p.include_apocrypha(false);
expect(p.parse("ZAKHARIA 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZAKHARIA 1:1'");
expect(p.parse("ZECH 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZECH 1:1'");
expect(p.parse("ZA 1:1").osis()).toEqual("Zech.1.1", "parsing: 'ZA 1:1'");
});
});
describe("Localized book Mal (id)", 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 (id)", function() {
expect(p.parse("Maleakhi 1:1").osis()).toEqual("Mal.1.1", "parsing: 'Maleakhi 1:1'");
expect(p.parse("Mal 1:1").osis()).toEqual("Mal.1.1", "parsing: 'Mal 1:1'");
p.include_apocrypha(false);
expect(p.parse("MALEAKHI 1:1").osis()).toEqual("Mal.1.1", "parsing: 'MALEAKHI 1:1'");
expect(p.parse("MAL 1:1").osis()).toEqual("Mal.1.1", "parsing: 'MAL 1:1'");
});
});
describe("Localized book Matt (id)", 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 (id)", function() {
expect(p.parse("Matius 1:1").osis()).toEqual("Matt.1.1", "parsing: 'Matius 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("MATIUS 1:1").osis()).toEqual("Matt.1.1", "parsing: 'MATIUS 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 (id)", 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 (id)", function() {
expect(p.parse("Markus 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Markus 1:1'");
expect(p.parse("Mark 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Mark 1:1'");
expect(p.parse("Mrk 1:1").osis()).toEqual("Mark.1.1", "parsing: 'Mrk 1:1'");
p.include_apocrypha(false);
expect(p.parse("MARKUS 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MARKUS 1:1'");
expect(p.parse("MARK 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MARK 1:1'");
expect(p.parse("MRK 1:1").osis()).toEqual("Mark.1.1", "parsing: 'MRK 1:1'");
});
});
describe("Localized book Luke (id)", 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 (id)", function() {
expect(p.parse("Lukas 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Lukas 1:1'");
expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Luke 1:1'");
expect(p.parse("Luk 1:1").osis()).toEqual("Luke.1.1", "parsing: 'Luk 1:1'");
p.include_apocrypha(false);
expect(p.parse("LUKAS 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUKAS 1:1'");
expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUKE 1:1'");
expect(p.parse("LUK 1:1").osis()).toEqual("Luke.1.1", "parsing: 'LUK 1:1'");
});
});
describe("Localized book 1John (id)", 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 (id)", function() {
expect(p.parse("1. Yohanes 1:1").osis()).toEqual("1John.1.1", "parsing: '1. Yohanes 1:1'");
expect(p.parse("1 Yohanes 1:1").osis()).toEqual("1John.1.1", "parsing: '1 Yohanes 1:1'");
expect(p.parse("1. Yoh 1:1").osis()).toEqual("1John.1.1", "parsing: '1. Yoh 1:1'");
expect(p.parse("1 Yoh 1:1").osis()).toEqual("1John.1.1", "parsing: '1 Yoh 1:1'");
expect(p.parse("1John 1:1").osis()).toEqual("1John.1.1", "parsing: '1John 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. YOHANES 1:1").osis()).toEqual("1John.1.1", "parsing: '1. YOHANES 1:1'");
expect(p.parse("1 YOHANES 1:1").osis()).toEqual("1John.1.1", "parsing: '1 YOHANES 1:1'");
expect(p.parse("1. YOH 1:1").osis()).toEqual("1John.1.1", "parsing: '1. YOH 1:1'");
expect(p.parse("1 YOH 1:1").osis()).toEqual("1John.1.1", "parsing: '1 YOH 1:1'");
expect(p.parse("1JOHN 1:1").osis()).toEqual("1John.1.1", "parsing: '1JOHN 1:1'");
});
});
describe("Localized book 2John (id)", 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 (id)", function() {
expect(p.parse("2. Yohanes 1:1").osis()).toEqual("2John.1.1", "parsing: '2. Yohanes 1:1'");
expect(p.parse("2 Yohanes 1:1").osis()).toEqual("2John.1.1", "parsing: '2 Yohanes 1:1'");
expect(p.parse("2. Yoh 1:1").osis()).toEqual("2John.1.1", "parsing: '2. Yoh 1:1'");
expect(p.parse("2 Yoh 1:1").osis()).toEqual("2John.1.1", "parsing: '2 Yoh 1:1'");
expect(p.parse("2John 1:1").osis()).toEqual("2John.1.1", "parsing: '2John 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. YOHANES 1:1").osis()).toEqual("2John.1.1", "parsing: '2. YOHANES 1:1'");
expect(p.parse("2 YOHANES 1:1").osis()).toEqual("2John.1.1", "parsing: '2 YOHANES 1:1'");
expect(p.parse("2. YOH 1:1").osis()).toEqual("2John.1.1", "parsing: '2. YOH 1:1'");
expect(p.parse("2 YOH 1:1").osis()).toEqual("2John.1.1", "parsing: '2 YOH 1:1'");
expect(p.parse("2JOHN 1:1").osis()).toEqual("2John.1.1", "parsing: '2JOHN 1:1'");
});
});
describe("Localized book 3John (id)", 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 (id)", function() {
expect(p.parse("3. Yohanes 1:1").osis()).toEqual("3John.1.1", "parsing: '3. Yohanes 1:1'");
expect(p.parse("3 Yohanes 1:1").osis()).toEqual("3John.1.1", "parsing: '3 Yohanes 1:1'");
expect(p.parse("3. Yoh 1:1").osis()).toEqual("3John.1.1", "parsing: '3. Yoh 1:1'");
expect(p.parse("3 Yoh 1:1").osis()).toEqual("3John.1.1", "parsing: '3 Yoh 1:1'");
expect(p.parse("3John 1:1").osis()).toEqual("3John.1.1", "parsing: '3John 1:1'");
p.include_apocrypha(false);
expect(p.parse("3. YOHANES 1:1").osis()).toEqual("3John.1.1", "parsing: '3. YOHANES 1:1'");
expect(p.parse("3 YOHANES 1:1").osis()).toEqual("3John.1.1", "parsing: '3 YOHANES 1:1'");
expect(p.parse("3. YOH 1:1").osis()).toEqual("3John.1.1", "parsing: '3. YOH 1:1'");
expect(p.parse("3 YOH 1:1").osis()).toEqual("3John.1.1", "parsing: '3 YOH 1:1'");
expect(p.parse("3JOHN 1:1").osis()).toEqual("3John.1.1", "parsing: '3JOHN 1:1'");
});
});
describe("Localized book John (id)", 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 (id)", function() {
expect(p.parse("Yohanes 1:1").osis()).toEqual("John.1.1", "parsing: 'Yohanes 1:1'");
expect(p.parse("John 1:1").osis()).toEqual("John.1.1", "parsing: 'John 1:1'");
expect(p.parse("Yoh 1:1").osis()).toEqual("John.1.1", "parsing: 'Yoh 1:1'");
p.include_apocrypha(false);
expect(p.parse("YOHANES 1:1").osis()).toEqual("John.1.1", "parsing: 'YOHANES 1:1'");
expect(p.parse("JOHN 1:1").osis()).toEqual("John.1.1", "parsing: 'JOHN 1:1'");
expect(p.parse("YOH 1:1").osis()).toEqual("John.1.1", "parsing: 'YOH 1:1'");
});
});
describe("Localized book Acts (id)", 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: Acts (id)", function() {
expect(p.parse("Kisah Para Rasu 1:1").osis()).toEqual("Acts.1.1", "parsing: 'Kisah Para Rasu 1:1'");
expect(p.parse("Acts 1:1").osis()).toEqual("Acts.1.1", "parsing: 'Acts 1:1'");
expect(p.parse("Kis 1:1").osis()).toEqual("Acts.1.1", "parsing: 'Kis 1:1'");
p.include_apocrypha(false);
expect(p.parse("KISAH PARA RASU 1:1").osis()).toEqual("Acts.1.1", "parsing: 'KISAH PARA RASU 1:1'");
expect(p.parse("ACTS 1:1").osis()).toEqual("Acts.1.1", "parsing: 'ACTS 1:1'");
expect(p.parse("KIS 1:1").osis()).toEqual("Acts.1.1", "parsing: 'KIS 1:1'");
});
});
describe("Localized book Rom (id)", 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: Rom (id)", function() {
expect(p.parse("Roma 1:1").osis()).toEqual("Rom.1.1", "parsing: 'Roma 1:1'");
expect(p.parse("Rom 1:1").osis()).toEqual("Rom.1.1", "parsing: 'Rom 1:1'");
expect(p.parse("Rm 1:1").osis()).toEqual("Rom.1.1", "parsing: 'Rm 1:1'");
p.include_apocrypha(false);
expect(p.parse("ROMA 1:1").osis()).toEqual("Rom.1.1", "parsing: 'ROMA 1:1'");
expect(p.parse("ROM 1:1").osis()).toEqual("Rom.1.1", "parsing: 'ROM 1:1'");
expect(p.parse("RM 1:1").osis()).toEqual("Rom.1.1", "parsing: 'RM 1:1'");
});
});
describe("Localized book 2Cor (id)", 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: 2Cor (id)", function() {
expect(p.parse("2. Korintus 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2. Korintus 1:1'");
expect(p.parse("2 Korintus 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2 Korintus 1:1'");
expect(p.parse("2. Kor 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2. Kor 1:1'");
expect(p.parse("2 Kor 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2 Kor 1:1'");
expect(p.parse("2Cor 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2Cor 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. KORINTUS 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2. KORINTUS 1:1'");
expect(p.parse("2 KORINTUS 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2 KORINTUS 1:1'");
expect(p.parse("2. KOR 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2. KOR 1:1'");
expect(p.parse("2 KOR 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2 KOR 1:1'");
expect(p.parse("2COR 1:1").osis()).toEqual("2Cor.1.1", "parsing: '2COR 1:1'");
});
});
describe("Localized book 1Cor (id)", 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: 1Cor (id)", function() {
expect(p.parse("1. Korintus 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1. Korintus 1:1'");
expect(p.parse("1 Korintus 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1 Korintus 1:1'");
expect(p.parse("1. Kor 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1. Kor 1:1'");
expect(p.parse("1 Kor 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1 Kor 1:1'");
expect(p.parse("1Cor 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1Cor 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. KORINTUS 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1. KORINTUS 1:1'");
expect(p.parse("1 KORINTUS 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1 KORINTUS 1:1'");
expect(p.parse("1. KOR 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1. KOR 1:1'");
expect(p.parse("1 KOR 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1 KOR 1:1'");
expect(p.parse("1COR 1:1").osis()).toEqual("1Cor.1.1", "parsing: '1COR 1:1'");
});
});
describe("Localized book Gal (id)", 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: Gal (id)", function() {
expect(p.parse("Galatia 1:1").osis()).toEqual("Gal.1.1", "parsing: 'Galatia 1:1'");
expect(p.parse("Gal 1:1").osis()).toEqual("Gal.1.1", "parsing: 'Gal 1:1'");
p.include_apocrypha(false);
expect(p.parse("GALATIA 1:1").osis()).toEqual("Gal.1.1", "parsing: 'GALATIA 1:1'");
expect(p.parse("GAL 1:1").osis()).toEqual("Gal.1.1", "parsing: 'GAL 1:1'");
});
});
describe("Localized book Eph (id)", 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: Eph (id)", function() {
expect(p.parse("Efesus 1:1").osis()).toEqual("Eph.1.1", "parsing: 'Efesus 1:1'");
expect(p.parse("Eph 1:1").osis()).toEqual("Eph.1.1", "parsing: 'Eph 1:1'");
expect(p.parse("Ef 1:1").osis()).toEqual("Eph.1.1", "parsing: 'Ef 1:1'");
p.include_apocrypha(false);
expect(p.parse("EFESUS 1:1").osis()).toEqual("Eph.1.1", "parsing: 'EFESUS 1:1'");
expect(p.parse("EPH 1:1").osis()).toEqual("Eph.1.1", "parsing: 'EPH 1:1'");
expect(p.parse("EF 1:1").osis()).toEqual("Eph.1.1", "parsing: 'EF 1:1'");
});
});
describe("Localized book Phil (id)", 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: Phil (id)", function() {
expect(p.parse("Filipi 1:1").osis()).toEqual("Phil.1.1", "parsing: 'Filipi 1:1'");
expect(p.parse("Phil 1:1").osis()).toEqual("Phil.1.1", "parsing: 'Phil 1:1'");
expect(p.parse("Flp 1:1").osis()).toEqual("Phil.1.1", "parsing: 'Flp 1:1'");
p.include_apocrypha(false);
expect(p.parse("FILIPI 1:1").osis()).toEqual("Phil.1.1", "parsing: 'FILIPI 1:1'");
expect(p.parse("PHIL 1:1").osis()).toEqual("Phil.1.1", "parsing: 'PHIL 1:1'");
expect(p.parse("FLP 1:1").osis()).toEqual("Phil.1.1", "parsing: 'FLP 1:1'");
});
});
describe("Localized book Col (id)", 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: Col (id)", function() {
expect(p.parse("Kolose 1:1").osis()).toEqual("Col.1.1", "parsing: 'Kolose 1:1'");
expect(p.parse("Col 1:1").osis()).toEqual("Col.1.1", "parsing: 'Col 1:1'");
expect(p.parse("Kol 1:1").osis()).toEqual("Col.1.1", "parsing: 'Kol 1:1'");
p.include_apocrypha(false);
expect(p.parse("KOLOSE 1:1").osis()).toEqual("Col.1.1", "parsing: 'KOLOSE 1:1'");
expect(p.parse("COL 1:1").osis()).toEqual("Col.1.1", "parsing: 'COL 1:1'");
expect(p.parse("KOL 1:1").osis()).toEqual("Col.1.1", "parsing: 'KOL 1:1'");
});
});
describe("Localized book 2Thess (id)", 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: 2Thess (id)", function() {
expect(p.parse("2. Tesalonika 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2. Tesalonika 1:1'");
expect(p.parse("2 Tesalonika 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2 Tesalonika 1:1'");
expect(p.parse("2. Tes 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2. Tes 1:1'");
expect(p.parse("2Thess 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2Thess 1:1'");
expect(p.parse("2 Tes 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2 Tes 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. TESALONIKA 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2. TESALONIKA 1:1'");
expect(p.parse("2 TESALONIKA 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2 TESALONIKA 1:1'");
expect(p.parse("2. TES 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2. TES 1:1'");
expect(p.parse("2THESS 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2THESS 1:1'");
expect(p.parse("2 TES 1:1").osis()).toEqual("2Thess.1.1", "parsing: '2 TES 1:1'");
});
});
describe("Localized book 1Thess (id)", 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: 1Thess (id)", function() {
expect(p.parse("1. Tesalonika 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1. Tesalonika 1:1'");
expect(p.parse("1 Tesalonika 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1 Tesalonika 1:1'");
expect(p.parse("1. Tes 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1. Tes 1:1'");
expect(p.parse("1Thess 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1Thess 1:1'");
expect(p.parse("1 Tes 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1 Tes 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. TESALONIKA 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1. TESALONIKA 1:1'");
expect(p.parse("1 TESALONIKA 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1 TESALONIKA 1:1'");
expect(p.parse("1. TES 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1. TES 1:1'");
expect(p.parse("1THESS 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1THESS 1:1'");
expect(p.parse("1 TES 1:1").osis()).toEqual("1Thess.1.1", "parsing: '1 TES 1:1'");
});
});
describe("Localized book 2Tim (id)", 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: 2Tim (id)", function() {
expect(p.parse("2. Timotius 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2. Timotius 1:1'");
expect(p.parse("2 Timotius 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2 Timotius 1:1'");
expect(p.parse("2. Tim 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2. Tim 1:1'");
expect(p.parse("2 Tim 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2 Tim 1:1'");
expect(p.parse("2Tim 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2Tim 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. TIMOTIUS 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2. TIMOTIUS 1:1'");
expect(p.parse("2 TIMOTIUS 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2 TIMOTIUS 1:1'");
expect(p.parse("2. TIM 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2. TIM 1:1'");
expect(p.parse("2 TIM 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2 TIM 1:1'");
expect(p.parse("2TIM 1:1").osis()).toEqual("2Tim.1.1", "parsing: '2TIM 1:1'");
});
});
describe("Localized book 1Tim (id)", 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: 1Tim (id)", function() {
expect(p.parse("1. Timotius 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1. Timotius 1:1'");
expect(p.parse("1 Timotius 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1 Timotius 1:1'");
expect(p.parse("1. Tim 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1. Tim 1:1'");
expect(p.parse("1 Tim 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1 Tim 1:1'");
expect(p.parse("1Tim 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1Tim 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. TIMOTIUS 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1. TIMOTIUS 1:1'");
expect(p.parse("1 TIMOTIUS 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1 TIMOTIUS 1:1'");
expect(p.parse("1. TIM 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1. TIM 1:1'");
expect(p.parse("1 TIM 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1 TIM 1:1'");
expect(p.parse("1TIM 1:1").osis()).toEqual("1Tim.1.1", "parsing: '1TIM 1:1'");
});
});
describe("Localized book Titus (id)", 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: Titus (id)", function() {
expect(p.parse("Titus 1:1").osis()).toEqual("Titus.1.1", "parsing: 'Titus 1:1'");
expect(p.parse("Tit 1:1").osis()).toEqual("Titus.1.1", "parsing: 'Tit 1:1'");
p.include_apocrypha(false);
expect(p.parse("TITUS 1:1").osis()).toEqual("Titus.1.1", "parsing: 'TITUS 1:1'");
expect(p.parse("TIT 1:1").osis()).toEqual("Titus.1.1", "parsing: 'TIT 1:1'");
});
});
describe("Localized book Phlm (id)", 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: Phlm (id)", function() {
expect(p.parse("Filemon 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'Filemon 1:1'");
expect(p.parse("Phlm 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'Phlm 1:1'");
expect(p.parse("Flm 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'Flm 1:1'");
p.include_apocrypha(false);
expect(p.parse("FILEMON 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'FILEMON 1:1'");
expect(p.parse("PHLM 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'PHLM 1:1'");
expect(p.parse("FLM 1:1").osis()).toEqual("Phlm.1.1", "parsing: 'FLM 1:1'");
});
});
describe("Localized book Heb (id)", 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: Heb (id)", function() {
expect(p.parse("Ibrani 1:1").osis()).toEqual("Heb.1.1", "parsing: 'Ibrani 1:1'");
expect(p.parse("Heb 1:1").osis()).toEqual("Heb.1.1", "parsing: 'Heb 1:1'");
expect(p.parse("Ibr 1:1").osis()).toEqual("Heb.1.1", "parsing: 'Ibr 1:1'");
p.include_apocrypha(false);
expect(p.parse("IBRANI 1:1").osis()).toEqual("Heb.1.1", "parsing: 'IBRANI 1:1'");
expect(p.parse("HEB 1:1").osis()).toEqual("Heb.1.1", "parsing: 'HEB 1:1'");
expect(p.parse("IBR 1:1").osis()).toEqual("Heb.1.1", "parsing: 'IBR 1:1'");
});
});
describe("Localized book Jas (id)", 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: Jas (id)", function() {
expect(p.parse("Yakobus 1:1").osis()).toEqual("Jas.1.1", "parsing: 'Yakobus 1:1'");
expect(p.parse("Jas 1:1").osis()).toEqual("Jas.1.1", "parsing: 'Jas 1:1'");
expect(p.parse("Yak 1:1").osis()).toEqual("Jas.1.1", "parsing: 'Yak 1:1'");
p.include_apocrypha(false);
expect(p.parse("YAKOBUS 1:1").osis()).toEqual("Jas.1.1", "parsing: 'YAKOBUS 1:1'");
expect(p.parse("JAS 1:1").osis()).toEqual("Jas.1.1", "parsing: 'JAS 1:1'");
expect(p.parse("YAK 1:1").osis()).toEqual("Jas.1.1", "parsing: 'YAK 1:1'");
});
});
describe("Localized book 2Pet (id)", 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: 2Pet (id)", function() {
expect(p.parse("2. Petrus 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2. Petrus 1:1'");
expect(p.parse("2 Petrus 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2 Petrus 1:1'");
expect(p.parse("2. Ptr 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2. Ptr 1:1'");
expect(p.parse("2 Ptr 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2 Ptr 1:1'");
expect(p.parse("2Pet 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2Pet 1:1'");
p.include_apocrypha(false);
expect(p.parse("2. PETRUS 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2. PETRUS 1:1'");
expect(p.parse("2 PETRUS 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2 PETRUS 1:1'");
expect(p.parse("2. PTR 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2. PTR 1:1'");
expect(p.parse("2 PTR 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2 PTR 1:1'");
expect(p.parse("2PET 1:1").osis()).toEqual("2Pet.1.1", "parsing: '2PET 1:1'");
});
});
describe("Localized book 1Pet (id)", 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: 1Pet (id)", function() {
expect(p.parse("1. Petrus 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1. Petrus 1:1'");
expect(p.parse("1 Petrus 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1 Petrus 1:1'");
expect(p.parse("1. Ptr 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1. Ptr 1:1'");
expect(p.parse("1 Ptr 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1 Ptr 1:1'");
expect(p.parse("1Pet 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1Pet 1:1'");
p.include_apocrypha(false);
expect(p.parse("1. PETRUS 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1. PETRUS 1:1'");
expect(p.parse("1 PETRUS 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1 PETRUS 1:1'");
expect(p.parse("1. PTR 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1. PTR 1:1'");
expect(p.parse("1 PTR 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1 PTR 1:1'");
expect(p.parse("1PET 1:1").osis()).toEqual("1Pet.1.1", "parsing: '1PET 1:1'");
});
});
describe("Localized book Jude (id)", 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: Jude (id)", function() {
expect(p.parse("Yudas 1:1").osis()).toEqual("Jude.1.1", "parsing: 'Yudas 1:1'");
expect(p.parse("Jude 1:1").osis()).toEqual("Jude.1.1", "parsing: 'Jude 1:1'");
expect(p.parse("Yud 1:1").osis()).toEqual("Jude.1.1", "parsing: 'Yud 1:1'");
p.include_apocrypha(false);
expect(p.parse("YUDAS 1:1").osis()).toEqual("Jude.1.1", "parsing: 'YUDAS 1:1'");
expect(p.parse("JUDE 1:1").osis()).toEqual("Jude.1.1", "parsing: 'JUDE 1:1'");
expect(p.parse("YUD 1:1").osis()).toEqual("Jude.1.1", "parsing: 'YUD 1:1'");
});
});
describe("Miscellaneous tests", 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 return the expected language", function() {
expect(p.languages).toEqual(["id"]);
});
it("should handle ranges (id)", function() {
expect(p.parse("Titus 1:1 sampai 2").osis()).toEqual("Titus.1.1-Titus.1.2", "parsing: 'Titus 1:1 sampai 2'");
expect(p.parse("Matt 1sampai2").osis()).toEqual("Matt.1-Matt.2", "parsing: 'Matt 1sampai2'");
expect(p.parse("Phlm 2 SAMPAI 3").osis()).toEqual("Phlm.1.2-Phlm.1.3", "parsing: 'Phlm 2 SAMPAI 3'");
});
it("should handle chapters (id)", function() {
expect(p.parse("Titus 1:1, bab 2").osis()).toEqual("Titus.1.1,Titus.2", "parsing: 'Titus 1:1, bab 2'");
expect(p.parse("Matt 3:4 BAB 6").osis()).toEqual("Matt.3.4,Matt.6", "parsing: 'Matt 3:4 BAB 6'");
});
it("should handle verses (id)", function() {
expect(p.parse("Exod 1:1 ayat 3").osis()).toEqual("Exod.1.1,Exod.1.3", "parsing: 'Exod 1:1 ayat 3'");
expect(p.parse("Phlm AYAT 6").osis()).toEqual("Phlm.1.6", "parsing: 'Phlm AYAT 6'");
});
it("should handle 'and' (id)", function() {
expect(p.parse("Exod 1:1 dan 3").osis()).toEqual("Exod.1.1,Exod.1.3", "parsing: 'Exod 1:1 dan 3'");
expect(p.parse("Phlm 2 DAN 6").osis()).toEqual("Phlm.1.2,Phlm.1.6", "parsing: 'Phlm 2 DAN 6'");
});
it("should handle titles (id)", function() {
expect(p.parse("Ps 3 judul, 4:2, 5:judul").osis()).toEqual("Ps.3.1,Ps.4.2,Ps.5.1", "parsing: 'Ps 3 judul, 4:2, 5:judul'");
expect(p.parse("PS 3 JUDUL, 4:2, 5:JUDUL").osis()).toEqual("Ps.3.1,Ps.4.2,Ps.5.1", "parsing: 'PS 3 JUDUL, 4:2, 5:JUDUL'");
});
it("should handle 'ff' (id)", function() {
expect(p.parse("Rev 3ff, 4:2ff").osis()).toEqual("Rev.3-Rev.22,Rev.4.2-Rev.4.11", "parsing: 'Rev 3ff, 4:2ff'");
expect(p.parse("REV 3 FF, 4:2 FF").osis()).toEqual("Rev.3-Rev.22,Rev.4.2-Rev.4.11", "parsing: 'REV 3 FF, 4:2 FF'");
});
it("should handle translations (id)", function() {
expect(p.parse("Lev 1 (atb)").osis_and_translations()).toEqual([["Lev.1", "atb"]]);
expect(p.parse("lev 1 atb").osis_and_translations()).toEqual([["Lev.1", "atb"]]);
});
it("should handle book ranges (id)", function() {
p.set_options({
book_alone_strategy: "full",
book_range_strategy: "include"
});
expect(p.parse("1 sampai 3 Yoh").osis()).toEqual("1John.1-3John.1", "parsing: '1 sampai 3 Yoh'");
});
return it("should handle boundaries (id)", function() {
p.set_options({
book_alone_strategy: "full"
});
expect(p.parse("\u2014Matt\u2014").osis()).toEqual("Matt.1-Matt.28", "parsing: '\u2014Matt\u2014'");
expect(p.parse("\u201cMatt 1:1\u201d").osis()).toEqual("Matt.1.1", "parsing: '\u201cMatt 1:1\u201d'");
});
});
}).call(this);