use a colon instead of semi-colon for verse reference key dilimeters. you should fix the data in strongs cross references when you get around to cleaning up that data...

This commit is contained in:
Jason Wall 2020-08-01 23:28:18 -04:00
parent cb3903f86e
commit d3c7287b14
3 changed files with 22 additions and 16 deletions

View File

@ -1912,11 +1912,11 @@ export class BibleReference {
chapter: number | string,
vs: number | string
) {
return `${book};${chapter};${vs}`;
return `${book}:${chapter}:${vs}`;
}
public static makePassageFromReferenceKey(referenceKey: string) {
const keyArray = referenceKey.split(';');
const keyArray = referenceKey.split(':');
const book = BibleReference.bookName(parseInt(keyArray[0], 10)).name;
return new BibleReference(`${book} ${keyArray[1]}:${keyArray[2]}`);
}

View File

@ -128,13 +128,13 @@ export interface StrongsDefinitionPart {
export interface StrongsCrossReference {
readonly id: string; // strongs id H1|G1
readonly t: string; // strongs testament grk|heb
readonly d: string; // strongs word/data Aaron {ah-ar-ohn'}
readonly d: string; // strongs word/data definition Aaron {ah-ar-ohn'}
readonly ss: readonly [
{
readonly w: string;
readonly w: string; // translated word
readonly rs: readonly [
{
readonly r: string;
readonly r: string; // reference
}
];
}

View File

@ -296,7 +296,22 @@ export class AppService extends createStateService(reducer, initialState) {
.toPromise();
for (const cr of d) {
if (cr.id.toUpperCase() === result.prefix + result.sn) {
result.crossrefs = cr;
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;
}
}
@ -724,16 +739,7 @@ export class AppService extends createStateService(reducer, initialState) {
return;
}
// find the right word
const refs = r
.filter((o) => o.w === query)
// you used the wrong delimiter here... *sigh* its ;'s in all the other things.
.map((o) => {
return {
...o,
r: o.r.map((ref) => ref.replace(':', ';')),
};
});
const refs = r.filter((o) => o.w === query);
if (refs.length > 0) {
return refs[0].r;
} else {