mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-23 07:19:50 -04:00
update the data to use colons instead of semi-colons for reference keys
This commit is contained in:
parent
528855895d
commit
1cd1fc7edf
@ -52,6 +52,7 @@ namespace DynamicBibleUtility
|
||||
private readonly List<string> _exclusions = new List<string> { "us", "these", "her", "saith", "shalt", "let", "do", "your", "we", "no", "go", "if", "at", "an", "so", "before", "also", "on", "had", "you", "there", "then", "up", "by", "upon", "were", "are", "this", "when", "thee", "their", "ye", "will", "as", "thy", "my", "me", "have", "from", "was", "but", "which", "thou", "all", "it", "with", "them", "him", "they", "is", "be", "not", "his", "i", "shall", "a", "for", "unto", "he", "in", "to", "that", "of", "and", "the" };
|
||||
private readonly char[] _trims = { '\'', ',', ':', ';', '"', '?', '.', '[', ']', '{', '}', '<', '>', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '_', '=', '+' };
|
||||
private readonly HashSet<char> _uppers = new HashSet<char> { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
|
||||
private readonly string _referenceDelimiter = ":";
|
||||
|
||||
public delegate void UpdateStatusDelegate(string status);
|
||||
|
||||
@ -349,7 +350,7 @@ namespace DynamicBibleUtility
|
||||
var first = true;
|
||||
foreach (XNode o in vs.Nodes())
|
||||
{
|
||||
List<Text> words = ProcessText(o, bk.bk + ";" + ch.ch + ";" + v.v);
|
||||
List<Text> words = ProcessText(o, $"{bk.bk}{_referenceDelimiter}{ch.ch}{_referenceDelimiter}{v.v}");
|
||||
// handle lowercasing the word if its not the start of a sentence
|
||||
if (
|
||||
words.Count > 0 &&
|
||||
@ -387,7 +388,7 @@ namespace DynamicBibleUtility
|
||||
if (curr.t.Trim().Contains(" "))
|
||||
{
|
||||
prev.t += curr.t.Trim().Substring(0, curr.t.Trim().IndexOf(" "));
|
||||
curr.t = curr.t.Trim().Substring(curr.t.Trim().IndexOf(" ")); ; // you want to join the two words.
|
||||
curr.t = curr.t.Trim().Substring(curr.t.Trim().IndexOf(" ")); // you want to join the two words.
|
||||
}
|
||||
else
|
||||
|
||||
@ -514,7 +515,7 @@ namespace DynamicBibleUtility
|
||||
File.AppendAllLines("errata.txt", new List<string> { "Multiple strongs numbers found: " + location + ", " + tv });
|
||||
}
|
||||
var sn = val.Trim('*', ' ');
|
||||
if (int.Parse(location.ParseToIndexOf(";")) < 40)
|
||||
if (int.Parse(location.ParseToIndexOf(_referenceDelimiter)) < 40)
|
||||
{
|
||||
if (!this.hebCrossRefs.ContainsKey(sn))
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ export class AppService extends createStateService(reducer, initialState) {
|
||||
let url = `${dict}${Math.ceil(sn / 100)}.json`;
|
||||
try {
|
||||
const d = await this.http
|
||||
.get<StrongsDefinition[]>('assets/data/strongs/' + url)
|
||||
.get<StrongsDefinition[]>(`${this.dataPath}/strongs/${url}`)
|
||||
.toPromise();
|
||||
result.def = d.find((el) => el.i === result.prefix + result.sn);
|
||||
} catch (err) {
|
||||
@ -297,29 +297,12 @@ export class AppService extends createStateService(reducer, initialState) {
|
||||
|
||||
try {
|
||||
const d = await this.http
|
||||
.get<StrongsCrossReference[]>(`assets/data/strongscr/cr${url}`)
|
||||
.get<StrongsCrossReference[]>(`${this.dataPath}/strongscr/cr${url}`)
|
||||
.toPromise();
|
||||
for (const cr of d) {
|
||||
if (cr.id.toUpperCase() === result.prefix + result.sn) {
|
||||
result.crossrefs = {
|
||||
id: cr.id, // strongs id H1|G1
|
||||
t: cr.t, // strongs testament grk|heb
|
||||
d: cr.d, // strongs word/data definition Aaron {ah-ar-ohn'}
|
||||
ss: cr.ss.map((ss) => {
|
||||
return {
|
||||
w: ss.w, // translated word
|
||||
rs: ss.rs.map((rs) => {
|
||||
return {
|
||||
r: rs.r.split(';').join(':'), // fix the reference...
|
||||
};
|
||||
}),
|
||||
};
|
||||
}),
|
||||
};
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
result.crossrefs = d.find(
|
||||
(o) => o.id.toUpperCase() === result.prefix + result.sn
|
||||
);
|
||||
} catch (err) {
|
||||
this.dispatchError(
|
||||
`Unable to retrieve Strong\'s Cross References for ${result.prefix}${result.sn}`
|
||||
@ -329,40 +312,42 @@ export class AppService extends createStateService(reducer, initialState) {
|
||||
}
|
||||
|
||||
if (dict === 'grk') {
|
||||
url = `assets/data/rmac/rs${Math.ceil(sn / 1000)}.json`;
|
||||
let rmacCrossReferences: RMACCrossReference[];
|
||||
url = `${this.dataPath}/rmac/rs${Math.ceil(sn / 1000)}.json`;
|
||||
|
||||
// rmac is a two get process.
|
||||
|
||||
// first, get the rmac code.
|
||||
try {
|
||||
const d = await this.http.get<RMACCrossReference[]>(url).toPromise();
|
||||
rmacCrossReferences = d;
|
||||
const rmacCrossReferences = await this.http
|
||||
.get<RMACCrossReference[]>(url)
|
||||
.toPromise();
|
||||
|
||||
// deal with RMAC
|
||||
const referencesForThisStrongsNumber = rmacCrossReferences.filter(
|
||||
(el, i) => {
|
||||
return el.i === sn.toString();
|
||||
}
|
||||
);
|
||||
|
||||
if (referencesForThisStrongsNumber.length === 0) {
|
||||
return result;
|
||||
}
|
||||
result.rmaccode = referencesForThisStrongsNumber[0].r;
|
||||
} catch (err) {
|
||||
this.dispatchError('Unable to retrieve RMAC');
|
||||
return;
|
||||
}
|
||||
|
||||
// deal with RMAC
|
||||
const tmp = rmacCrossReferences.filter((el, i) => {
|
||||
return el.i === sn + '';
|
||||
});
|
||||
|
||||
if (tmp.length === 0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result.rmaccode = tmp[0].r;
|
||||
// if you were able to get the rmac code, then get the related definition.
|
||||
if (result.rmaccode !== undefined) {
|
||||
url = `assets/data/rmac/r-${result.rmaccode.substring(0, 1)}.json`;
|
||||
url = `${this.dataPath}/rmac/r-${result.rmaccode.substring(0, 1)}.json`;
|
||||
|
||||
try {
|
||||
const d = await this.http.get<RMACDefinition[]>(url).toPromise();
|
||||
for (const rmac of d) {
|
||||
if (rmac.id.toLowerCase() === result.rmaccode) {
|
||||
result.rmac = rmac;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const rmacDefinitions = await this.http
|
||||
.get<RMACDefinition[]>(url)
|
||||
.toPromise();
|
||||
result.rmac = rmacDefinitions.find(
|
||||
(o) => o.id.toLowerCase() === result.rmaccode
|
||||
);
|
||||
} catch (err) {
|
||||
this.dispatchError('Unable to retrieve RMAC');
|
||||
return;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
[{"id":"G3201","t":"grk","d":"","ss":[{"w":"fault","rs":[{"r":"41;7;2"},{"r":"45;9;19"},{"r":"58;8;8"}]}]},{"id":"G3202","t":"grk","d":"","ss":[{"w":"complainers","rs":[{"r":"65;1;16"}]}]},{"id":"G3303","t":"grk","d":"","ss":[{"w":"a","rs":[{"r":"44;9;7"},{"r":"46;1;23"}]},{"w":"all","rs":[{"r":"46;9;24"}]},{"w":"am","rs":[{"r":"47;10;1"}]},{"w":"an","rs":[{"r":"50;1;28"}]},{"w":"and","rs":[{"r":"44;17;30"}]},{"w":"another","rs":[{"r":"40;22;5"}]},{"w":"are","rs":[{"r":"56;1;15"}]},{"w":"as","rs":[{"r":"44;28;22"},{"r":"45;11;13"}]},{"w":"barnabas","rs":[{"r":"44;14;12"}]},{"w":"behind","rs":[{"r":"50;3;13"}]},{"w":"being","rs":[{"r":"44;13;4"},{"r":"44;15;3"}]},{"w":"concerning","rs":[{"r":"45;11;28"}]},{"w":"desire","rs":[{"r":"45;10;1"}]},{"w":"even","rs":[{"r":"52;2;18"}]},{"w":"every","rs":[{"r":"58;10;11"}]},{"w":"first","rs":[{"r":"58;7;2"},{"r":"59;3;17"}]},{"w":"from","rs":[{"r":"55;4;4"}]},{"w":"have","rs":[{"r":"44;1;1"},{"r":"44;27;21"}]},{"w":"he","rs":[{"r":"44;13;36"},{"r":"44;17;17"},{"r":"44;23;18"},{"r":"48;4;23"},{"r":"58;8;4"},{"r":"60;4;14"}]},{"w":"here","rs":[{"r":"58;7;8"}]},{"w":"i","rs":[{"r":"44;25;11"},{"r":"45;1;8"},{"r":"46;1;12"},{"r":"46;3;4"}]},{"w":"indeed","rs":[{"r":"40;3;11"},{"r":"40;13;32"},{"r":"40;20;23"},{"r":"40;23;27"},{"r":"40;26;41"},{"r":"41;1;8"},{"r":"41;10;39"},{"r":"41;14;21"},{"r":"42;3;16"},{"r":"42;11;48"},{"r":"42;23;41"},{"r":"44;4;16"},{"r":"44;11;16"},{"r":"44;22;9"},{"r":"45;6;11"},{"r":"45;14;20"},{"r":"46;11;7"},{"r":"47;8;17"},{"r":"50;1;15"},{"r":"50;3;1"},{"r":"51;2;23"},{"r":"60;2;4"}]},{"w":"is","rs":[{"r":"45;8;10"},{"r":"46;15;40"}]},{"w":"it","rs":[{"r":"40;26;24"},{"r":"42;13;9"},{"r":"44;18;14"},{"r":"46;9;25"}]},{"w":"kind","rs":[{"r":"46;15;39"}]},{"w":"letters","rs":[{"r":"47;10;10"}]},{"w":"man","rs":[{"r":"45;14;5"}]},{"w":"myself","rs":[{"r":"45;7;25"}]},{"w":"obey","rs":[{"r":"45;2;8"}]},{"w":"of","rs":[{"r":"45;8;17"},{"r":"60;2;14"}]},{"w":"on","rs":[{"r":"45;11;22"}]},{"w":"one","rs":[{"r":"40;21;35"},{"r":"40;22;5"},{"r":"40;25;15"},{"r":"42;23;33"},{"r":"45;9;21"},{"r":"45;14;2"},{"r":"46;7;7"},{"r":"46;11;21"},{"r":"46;12;8"},{"r":"47;2;16"},{"r":"48;4;24"},{"r":"50;1;16"}]},{"w":"outwardly","rs":[{"r":"40;23;28"}]},{"w":"part","rs":[{"r":"44;14;4"}]},{"w":"partly","rs":[{"r":"58;10;33"}]},{"w":"say","rs":[{"r":"40;16;14"}]},{"w":"so","rs":[{"r":"44;16;5"}]},{"w":"some","rs":[{"r":"40;13;4"},{"r":"40;13;8"},{"r":"40;13;23"},{"r":"41;4;4"},{"r":"41;12;5"},{"r":"42;8;5"},{"r":"43;7;12"},{"r":"44;17;32"},{"r":"44;28;24"},{"r":"46;12;28"},{"r":"49;4;11"},{"r":"55;2;20"},{"r":"65;1;22"}]},{"w":"the","rs":[{"r":"40;16;3"},{"r":"44;23;8"},{"r":"45;5;16"},{"r":"60;3;18"}]},{"w":"then","rs":[{"r":"41;16;19"},{"r":"44;23;22"}]},{"w":"therefore","rs":[{"r":"43;16;22"}]},{"w":"they","rs":[{"r":"44;8;25"},{"r":"65;1;10"}]},{"w":"thing","rs":[{"r":"44;19;32"}]},{"w":"truly","rs":[{"r":"40;9;37"},{"r":"40;17;11"},{"r":"41;14;38"},{"r":"42;10;2"},{"r":"42;22;22"},{"r":"43;20;30"},{"r":"44;1;5"},{"r":"44;3;22"},{"r":"44;5;23"},{"r":"47;12;12"},{"r":"58;7;23"},{"r":"58;11;15"}]},{"w":"verily","rs":[{"r":"41;9;12"},{"r":"44;19;4"},{"r":"44;22;3"},{"r":"44;26;9"},{"r":"45;2;25"},{"r":"46;5;3"},{"r":"46;14;17"},{"r":"58;3;5"},{"r":"58;6;16"},{"r":"58;7;5"},{"r":"58;7;18"},{"r":"58;9;1"},{"r":"58;12;10"},{"r":"60;1;20"}]},{"w":"was","rs":[{"r":"44;12;5"}]},{"w":"wedding","rs":[{"r":"40;22;8"}]},{"w":"were","rs":[{"r":"44;15;30"}]},{"w":"when","rs":[{"r":"46;11;18"},{"r":"48;4;8"}]},{"w":"which","rs":[{"r":"44;21;39"}]},{"w":"who","rs":[{"r":"45;2;7"}]},{"w":"ye","rs":[{"r":"46;6;4"}]}]}]
|
||||
[{"id":"G3201","t":"grk","d":"","ss":[{"w":"fault","rs":[{"r":"41:7:2"},{"r":"45:9:19"},{"r":"58:8:8"}]}]},{"id":"G3202","t":"grk","d":"","ss":[{"w":"complainers","rs":[{"r":"65:1:16"}]}]},{"id":"G3303","t":"grk","d":"","ss":[{"w":"a","rs":[{"r":"44:9:7"},{"r":"46:1:23"}]},{"w":"all","rs":[{"r":"46:9:24"}]},{"w":"am","rs":[{"r":"47:10:1"}]},{"w":"an","rs":[{"r":"50:1:28"}]},{"w":"and","rs":[{"r":"44:17:30"}]},{"w":"another","rs":[{"r":"40:22:5"}]},{"w":"are","rs":[{"r":"56:1:15"}]},{"w":"as","rs":[{"r":"44:28:22"},{"r":"45:11:13"}]},{"w":"barnabas","rs":[{"r":"44:14:12"}]},{"w":"behind","rs":[{"r":"50:3:13"}]},{"w":"being","rs":[{"r":"44:13:4"},{"r":"44:15:3"}]},{"w":"concerning","rs":[{"r":"45:11:28"}]},{"w":"desire","rs":[{"r":"45:10:1"}]},{"w":"even","rs":[{"r":"52:2:18"}]},{"w":"every","rs":[{"r":"58:10:11"}]},{"w":"first","rs":[{"r":"58:7:2"},{"r":"59:3:17"}]},{"w":"from","rs":[{"r":"55:4:4"}]},{"w":"have","rs":[{"r":"44:1:1"},{"r":"44:27:21"}]},{"w":"he","rs":[{"r":"44:13:36"},{"r":"44:17:17"},{"r":"44:23:18"},{"r":"48:4:23"},{"r":"58:8:4"},{"r":"60:4:14"}]},{"w":"here","rs":[{"r":"58:7:8"}]},{"w":"i","rs":[{"r":"44:25:11"},{"r":"45:1:8"},{"r":"46:1:12"},{"r":"46:3:4"}]},{"w":"indeed","rs":[{"r":"40:3:11"},{"r":"40:13:32"},{"r":"40:20:23"},{"r":"40:23:27"},{"r":"40:26:41"},{"r":"41:1:8"},{"r":"41:10:39"},{"r":"41:14:21"},{"r":"42:3:16"},{"r":"42:11:48"},{"r":"42:23:41"},{"r":"44:4:16"},{"r":"44:11:16"},{"r":"44:22:9"},{"r":"45:6:11"},{"r":"45:14:20"},{"r":"46:11:7"},{"r":"47:8:17"},{"r":"50:1:15"},{"r":"50:3:1"},{"r":"51:2:23"},{"r":"60:2:4"}]},{"w":"is","rs":[{"r":"45:8:10"},{"r":"46:15:40"}]},{"w":"it","rs":[{"r":"40:26:24"},{"r":"42:13:9"},{"r":"44:18:14"},{"r":"46:9:25"}]},{"w":"kind","rs":[{"r":"46:15:39"}]},{"w":"letters","rs":[{"r":"47:10:10"}]},{"w":"man","rs":[{"r":"45:14:5"}]},{"w":"myself","rs":[{"r":"45:7:25"}]},{"w":"obey","rs":[{"r":"45:2:8"}]},{"w":"of","rs":[{"r":"45:8:17"},{"r":"60:2:14"}]},{"w":"on","rs":[{"r":"45:11:22"}]},{"w":"one","rs":[{"r":"40:21:35"},{"r":"40:22:5"},{"r":"40:25:15"},{"r":"42:23:33"},{"r":"45:9:21"},{"r":"45:14:2"},{"r":"46:7:7"},{"r":"46:11:21"},{"r":"46:12:8"},{"r":"47:2:16"},{"r":"48:4:24"},{"r":"50:1:16"}]},{"w":"outwardly","rs":[{"r":"40:23:28"}]},{"w":"part","rs":[{"r":"44:14:4"}]},{"w":"partly","rs":[{"r":"58:10:33"}]},{"w":"say","rs":[{"r":"40:16:14"}]},{"w":"so","rs":[{"r":"44:16:5"}]},{"w":"some","rs":[{"r":"40:13:4"},{"r":"40:13:8"},{"r":"40:13:23"},{"r":"41:4:4"},{"r":"41:12:5"},{"r":"42:8:5"},{"r":"43:7:12"},{"r":"44:17:32"},{"r":"44:28:24"},{"r":"46:12:28"},{"r":"49:4:11"},{"r":"55:2:20"},{"r":"65:1:22"}]},{"w":"the","rs":[{"r":"40:16:3"},{"r":"44:23:8"},{"r":"45:5:16"},{"r":"60:3:18"}]},{"w":"then","rs":[{"r":"41:16:19"},{"r":"44:23:22"}]},{"w":"therefore","rs":[{"r":"43:16:22"}]},{"w":"they","rs":[{"r":"44:8:25"},{"r":"65:1:10"}]},{"w":"thing","rs":[{"r":"44:19:32"}]},{"w":"truly","rs":[{"r":"40:9:37"},{"r":"40:17:11"},{"r":"41:14:38"},{"r":"42:10:2"},{"r":"42:22:22"},{"r":"43:20:30"},{"r":"44:1:5"},{"r":"44:3:22"},{"r":"44:5:23"},{"r":"47:12:12"},{"r":"58:7:23"},{"r":"58:11:15"}]},{"w":"verily","rs":[{"r":"41:9:12"},{"r":"44:19:4"},{"r":"44:22:3"},{"r":"44:26:9"},{"r":"45:2:25"},{"r":"46:5:3"},{"r":"46:14:17"},{"r":"58:3:5"},{"r":"58:6:16"},{"r":"58:7:5"},{"r":"58:7:18"},{"r":"58:9:1"},{"r":"58:12:10"},{"r":"60:1:20"}]},{"w":"was","rs":[{"r":"44:12:5"}]},{"w":"wedding","rs":[{"r":"40:22:8"}]},{"w":"were","rs":[{"r":"44:15:30"}]},{"w":"when","rs":[{"r":"46:11:18"},{"r":"48:4:8"}]},{"w":"which","rs":[{"r":"44:21:39"}]},{"w":"who","rs":[{"r":"45:2:7"}]},{"w":"ye","rs":[{"r":"46:6:4"}]}]}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user