scripture-guide 1.0.38 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,5 @@
1
1
 
2
2
 
3
- const prepareBlacklist = (lang_extras) => {
4
- var blacklist = [];
5
- blacklist.push("\\d{4,}"); // 4 Digit references
6
- blacklist.push("^Ch\\. \\d+"); //Chapter with no book
7
- blacklist.push("\\w\\w\\d\\d"); //Words with numbers together KGURO43KEAJFK
8
-
9
- //Oneoff Blacklist
10
- blacklist.push("\\bro \\d+\\b"); //lowecase letters followed by numbers
11
- blacklist.push("\\bETH \\d+\.\\d+\\b");
12
- blacklist.push("\\b(BC|AD|BCE)[––—−]+\\d+\\b"); //550 BC–330 BC
13
- blacklist.push("\\b(AC3|PS2|PS3|PS4)\\b"); //Common file extentions
14
- blacklist.push("\\b(ps|PS)[1-9]\\b"); //Common file extentions'
15
-
16
- //Increase strictness for abbreviations
17
- blacklist.push("\\b[a-z][a-z] [0-9]"); //lowercase 2-letter abbreviation
18
-
19
-
20
- var blacklist_pattern = new RegExp("(" + blacklist.join("|") + ")", 'g');
21
-
22
- return blacklist_pattern;
23
- }
24
-
25
3
 
26
4
  const findMatchingBooks = (content,books) => {
27
5
  const matchingBooks = books.filter(i=>(new RegExp(i,"ig")).test(content));
@@ -59,16 +37,23 @@ const findMatches = (content,books,lang_extra) => {
59
37
  } return [substring,positions];
60
38
  });
61
39
 
40
+
62
41
  const possiblyOverlappingMatches = bookSubStrings.map(([substring,positions])=>{
63
- const len = substring.length;
64
42
  return positions.map(i=>{
65
- const match = content.slice(i).match(new RegExp(substring+postBookMatch,"ig"))?.[0];
66
- const [posIn, posOut] = [content.indexOf(match),content.indexOf(match)+match.length];
67
- return [match.replace(tail,"").trim(),posIn,posOut];
43
+ const pattern = new RegExp(substring+postBookMatch,"ig");
44
+ const match = content.slice(i).match(pattern)?.[0]?.replace(tail,"").trim();
45
+ if(!match) return null;
46
+ const len = match.length;
47
+ const pos = i;
48
+ const [posIn, posOut] = [pos,pos+len];
49
+ //console.log({content:content.slice(i),pattern,match,posIn,posOut});
50
+ return [match,posIn,posOut];
68
51
  }
69
- )}).flat();
52
+ )}).flat().filter(i=>!!i);
53
+
54
+
70
55
 
71
- matchesWithReferences = possiblyOverlappingMatches.map(([string,start,end])=>{
56
+ const matchesWithReferences = possiblyOverlappingMatches.map(([string,start,end])=>{
72
57
  const overLappingItems = possiblyOverlappingMatches.filter(([s,s1,e1])=>s!==string && s1<end && e1>end);
73
58
  const hasOverlap = overLappingItems.length > 0;
74
59
  const newEnd = hasOverlap ? Math.min(...overLappingItems.map(([s,s1,e1])=>s1)) : end;
@@ -76,11 +61,10 @@ const findMatches = (content,books,lang_extra) => {
76
61
  return newString.replace(tail,"").trim();
77
62
  }).filter(i=>!!i);
78
63
 
79
-
80
- return matchesWithReferences.map(string=>{
64
+ const matches = matchesWithReferences.map(string=>{
81
65
  const pattern = (new RegExp(string,"ig"));
82
- const tail = lang_extra.tail || /[^0-9]+$/;
83
66
  const matches = content.match(pattern)?.map(i=>i.trim().replace(tail,""));
67
+ //console.log({string,matches,tail});
84
68
  return matches;
85
69
  }).flat()
86
70
  .reduce((prev,current)=>{
@@ -89,11 +73,14 @@ const findMatches = (content,books,lang_extra) => {
89
73
  },[]).filter(i=>!!i);
90
74
 
91
75
 
76
+
77
+ return matches;
92
78
  }
93
79
 
94
80
 
95
81
 
96
- function findMatchIndexes(content, matches,lookupReference) {
82
+ function findMatchIndexes(content, matches,lookupReference, lang_extra) {
83
+ const tail = lang_extra.tail ? new RegExp(lang_extra.tail,"ig") : /[^0-9]+$/;
97
84
  const indexes = matches.map(i=>{
98
85
  const length = i.length;
99
86
  let positions = [];
@@ -103,19 +90,22 @@ function findMatchIndexes(content, matches,lookupReference) {
103
90
  positions.push(strPos);
104
91
  strPos = content.indexOf(i, strPos + 1);
105
92
  }
106
- return positions.map(i=>[i,i+length]);
93
+ return positions.map(i=>[i,i+length+2]);
107
94
  }).flat()
108
- .filter(a=>{
95
+ .map(a=>{
109
96
 
110
- const substring = content.substring(a[0],a[1]);
97
+ const substring = content.substring(a[0],a[1]).replace(tail,"").trim();
111
98
  const charRightBeforeMatch = content.substring(a[0]-1,a[0]);
112
- if(!/(^|\s|\W)/.test(charRightBeforeMatch)) return false;
99
+ const leadingCharIsInvalid = !/^(\s|\W|)$/.test(charRightBeforeMatch);
100
+ // console.log({substring, charRightBeforeMatch, leadingCharIsInvalid});
101
+ if(leadingCharIsInvalid) return false;
113
102
  const verse_ids = lookupReference(substring).verse_ids;
114
- // console.log({a,substring,verse_ids});
115
- if(verse_ids.length > 0) return true;
103
+ //console.log({a,substring,verse_ids});
104
+ if(verse_ids.length > 0) return [a[0],a[0]+substring.length];
116
105
 
117
106
  return false;
118
107
  })
108
+ .filter(i=>!!i)
119
109
  .sort((a, b) => a[0] - b[0]);
120
110
 
121
111
 
@@ -176,7 +166,7 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
176
166
  const matches = findMatches(content,books,lang_extra);
177
167
 
178
168
 
179
- const matchIndeces = findMatchIndexes(content,matches,lookupReference);
169
+ const matchIndeces = findMatchIndexes(content,matches,lookupReference,lang_extra);
180
170
  if(!matchIndeces) return content;
181
171
 
182
172
 
@@ -263,69 +253,7 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
263
253
  }
264
254
 
265
255
 
266
- const preparePattern = (booklist,wordBreak,lang_extras) => {
267
-
268
-
269
- wordBreak = wordBreak || "";
270
- lang_chapter = lang_extras?.chapter || "";
271
- lang_verse = lang_extras?.verse || "";
272
-
273
- var bookregex = booklist.map(b=>{
274
- return b[0];
275
- });
276
-
277
- //Combine Books
278
- const books = "(?:" + bookregex.join("|") + ")\\s*"; // \\(*
279
-
280
- //Books that have a digit before them
281
- var numbooks = [];
282
- numbooks.push("ne");
283
- numbooks.push("sam");
284
- numbooks.push("ki*n*gs");
285
- numbooks.push("chr");
286
- numbooks.push("cor");
287
- numbooks.push("ti");
288
- numbooks.push("thes");
289
- numbooks.push("pet");
290
- numbooks.push("jo*h*n");
291
-
292
-
293
- //Meta data components
294
- var jst = "(?:[, —\\-]*(?:Joseph Smith[']*s* Translation *o*f*|\\(Joseph Smith[']*s* Translation *o*f*\\)|jst|\\(jst\\))[, \\—\\-)]*)*";
295
- var ordinals = `(?:[I1-4]*(?:3rd|1st|2n*d|4th|first|sec*o*n*d*\\.*|third|fourt*h*)* *${wordBreak})*`;
296
- var booksof = "(?:\\s*books* of\\s*)*";
297
- var prechapter = "(?:\\s|\\-|–|,)*";
298
- var chapter = `(?:,*\\s*` + ordinals + `${wordBreak}cha*p*t*e*r*s*\\.*,*\\s*)`;
299
- var verse = `(?:,*\\s*` + ordinals + `${wordBreak}v*ve*r*s*e*s*\\.*,*\\s*)`;
300
- var versenums = "\\s*[0-9]+"; //[a-f]*
301
- var joiners = "(?:[,;&\\/](?:\\s*and\\s*)*\\s*(?!$))*";
302
- var bumper = "(?![^<>]*>)"; //prevents matching inside of quotes
303
-
304
-
305
- //Punctuations, etc
306
- var punct = [];
307
- punct.push("\\s*[:\\-\\.~–—]" + versenums); //[a-z]{0,1} //colons,dots and dashes
308
- punct.push("\\s*(?:" + chapter + "|" + verse + ")" + versenums); //spelled out chapter and verse words
309
- punct.push("\\s*(?:;|,|,* *and|&amp;|&| *to *)\\s*[1-9]\\d*(?!\\s*\\.*(" + numbooks.join("|") + "))"); //passage breakers (a new book may appear after)
310
- //add language overrides
311
- if(lang_chapter) punct.push(lang_chapter);
312
- if(lang_verse) punct.push(lang_verse);
313
- //if(Array.isArray(lang_extras)) punct = [...punct, ...lang_extras];
314
-
315
- //combine punctuation
316
- var punct = "(?:[1-9]\\d*(?:" + punct.join("|") + ")*)";
317
-
318
- //Full Regex
319
- var match = bumper + "((?:(?:" + jst + `${wordBreak}` + ordinals + booksof + books + prechapter + chapter + "*" + punct + jst + ")" + joiners + ")+)";
320
- var pattern = new RegExp(match, 'gi');
321
-
322
- return pattern;
323
-
324
- }
325
-
326
256
 
327
257
  module.exports = {
328
- prepareBlacklist,
329
- preparePattern,
330
258
  processReferenceDetection
331
259
  }
@@ -35,7 +35,7 @@ module.exports = {
35
35
  chapter:"([장절과와및0-9:;,~\\s—–-]|부터|그리고|또는*)*[0-9장절]+",
36
36
  verse:"절",
37
37
  joiners: ["^[;, ]*(또는*|그리고|비교|과|와)*$"],
38
- tail: "[장절0-9]+"
38
+ tail: "[^장절0-9]+$"
39
39
  },
40
40
  },
41
41
  de:{
@@ -66,9 +66,6 @@ module.exports = {
66
66
  pre_rules: [
67
67
  //replace dashes in book names with spaces
68
68
  ["-([^0-9 ])", " $1"],
69
- ["(v[aà]|ho[ặậ]c|c[ũu]ng|v[ớờ]i|v[àa] *c[ảa])", ";"],
70
- ["; Giao", "và Giao"],
71
- ["(\\d+), *(\\D)", "$1; $2"],
72
69
  ],
73
70
  books:{
74
71
  "Sáng Thế": ["STK[yý]", "Sáng Thế Ký","S[áa]ng *Th[ếe] *(K[yý])*"], "Xuất Ê Díp Tô": ["X[ÊE]DT(K[ýy])*","X[úu]at *Ê *D[íi]p *T[ôo] *(K[yý])*","Xu[ấa]t h[àa]nh *(k[yý])*"], "Lê Vi": ["L[êe] *Vi *(K[yý])*","LV(K[ýy])*"], "Dân Số": ["DS(K[yý])*","D[âa]n *S[ốo] *(K[yý])*"], "Phục Truyền Luật Lệ": ["PTLL(K[yý])*","Ph[úu]c *Truy[ềe]n *Lu[ậa]t *L[ệe] *(K[yý])*"], "Giô Suê": ["Gi[ôo] *Su[êe]"], "Các Quan Xét": ["C[áa]c *Quan *X[ée]t","QX[ée]t"], "Ru Tơ": ["Ru *T[ơo]"], "1 Sa Mu Ên": ["1 *Sa *Mu *Ên","1 *SM[EÊ]n"], "2 Sa Mu Ên": ["2 *Sa *Mu *Ên","2 *SM[EÊ]n"], "1 Các Vua": ["1 *C[áa]c *Vua","1 *Vua"], "2 Các Vua": ["2 *C[áa]c *Vua","2 *Vua"], "1 Sử Ký": ["1 *S[ửu] *K[yý]"], "2 Sử Ký": ["2 *S[ửu] *K[yý]"], "E Xơ Ra": ["E *X[ơo] *Ra"], "Nê Hê Mi": ["N[êe] *H[êe] *Mi"], "Ê Xơ Tê": ["Ê *X[ơo] *T[êe]"], "Gióp": ["Gi[óo]p"], "Thi Thiên": ["Th*i* *Thi[êe]n"], "Châm Ngôn": ["Ch[âa]m *Ng[ôo]n","CNg[ôo]n"], "Truyền Đạo": ["T[DĐ][aạ]o","Truy[ềe]n *[ĐD]a[ọo]"], "Nhã Ca": ["Nh[ãa] *Ca"], "Ê Sai": ["[ÊE] *Sai"], "Giê Rê Mi": ["GRMi","Gi[êe] *R[êe] *Mi"], "Ca Thương": ["CTh[uư][oơ]ng","Ca *Th[ưu]ng"], "Ê Xê Chi Ên": ["[EÊ]XC[EÊ]n","Ê *X[êe] *Chi *[ÊE]n"], "Đa Ni Ên": ["[DĐ]N[EÊ]n","[ĐD]a *Ni *[ÊE]n"], "Ô Sê": ["[ÔO] *S[êe]"], "Giô Ên": ["Gi[ôo] *[ÊE]n"], "A Mốt": ["A *M[ốo]t"], "Áp Đia": ["[ÁA]p *Đia"], "Giô Na": ["Gi[ôo] *Na"], "Mi Chê": ["Mi *Ch[êe]"], "Na Hum": ["Na *Hum"], "Ha Ba Cúc": ["HBCuc","Ha *Ba *C[úu]c"], "Sô Phô Ni": ["S[ôo]* *Ph*[ôo]* *Ni"], "A Ghê": ["A *Gh[êe]"], "Xa Cha Ri": ["Xa* *Ch*a* *Ri"], "Ma La Chi": ["Ma* *La* *Chi"], "Ma Thi Ơ": ["Ma *Thi *[ƠO]","MT[OƠ]"], "Mác": ["M[áa]c"], "Lu Ca": ["Lu *Ca"], "Giăng": ["Gio*[ăa]ng*"], "Công Vụ Các Sứ Đồ": ["C[ôo]ng *Vụ *C[áa]c *Sứ *Đ[ồo]", "CVCS[ĐD]"], "Rô Ma": ["R[ôo] *Ma"], "1 Cô Rinh Tô": ["1 *C[ôo]* *Ri*n*h* *T[ôo]"], "2 Cô Rinh Tô": ["2 *C[ôo]* *Ri*n*h* *T[ôo]"], "Ga La Ti": ["Ga *La *Ti"], "Ê Phê Sô": ["[ÊE] *Ph[êe] *S[ôo]","[ÊE]PS[ÔO]"], "Phi Líp": ["Phi *L[íi]p"], "Cô Lô Se": ["C[ôo] *L[ôo] *Se","CL[ÔO]*Se"], "1 Tê Sa Lô Ni Ca": ["1 *Tê *Sa *L[ôo] *Ni *Ca","1 *TSLN[ÔO]Ca","1 TSLNCa"], "2 Tê Sa Lô Ni Ca": ["2 TSLNCa","2 *Tê *Sa *L[ôo] *Ni *Ca","2 *TSLN[ÔO]Ca"], "1 Ti Mô Thê": ["1 *Ti *Mô *Th[êe]","1 *TMTh[ÊE]"], "2 Ti Mô Thê": ["2 *Ti *Mô *Th[êe]","2 *TMTh[ÊE]"], "Tít": ["T[íi]t"], "Phi Lê Môn": ["Phi *L[êe] *Môn","PL[ÊE]M[ÔO]n","PLM[oô]n"], "Hê Bơ Rơ": ["H[êe] *Bơ *Rơ","HBR[ƠO]"], "Gia Cơ": ["GLTi", "Gia *C[ơo]"], "1 Phi E Rơ": ["1 *Phi *E *R[ơo]","1 *PER[ƠO]"], "2 Phi E Rơ": ["2 *Phi *E *R[ơo]","2 *PER[ƠO]"], "1 Giăng": ["1 *Gio*[ăa]ng*"], "2 Giăng": ["2 *Gio*[ăa]ng*"], "3 Giăng": ["3 *Gio*[ăa]ng*"], "Giu Đe": ["Giu *[ĐD]e"], "Khải Huyền": ["Kh[ảa]i *Huy[ềe]n","KHuy[ềe]n"], "1 Nê Phi": ["1 *N[êe] *Phi"], "2 Nê Phi": ["2 *N[êe] *Phi"], "Gia Cốp": ["Gi*a* *C[ốo]p"], "Ê Nót": ["[ÊE] *N[óo]t"], "Gia Rôm": ["Gi*a* *R[ôo]m"], "Ôm Ni": ["[ÔO]m *Ni"], "Lời Mặc Môn": ["L[ờo]i *M[ặa]c *M[ôo]n","LMM[ÔO]n"], "Mô Si A": ["M[ôo] *Si *A"], "An Ma": ["An *Ma"], "Hê La Man": ["H[êe]* *La* *Man"], "3 Nê Phi": ["3 *N[êe] *Phi"], "4 Nê Phi": ["4 *N[êe] *Phi"], "Mặc Môn": ["M[ậa]c *M[ôo]n", "MM[ÔO]n"], "Ê The": ["[ÊE] *The"], "Mô Rô Ni": ["M[ôo] *R[ôo] *Ni","MRN[ÎI]"], "Giáo Lý và Giao Ước": ["Gi[áa]o *L[ýi] *v[àa] *Giao *[ƯU][ớo]c","GLG[ƯU]"], "Môi Se": ["M[ôo]i *Se"], "Áp Ra Ham": ["[ÁA]p *Ra *Ham","ARH[ÂA]m"], "Joseph Smith—Ma Thi Ơ": ["Joseph *Smith—Ma *Thi *[ƠO]", "JS—MT[ƠO]"], "Joseph Smith—Lịch Sử": ["Joseph *Smith—L[ịi]ch *S[ửu]", "JS—LS"], "Những Tín Điều": ["Nh[ữu]ng *T[íi]n *[ĐD]i[ềe]u", "NT[ĐD]"]
@@ -77,7 +74,7 @@ module.exports = {
77
74
  book: `(Thứ nhất|I|1|Thứ hai|II|2|Thứ ba|III|3|Thứ tư|IV|4)*\\s*(Sách* của)*\\s*`,
78
75
  chapter:"(ch[uư][ơo]ng|[0-9:;,~ —–-])*[0-9]+",
79
76
  verse:"đoạn",
80
- joiners: ["^[;, ]*(hoặc|v[aà]|so với)*$",]
77
+ joiners: ["^[;, ]*(hoặc|và|so với)*$",]
81
78
  },
82
79
 
83
80
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scripture-guide",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "A utility for biblical and scripture reference parsing that enables structured queries based on strings of traditional scripture references (e.g. John 3:16). ",
5
5
  "main": "scriptures-compiled.js",
6
6
  "scripts": {
package/test/data/en.txt CHANGED
@@ -5,4 +5,5 @@ It talks about the consequences of the fall of Adam and Eve. Before the fall, if
5
5
  See John3:16 and, but not First John 1:9 for the same concept of the fall and the atonement.
6
6
  The fruit mentioned in 1 Nephi 8:9-12 represents something desirable and joyous. It is described as being sweet and white, surpassing any other fruit in its goodness and purity. In the book of Genesis, there is mention of the tree of life and the tree of the knowledge of good and evil (Genesis 2:9, 3:6). These trees represent different choices and paths that humans can take. The fruit in Lehi’s dream could be seen as a representation of the blessings and joy that come from choosing the path of righteousness and partaking of the goodness of God. In the book of Revelation, there are references to the tree of life as well (Revelation 2:7, 22:2). This tree is associated with eternal life and the blessings of God. So, the fruit in Lehi’s dream may also symbolize the blessings of eternal life and joy that come from following the teachings of Jesus Christ.
7
7
  In accordance with David’s last words at 2 Sam 23.3 (cf. Mos 23.8; 29.16). The Davidic reference may have been included as a conciliatory gesture to his descendants among the Mulekites. The reading in P (“thereby”) implies that keeping the commandments leads to rejoicing and love.
8
- *As Jacob’s priestly lineage comes to an end, the transferal of the plates to Benjamin means that both the Large and Small Plates of Nephi are in the possession of the Nephite kings; cf. WoM 1.10. Amaleki’s reference to spiritual gifts and his assertion about the sources of good and evil will be repeated at Moro 7.12, 16–17; 10.13–16; cf. Alma 5.40. The order of gifts listed generally reflects 1 Cor 12.10.
8
+ As Jacob’s priestly lineage comes to an end, the transferal of the plates to Benjamin means that both the Large and Small Plates of Nephi are in the possession of the Nephite kings; cf. WoM 1.10. Amaleki’s reference to spiritual gifts and his assertion about the sources of good and evil will be repeated at Moro 7.12, 16–17; 10.13–16; cf. Alma 5.40. The order of gifts listed generally reflects 1 Cor 12.10.
9
+ Consistently D&C 3:16-17 no "Samites" Mormon 1:8 mentioned across the board in Restoration scripture; cf. Jacob 1:13; 4 Nephi 1:38; Mormon 1:8; D&C 3:17-18
package/test/data/vn.txt CHANGED
@@ -11,4 +11,4 @@ Giảng dạy phụ thân của Vua La Mô Ni, AnMa 22:1–26.
11
11
  Xem Gioan 3:16 và, nhưng không phải là 1 Gioan 1:9 cho cùng một khái niệm về sự rơi rớt và sự chuộc tội.
12
12
  Trong đoạn Kinh thánh này, điểm chính là về trạng thái kinh hãi và run sợ của Lê Hi khi ông cầu nguyện và một cột lửa xuất hiện trước mặt ông. Điều này làm cho ông cảm thấy choáng ngợp và run sợ vô cùng. Điều này cho thấy sự mạnh mẽ và thiêng liêng của trải nghiệm này. Có một số tham chiếu trong Kinh thánh khác có thể giúp hiểu rõ hơn về hiện tượng này. Ví dụ, trong Xuất Ê Díp Tô 3:2, Thiên-sứ của Đức Giê-hô-va hiện ra trong một ngọn lửa giữa bụi gai, và cột lửa đó không tàn. (Xuất Ê Díp Tô 3:2) Điều tương tự cũng xảy ra trong Lê Vi 9:24 khi lửa từ trước mặt Đức Giê-hô-va thiêu hủy của-lễ thiêu và mỡ trên bàn thờ. (Lê Vi 9:24) Những hiện tượng này cho thấy sự hiện diện thiêng liêng và quyền năng của Chúa. Chúng là cách Chúa thể hiện sự lựa chọn và giao ước của Ngài với những người mà Ngài đã gọi. Trong trường hợp của Lê Hi, cột lửa xuất hiện trước mặt ông có thể cho thấy rằng ông đã được chọn và giao ước để truyền thông điệp của Chúa và dẫn dắt dân chúng. Điểm chính của đoạn này là sự mạnh mẽ và tác động mạnh mẽ của kinh nghiệm kỳ lạ này đối với Lê Hi. Nó gợi lên sự sợ hãi và kinh hãi của ông, đồng thời cũng cho thấy sự hiện diện và quyền năng của Chúa trong cuộc sống của con người.
13
13
  Trong đoạn này, chúng ta đang đọc về Lê Hi, một người đàn ông sống tại Giê Ru Sa Lem. Sau khi nhận được lời cảnh báo về sự hủy diệt sắp xảy ra của Ba Bi Lôn, Lê Hi đã cầu nguyện và có một trải nghiệm đặc biệt. Ông trở về nhà và nằm xuống giường, trong tâm trạng cảm thấy rung động và chan hòa Thánh Linh . Trong trạng thái này, Lê Hi có một tầm nhìn đặc biệt, ông nhìn thấy Chúa, Thiên thần và một vị cao quý cùng mười hai môn đệ. Chúa Giê-xu trao cho Lê Hi một quyển sách xác nhận sự phá hủy của Giê Ru Sa Lem trong tương lai và sự chiếm đóng của Ba Bi Lôn. Lê Hi trở thành một ngôn sứ và đi ra ngoài để thông báo tầm nhìn mà ông đã thấy . Điều này cho thấy tầm nhìn của Lê Hi có ý nghĩa quan trọng trong việc cảnh báo người dân về mối nguy hiểm đang đến gần. Nó cũng cho thấy sự quan tâm và lòng trắc ẩn của Chúa đối với dân của Giê Ru Sa Lem. Điều này có thể liên kết với những trạng thái tâm hồn khác của các nhân vật trong Kinh Thánh, như sự lo âu của Do Thái khi nghe lời kêu gọi hối cải của Lê Hi (1 Nê Phi 17:47) và tâm hồn buồn phiền của Lê Hi vì dân của Giê Ru Sa Lem (1 Nê Phi 19:20). Nhưng điều quan trọng là chúng ta hãy tìm hiểu và suy ngẫm về những thông điệp và lời cảnh báo mà Chúa đã truyền qua các nhân vật và trải nghiệm của họ trong Kinh Thánh.
14
- *Các tham chiếu khác trong Kinh Thánh, như 1 Nê Phi 5:4, 1 Nê Phi 11:14, An Ma 36:22, Hê La Man 5:48 và Giáo Lý và Giao Ước 137, có thể cung cấp thêm thông tin và phần nào làm sáng tỏ thêm về trải nghiệm của Lê Hi.
14
+ Các tham chiếu khác trong Kinh Thánh, như 1 Nê Phi 5:4, 1 Nê Phi 11:14, An Ma 36:22, Hê La Man 5:48 và Giáo Lý và Giao Ước 137, có thể cung cấp thêm thông tin và phần nào làm sáng tỏ thêm về trải nghiệm của Lê Hi.
package/test-detect.js CHANGED
@@ -13,7 +13,7 @@ const langs = fs.readdirSync(`${__dirname}/test/data`)
13
13
 
14
14
  let callback = (string)=>{
15
15
  const verse_ids = lookupReference(string);
16
- console.log({verse_ids});
16
+ console.log({string,verse_ids});
17
17
  return `【❰ ${string} ❱】`
18
18
  }
19
19
 
@@ -22,7 +22,7 @@ for(const lang of langs){
22
22
  if(lang!=="en") setLanguage(lang);
23
23
  let lines = fs.readFileSync(`${__dirname}/test/data/${lang}.txt`,"utf-8").split("\n").map(i=>i.trim()).filter(x=>!!x);
24
24
  const hasAsterix = lines.some(i=>/^[*]/.test(i));
25
- if(hasAsterix) lines = lines.filter(i=>/^[*]/.test(i)).map(i=>i.replace(/^[*]/,""))
25
+ if(hasAsterix) lines = lines.filter(i=>/^[*]/.test(i)).map(i=>i.replace(/^[*]/,"").trim())
26
26
  for(const line of lines){
27
27
  const i = detectReferences(line,callback);
28
28
  console.log([i]);