scripture-guide 1.0.51 → 1.0.53

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.
@@ -11,8 +11,8 @@ const findMatches = (content,books,lang_extra) => {
11
11
  const tail = lang_extra.tail ? new RegExp(lang_extra.tail,"ig") : /[^0-9]+$/;
12
12
  const preBookMatch = lang_extra.book || `(First|I|1|1st|Second|II|2|2nd|Third|III|3|3rd|Fourth|IV|4|4th)*\\s*(books* of)*\\s*`;
13
13
  const matchingBooks = findMatchingBooks(content,books);
14
- const postBookMatch = lang_extra.chapter || "([0-9:.;,~ —–-]|cf)*[0-9]+";
15
- const fullBookMatches = matchingBooks.map(bookMatch=>{
14
+ const postBookMatch = lang_extra.chapter || "([0-9:.;,~ —–]|cf|(?:–))*[0-9]+";
15
+ const fullBookMatches = matchingBooks.map(bookMatch=>{
16
16
  const patternString = preBookMatch + bookMatch ;
17
17
  const pattern = (new RegExp(patternString,"ig"));
18
18
  const stringMatch = pattern.test(content) ? patternString : null;
@@ -62,9 +62,6 @@ const findMatches = (content,books,lang_extra) => {
62
62
  return [match,posIn,posOut];
63
63
  }
64
64
  )}).flat().filter(i=>!!i);
65
-
66
-
67
-
68
65
  const matchesWithReferences = possiblyOverlappingMatches.map(([string,start,end])=>{
69
66
  const overLappingItems = possiblyOverlappingMatches.filter(([s,s1,e1])=>s!==string && s1<end && e1>end);
70
67
  const hasOverlap = overLappingItems.length > 0;
@@ -72,7 +69,6 @@ const findMatches = (content,books,lang_extra) => {
72
69
  const newString = content.slice(start,newEnd);
73
70
  return newString.replace(tail,"").trim();
74
71
  }).filter(i=>!!i);
75
-
76
72
  const matches = matchesWithReferences.map(string=>{
77
73
  const pattern = (new RegExp(string,"ig"));
78
74
  const matches = content.match(pattern)?.map(i=>i.trim().replace(tail,""));
@@ -83,9 +79,6 @@ const findMatches = (content,books,lang_extra) => {
83
79
  if(prev.includes(current)) return prev;
84
80
  return [...prev,current]
85
81
  },[]).filter(i=>!!i);
86
-
87
-
88
-
89
82
  return matches;
90
83
  }
91
84
 
@@ -94,6 +87,7 @@ const findMatches = (content,books,lang_extra) => {
94
87
  function findMatchIndexes(content, matches,lookupReference, lang_extra) {
95
88
  const tail = lang_extra.tail ? new RegExp(lang_extra.tail,"ig") : /[^0-9]+$/;
96
89
  const indexes = matches
90
+ .sort((b, a) => b.length - a.length)
97
91
  .map(i=>{
98
92
  const length = i.length;
99
93
  let positions = [];
@@ -110,6 +104,7 @@ function findMatchIndexes(content, matches,lookupReference, lang_extra) {
110
104
  const substring = content.substring(a[0],a[1]).trim().replace(tail,"").trim();
111
105
  if(!substring) return false;
112
106
  const verse_ids = lookupReference(substring).verse_ids;
107
+ //console.log({substring,verse_ids});
113
108
  if(verse_ids.length > 0) return [a[0],a[0]+substring.length];
114
109
 
115
110
  return false;
@@ -121,6 +116,7 @@ function findMatchIndexes(content, matches,lookupReference, lang_extra) {
121
116
  end = nextStart ? Math.min(end,nextStart) : end;
122
117
  return [start,end];
123
118
  });
119
+
124
120
  if(!indexes.length) return false;
125
121
 
126
122
 
@@ -158,7 +154,7 @@ function findMatchIndexes(content, matches,lookupReference, lang_extra) {
158
154
  // They don't overlap, add the current pair
159
155
  return [...prev, current];
160
156
  }
161
- }, []);
157
+ }, []).filter(([start,end])=>start!==end);
162
158
 
163
159
 
164
160
  return nonOverlappingIndeces;
@@ -176,25 +172,16 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
176
172
  try{
177
173
  lang_extra = lang_extra || {};
178
174
  const matches = findMatches(content,books,lang_extra);
179
-
180
-
181
175
  const matchIndeces = findMatchIndexes(content,matches,lookupReference,lang_extra);
182
176
  if(!matchIndeces) return content;
183
-
184
-
185
177
  const gapsBetweenIndeces = matchIndeces.reduce((prev,current,index)=>{
186
178
  if(index === 0) return prev;
187
179
  const lastPair = matchIndeces[index-1];
188
180
  const gap = [lastPair[1],current[0]];
189
181
  return [...prev,gap];
190
182
  },[]);
191
-
192
183
  const gapStrings = gapsBetweenIndeces.map(([start,end])=>content.substring(start,end).trim());
193
-
194
-
195
-
196
-
197
-
184
+ //console.log({matches,matchIndeces,gapsBetweenIndeces,gapStrings});
198
185
  joiners = lang_extra.joiners || ["^[;, ]*(and|c\\.*f\\.*)*$"];
199
186
  const gapThatMayBeMerged = gapsBetweenIndeces.map(([start,end],i)=>{
200
187
  const gapString = gapStrings[i];
@@ -205,7 +192,6 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
205
192
  });
206
193
 
207
194
 
208
-
209
195
  // new incexes
210
196
  const mergedIndeces = matchIndeces.reduce((prev, current, index) => {
211
197
  if (index === 0) {
@@ -242,18 +228,16 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
242
228
 
243
229
 
244
230
  //check content between matches. If puctuation only (or 'and'), then merge
245
-
246
231
  const cutItems = mergedIndeces.map(([start,end])=>{
247
- return lookupReference(content.substring(start,end)).query
232
+ const string = content.substring(start,end);
233
+ return lookupReference(string).query
248
234
  }).map(callback);
249
235
 
250
236
  const negativeItems = negativeSpace.map(([start,end])=>content.substring(start,end));
251
-
252
237
  const firstReferenceIsAtStart = mergedIndeces[0][0] === 0;
253
238
  const maxCount = Math.max(cutItems.length,negativeItems.length);
254
239
  //merge by alternating cutItems and negativeItems. run the callback on the cut items
255
240
  const merged = [];
256
-
257
241
  for(i=0;i<maxCount;i++){
258
242
  const firstItem = firstReferenceIsAtStart ? cutItems[i] : negativeItems[i];
259
243
  const secondItem = firstReferenceIsAtStart ? negativeItems[i] : cutItems[i];
@@ -261,9 +245,7 @@ const processReferenceDetection = (content,books,lang_extra,lookupReference,call
261
245
  if(secondItem) merged.push(secondItem);
262
246
  }
263
247
 
264
-
265
248
  return merged.join("");
266
-
267
249
  }catch(e){
268
250
  return content;
269
251
  }
@@ -203,5 +203,10 @@ module.exports = {
203
203
  books:{
204
204
  "創世記": ["創世", "創世記"], "出エジプト記": ["出エ", "出エジプト記"], "レビ記": ["レビ", "レビ記"], "民数記": ["民数", "民数記"], "申命記": ["申命", "申命記"], "ヨシュア記": ["ヨシ", "ヨシュア記"], "士師記": ["士師", "士師記"], "ルツ記": ["ルツ", "ルツ記"], "サムエル記上": ["サ上", "サムエル記上"], "サムエル記下": ["サ下", "サムエル記下"], "列王紀上": ["列上", "列王紀上"], "列王紀下": ["列下", "列王紀下"], "歴代志上": ["歴上", "歴代志上"], "歴代志下": ["歴下", "歴代志下"], "エズラ記": ["エズ", "エズラ記"], "ネヘミヤ記": ["ネヘ", "ネヘミヤ記"], "エステル記": ["エス", "エステル記"], "ヨブ記": ["ヨブ", "ヨブ記"], "詩篇": ["詩篇"], "箴言": ["箴言"], "伝道の書": ["伝道", "伝道の書"], "雅歌": ["雅歌"], "イザヤ書": ["イザ", "イザヤ書"], "エレミヤ書": ["エレ", "エレミヤ書"], "哀歌": ["哀歌"], "エゼキエル書": ["エゼ", "エゼキエル書"], "ダニエル書": ["ダニ", "ダニエル書"], "ホセア書": ["ホセ", "ホセア書"], "ヨエル書": ["ヨエ", "ヨエル書"], "アモス書": ["アモ", "アモス書"], "オバデヤ書": ["オバ", "オバデヤ書"], "ヨナ書": ["ヨナ", "ヨナ書"], "ミカ書": ["ミカ", "ミカ書"], "ナホム書": ["ナホ", "ナホム書"], "ハバクク書": ["ハバ", "ハバクク書"], "ゼパニヤ書": ["ゼパ", "ゼパニヤ書"], "ハガイ書": ["ハガ", "ハガイ書"], "ゼカリヤ書": ["ゼカ", "ゼカリヤ書"], "マラキ書": ["マラ", "マラキ書"], "マタイによる福音書": ["マタ", "マタイによる福音書"], "マルコによる福音書": ["マコ", "マルコによる福音書"], "ルカによる福音書": ["ルカ", "ルカによる福音書"], "ヨハネによる福音書": ["ヨハ", "ヨハネによる福音書"], "使徒行伝": ["使徒", "使徒行伝"], "ローマ人への手紙": ["ロマ", "ローマ人への手紙"], "コリント人への第一の手紙": ["1コリ", "コリント人への第一の手紙"], "コリント人への第二の手紙": ["2コリ", "コリント人への第二の手紙"], "ガラテヤ人への手紙": ["ガラ", "ガラテヤ人への手紙"], "エペソ人への手紙": ["エペ", "エペソ人への手紙"], "ピリピ人への手紙": ["ピリ", "ピリピ人への手紙"], "コロサイ人への手紙": ["コロ", "コロサイ人への手紙"], "テサロニケ人への第一の手紙": ["1テサ", "テサロニケ人への第一の手紙"], "テサロニケ人への第二の手紙": ["2テサ", "テサロニケ人への第二の手紙"], "テモテへの第一の手紙": ["1テモ", "テモテへの第一の手紙"], "テモテへの第二の手紙": ["2テモ", "テモテへの第二の手紙"], "テトスへの手紙": ["テト", "テトスへの手紙"], "ピレモンへの手紙": ["ピレ", "ピレモンへの手紙"], "ヘブル人への手紙": ["ヘブ", "ヘブル人への手紙"], "ヤコブの手紙": ["新ヤコ", "ヤコブの手紙"], "ペテロの第一の手紙": ["1ペテ", "ペテロの第一の手紙"], "ペテロの第二の手紙": ["2ペテ", "ペテロの第二の手紙"], "ヨハネの第一の手紙": ["1ヨハ", "ヨハネの第一の手紙"], "ヨハネの第二の手紙": ["2ヨハ", "ヨハネの第二の手紙"], "ヨハネの第三の手紙": ["3ヨハ", "ヨハネの第三の手紙"], "ユダの手紙": ["ユダ", "ユダの手紙"], "ヨハネの黙示録": ["黙示", "ヨハネの黙示録"], "ニーファイ第一書": ["1ニフ", "ニーファイ第一書"], "ニーファイ第二書": ["2ニフ", "ニーファイ第二書"], "ヤコブ書": ["ヤコ", "ヤコブ書"], "エノス書": ["エノ", "エノス書"], "ジェロム書": ["ジェロ", "ジェロム書"], "オムナイ書": ["オム", "オムナイ書"], "モルモンの言葉": ["モ言", "モルモンの言葉"], "モーサヤ書": ["モサ", "モーサヤ書"], "アルマ書": ["アル", "アルマ書"], "ヒラマン書": ["ヒラ", "ヒラマン書"], "第三ニーファイ": ["3ニフ", "第三ニーファイ"], "第四ニーファイ": ["4ニフ", "第四ニーファイ"], "モルモン書": ["モル", "モルモン書"], "エテル書": ["エテ", "エテル書"], "モロナイ書": ["モロ", "モロナイ書"], "教義と聖約": ["教義", "教義と聖約"], "公式の宣言": ["公式"], "モーセ書": ["モセ", "モーセ書"], "アブラハム書": ["アブ", "アブラハム書"], "ジョセフ・スミス—マタイ": ["ジ—マタ", "ジョセフ・スミス—マタイ"], "ジョセフ・スミス—歴史": ["ジ—歴史", "ジョセフ・スミス—歴史"], "信仰箇条": ["箇条", "信仰箇条"]
205
205
  }
206
+ },
207
+ eo: {
208
+ books:
209
+ { "Genezo": ["Gen"], "Eliro": ["Eli"], "Levidoj": ["Lev"], "Nombroj": ["Nom"], "Readmono": ["Rea"], "Josuo": ["Jos"], "Juĝistoj": ["Juĝ"], "Rut": ["Rut"], "1 Samuel": ["1 Sam"], "2 Samuel": ["2 Sam"], "1 Reĝoj": ["1 Reĝ"], "2 Reĝoj": ["2 Reĝ"], "1 Kroniko": ["1 Kron"], "2 Kroniko": ["2 Kron"], "Ezra": ["Ezr"], "Neĥemja": ["Neĥ"], "Ester": ["Est"], "Ijob": ["Ijob"], "Psalmaro": ["Ps"], "Sentencoj": ["Sent"], "Predikanto": ["Pred"], "Alt Kanto": ["Alt"], "Jesaja": ["Jes"], "Jeremia": ["Jer"], "Plorkanto": ["Plork"], "Jeĥezkel": ["Jeĥ"], "Daniel": ["Dan"], "Hoŝea": ["Hoŝ"], "Joel": ["Joel"], "Amos": ["Amos"], "Obadja": ["Obad"], "Jona": ["Jon"], "Miĥa": ["Miĥ"], "Naĥum": ["Naĥ"], "Ĥabakuk": ["Ĥab"], "Cefanja": ["Cef"], "Ĥagaj": ["Ĥag"], "Zeĥarja": ["Zeĥ"], "Malaĥi": ["Mal"], "Mateo": ["Mat"], "Marko": ["Mar"], "Luko": ["Luk"], "Johano": ["Joh"], "Agoj": ["Agoj"], "Romanoj": ["Rom"], "1 Korintanoj": ["1 Kor"], "2 Korintanoj": ["2 Kor"], "Galatoj": ["Gal"], "Efesanoj": ["Ef"], "Filipianoj": ["Fil"], "Koloseanoj": ["Kol"], "1 Tesalonikanoj": ["1 Tes"], "2 Tesalonikanoj": ["2 Tes"], "1 Timoteo": ["1 Tim"], "2 Timoteo": ["2 Tim"], "Tito": ["Tit"], "Filemon": ["Fil"], "Hebreoj": ["Heb"], "Jakobo": ["Jak"], "1 Petro": ["1 Pet"], "2 Petro": ["2 Pet"], "1 Johano": ["1 Joh"], "2 Johano": ["2 Joh"], "3 Johano": ["3 Joh"], "Judas": ["Jud"], "Apokalipso": ["Apok"]
210
+ }
206
211
  }
207
212
  }
@@ -164,6 +164,7 @@ module.exports = {
164
164
  ["([a-z]),*\\s*\\b(?:chapt*ers*|ch|chptrs*)\\s*([0-9])", "$1 $2"],
165
165
  ["[()]+", " "],
166
166
  ["[\\s.]*[–—−\\-]+[\\s.]*", "-"],
167
+ ["&ndash;", "-"],
167
168
  ["([;,])\\s*and\\s*", "$1"],
168
169
  ["([0-9])[ .]*and[ .]*", "$1,"],
169
170
  ["(\\d)(\\.|: )(\\d)", "$1:$3"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scripture-guide",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
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/scriptures.js CHANGED
@@ -237,10 +237,9 @@ const cleanReference = function(messyReference) {
237
237
  const handleSingleChapterBookRefs = function(ref) {
238
238
 
239
239
  const singleChapterBooks = Object.keys(raw_index).filter(book => loadMaxChapter(book) == 1);
240
- const matchingBooks = singleChapterBooks.filter(book => ref.match(new RegExp(`^${book} \\d+`)));
241
- ref = matchingBooks.reduce((ref,book) => ref.replace(new RegExp(`^${book} (\\d+)`),`${book} 1:$1`),ref);
242
-
243
- return ref;
240
+ const [matchingBook] = singleChapterBooks.filter(book => ref.match(new RegExp(`^${book} \\d+`)));
241
+ ref = ref.replace(new RegExp(`^${matchingBook} ([^:]+)$`),`${matchingBook} 1:$1`);
242
+ return ref;
244
243
  }
245
244
 
246
245
  const splitReferences = function(compoundReference) {
@@ -567,6 +566,7 @@ module.exports = {
567
566
  verseId2Ref: generateReference,
568
567
 
569
568
  detect: detectReferences,
569
+ detectScriptureReferences: detectReferences,
570
570
  detectRefs: detectReferences,
571
571
  detectScriptures: detectReferences,
572
572
  linkRefs: detectReferences,
package/test/data/en.txt CHANGED
@@ -1,33 +1,2 @@
1
- Alma 10:3 specifies that Lehi is of Manasseh.
2
- see 3 Nephi 5:25 and 3 Nephi 20:13 to see
3
- Thank you for sharing your word thoughts, Lyndon. It’s fascinating to explore the deeper meaning of words and their potential impact on our understanding of scripture. In 3 Nephi 16:4-5, the phrase “fulness of the Gentiles” is indeed significant. It refers to the time when the Gentiles, or nations, will receive the gospel of Jesus Christ and have the opportunity to come unto Him. This concept is further supported by other scriptures, such as 3 Nephi 21:6, which speaks of the Father showing forth His power to the Gentiles and inviting them to repent and be baptized. Additionally, 3 Nephi 5:25 and 3 Nephi 20:13 mention the gathering of scattered remnants and the restoring of the house of Jacob, which includes both the Israelites and the Gentiles who have embraced the gospel. The translation process was guided by the Spirit, ensuring that the essential teachings and principles are conveyed accurately. Whether we use the word “multitude” or “fullness” to describe the Gentiles, the central message remains the same – that all people, regardless of their lineage, have the opportunity to come unto Christ and be partakers of His blessings. In summary, the phrase “fulness of the Gentiles” in 3 Nephi 16:4-5 signifies the time when the Gentiles will have the chance to receive the gospel and be gathered in. It aligns with other scriptures that speak of the gathering of scattered remnants and the restoration of the house of Jacob.
4
- It talks about the consequences of the fall of Adam and Eve. Before the fall, if they had not partaken of the forbidden fruit, they would have remained in a state of innocence and ignorance, without experiencing the joy and blessings that come from knowing good and evil (II Nephi 2:23). However, Heavenly Father, in His wisdom, allowed Adam to fall so that mankind could be created and experience the fullness of joy (2 Nephi 2:25). This passage is connected to other scriptures such as Genesis 3:16 and Moses 5:11, which further explain the consequences of the fall. In Genesis 3:16, Eve is told that because of the fall, she will experience sorrow in childbirth, indicating that the ability to have children is a result of the fall. In Moses 5:11, Eve expresses her gratitude for the fall, recognizing that without it, she and Adam would not have had children or known the joy of redemption. Understanding this passage helps us comprehend the purpose of life and the role of the fall in enabling us to experience joy and progression.
5
- See John3:16 and, but not First John 1:9 for the same concept of the fall and the atonement.
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
- 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.
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
10
- The Nephites thought of themselves as living on an island, and they believed that other groups of Israelites had been led away by God to other islands as well; see 1 Ne 19.10,15–16;21.1,8;22.3–4;2 Ne 10.7–8;29.7. Note also the mention of “isles” in Isa 51.5, which Jacob quoted at 2 Ne 8.5.
11
- There is a difference between being reconciled to the will of God (accepting the contingencies of salvation history, even as they may apply negatively to one’s posterity), unique here, and being reconciled unto God (repenting of personal sins in accordance with the plan of salvation), which occurs three times in the NT and four times in the BoM. In the NT, God always reconciles humans to himself through Christ; the BoM, by contrast, invites people to reconcile themselves to God, by availing themselves of Christ’s atonement; cf. 2 Nephi 33.9; Jacob 4.11. Nevertheless, even if salvation requires an element of human volition, the process is initiated and completed through the grace of God; see 2 Nephi 25.23n.
12
- See Deut 30.19; Jacob2 draws on Lehi1’s elaboration at 2 Ne 2.26–29 as well as on Jeremiah’s allusion at Jer 21.8.
13
- In 2 Nephi 9:13 it says, "O how great the plan of our God!" Hugh Nibley notes that the word "plan" is not found in the Bible, yet it's found forty-two times in the Book of Mormon . . . and thirty-six times in the book of Alma. . . . Origen tells us that in the early church they taught that you earned your position here before you came here. So whatever happened to the plan? How did it drop out of the Bible? . . . When the temple was lost the rabbis took over. They were learned men but they were not priests. . . . The philosophers at the School of Alexandria took it over, and in their place you have the doctrines of St. Augustine--this takes the place of the plan. That is, you are predestined to damnation or you are predestined to salvation. . . . This predestination doctrine of St. Augustine was taken over by the Lutherans and by the Calvinists especially. What happens to you is because you were predestined that way. Of course, you didn't live before you came here; you didn't earn it or anything like that. . . . All creation had to be instantaneously, simultaneously complete. Everything was completely there all at once, so you had no background or anything. [Hugh W. Nibley, Teachings of the Book of Mormon, pp. 295-296] [See the commentary on Jarom 1:2; Alma 22:13]
14
- Isa 61.10; 2 Ne 4.33.
15
- WB includes “hindrance, opposition,” though both Jacob and Nephi knew of Jesus’s future crucifixion; see 2 Nephi 6.9;1 Ne 11.33;19.10.
16
-
17
- “to choose the way of everlasting death or the way of eternal life” • See Deut 30.19; Jacob2 draws on Lehi1’s elaboration at 2 Ne 2.26–29 as well as on Jeremiah’s allusion at Jer 21.8.
18
- Note Source
19
- Jacob concludes by referencing the plan of salvation; see 2 Nephi 9.53–54n.
20
- Note Source
21
- A synopsis of Lehi’s words at 2 Nephi 2.26–29, which were an elaboration of Deut 30.19. Here, however, the expression is conflated with Jeremiah’s interpretation of the same Deut verse at Jer 21.8: “I set before you the way of life, and the way of death.”
22
- Note Source
23
- There is a difference between being reconciled to the will of God (accepting the contingencies of salvation history, even as they may apply negatively to one’s posterity), unique here, and being reconciled unto God (repenting of personal sins in accordance with the plan of salvation), which occurs three times in the NT and four times in the BoM. In the NT, God always reconciles humans to himself through Christ; the BoM, by contrast, invites people to reconcile themselves to God, by availing themselves of Christ’s atonement; cf. 2 Nephi 33.9; Jacob 4.11. Nevertheless, even if salvation requires an element of human volition, the process is initiated and completed through the grace of God; see 2 Nephi 25.23n.
24
- Note Source
25
- WB includes “hindrance, opposition,” though both Jacob and Nephi knew of Jesus’s future crucifixion; see 2 Nephi 6.9;1 Ne 11.33;19.10.
26
- “Everlasting death” • Here and in 2 Nephi 10:23, can be contrasted with the temporary death that everyone will experience and then be rescued from by the Resurrection. Elsewhere the BoM uses the term “second death” to describe the post-resurrection, post-judgment separation from God that will never end (e.g., Alma 12.32: “a second death, which was an everlasting death”).
27
- The combination of repentance, baptism, faith, and enduring to the end (along with the Holy Ghost) is identified as the doctrine of Christ at 2 Nephi 31.2–21, and the essence of the gospel at 3 Ne 27.13–22. Although Jacob in these two verses, and later Nephi (in ch. 31), speaks in general, abstract terms about baptism, there are no recorded baptisms in the BoM until Alma baptizes at Mos 18, nearly four hundred years later, where the practice appears to be something new.
28
- <p>In the Joseph Smith Translation of the Bible, we read that “the Lord hath visited” Joseph, the son of Jacob spoken of in the Old Testament, and that Joseph was given great promises concerning his posterity (JST, Genesis 50:24). As Lehi testified, “Joseph truly saw our day” (2 Nephi 3:5), meaning the day of Lehi and his posterity, and knew that in the future God would raise up “a choice seer” (verse 7), namely the great prophet who was his namesake (see verse 15). Joseph knew also that it would be primarily his descendants whom the Lord would call upon first in these last days to carry the gospel to additional lost members of the house of Israel scattered among the nations of the earth, in compliance with the covenant God made with Abraham (see Bible Dictionary, “Joseph,” 716–17; Guide to the Scriptures, “Joseph, Son of Jacob”). Obviously, since the Lord kept His covenant with Joseph, He will also keep His covenants with us if we are righteous as well.</p><p>Lehi’s teaching is a great example of how Heavenly Father honored the covenant He made with Joseph. We can have the confidence that God will always honor His covenants.</p>
29
- It is well to remember that the word Nephite apparently had a different meaning near the close of the Book of Mormon than it did before A.D. 231. (See 4 Nephi 20, 36-39.) From approximately 544 B.C. to A.D. 34 (Jacob 1:13-14) the term Nephite referred either to the descendants of Nephi and those who went with him into the wilderness (2 Nephi 5:5-8) or to those who joined with this group. From about A.D. 34 to nearly A.D. 194, there were not “any manner of -ites” among the descendants of Lehi. (4 Nephi 17.) By A.D. 194, however, a group of people revolted from the church and took upon themselves the name of Lamanites (4 Nephi 20), and by A.D. 231 those who had remained true to the church became known as Nephites (4 Nephi 36). For the remainder of the Book of Mormon, the term Nephite apparently refers to the descendants of those who had been faithful in A.D. 231.
30
- *<p>The Land of Zarahemla represents a central and pivotal region in the historical narrative laid out in the Book of Mormon. Situated in the northern part of the land southward, this area was intersected by the River Sidon (Alma 2:15) and became a melting pot of various peoples, cultures, and political change. Initially founded by the Mulekites, who departed from the Old World and eventually migrated from their landing site in the land to the north, the land of Zarahemla was established in the sixth century B.C. (Omni 1:15, Alma 22:29-31). The city of Zarahemla and its people, led by a man named Zarahemla, were discovered by Mosiah1 and the Nephites around 200 B.C. as they fled the land of Nephi, leading to the unification of the two groups under Mosiah’s kingship (Omni 1:12-19).</p><p>The land and its capital city played host to pivotal historical events including the establishment of churches by Alma1, the commencement of the reign of judges with Alma2 as the first chief judge, and as the stage for military confrontations and the preaching of prophets such as Samuel the Lamanite (Mosiah 25:15-23, Mosiah 29:42, Hel. 13–16). It faced invasions and periods of occupation by the Lamanites interspersed with times of peace and righteous leadership (Alma 61-62:9, Hel. 1:14-33, Hel. 4:1-17).</p><p>The land of Zarahemla was eventually destroyed by fire during the cataclysmic events that accompanied the death of Jesus Christ (3 Ne. 8:8, 24; 9:3). Nonetheless, it was rebuilt and flourished in the first century A.D., only for its population and structures to be overwhelmed once more by conflicts between the Nephites and the Lamanites, leading up to Mormon’s narrative in the fourth century A.D. (4 Ne. 1:8, Morm. 1:6-7, Morm. 1:10). The Land of Zarahemla, as recounted in the Book of Mormon, stands as a witness to cycles of righteousness and wickedness, prosperity and desolation, and functions as a profound symbol within the overarching sacred history depicted in the text.</p>
31
- From an infrastructural standpoint, the city of Nephi, or Lehi-Nephi, served as the principal hub, established by Nephi1 after his separation from his brethren and later inhabited by Zeniffite Nephite colonists under various rulers such as Zeniff, Noah3, and Limhi. The city’s location is inferred to be in a mountainous valley, given descriptions of the physical exertions related to traveling there, suggesting pronounced topographical features (Mosiah 7:2–6; cf. 9:3).
32
- Concerning the message of the Spirit to Nephi: “It is better that one man should perish than that a nation should dwindle and perish in unbelief” (1 Nephi 4:13), John Welch and Heidi Parker produce recent research which shows that this “one for many” principle operated from a time much earlier in the Israelite culture.
33
-
1
+ see 1 Nephi 13:12 and 1 Nephi 13
2
+ * separately under 2 Nephi 2:10&ndash;11 in part 1
package/test-detect.js CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
2
  const { setLanguage, detectReferences, lookupReference}= require("./scriptures.js");
3
+ //clear console
4
+ console.clear();
3
5
  const fs = require("fs");
4
6
  const paramLang = process.argv[2] || "en";
5
7
  const langs = fs.readdirSync(`${__dirname}/test/data`)