From 2855603ab144add92799ad4829fba5443715cd76 Mon Sep 17 00:00:00 2001 From: Robert Hunt Date: Mon, 18 Jan 2021 11:13:12 +1300 Subject: [PATCH 1/3] Attempt to debug notice disabling --- src/core/disabled-notices.js | 7 ++++++- src/core/tn-table-text-check.js | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/disabled-notices.js b/src/core/disabled-notices.js index 0a9b85c5..dc785e1a 100644 --- a/src/core/disabled-notices.js +++ b/src/core/disabled-notices.js @@ -8,7 +8,7 @@ */ -// const DISABLED_NOTICES_VERSION_STRING = '0.3.0'; +// const DISABLED_NOTICES_VERSION_STRING = '0.3.1'; const disabledNotices = [ @@ -69,7 +69,9 @@ const disabledNotices = [ * @returns true if the givenNotice has a match in the disabledNotices list above */ export function isDisabledNotice(givenNotice) { + // NOTE: The function will fail if repoCode is not set in the notices passed to this function // console.log(`isDisabledNotice(${JSON.stringify(givenNotice)})…`); + // if (givenNotice.repoCode === undefined) console.log(`isDisabledNotice() cannot work without repoCode for ${JSON.stringify(givenNotice)}`); for (const disabledNotice of disabledNotices) { let matchedAllSpecifiedFields = true; for (const propertyName in disabledNotice) @@ -94,8 +96,11 @@ export function isDisabledNotice(givenNotice) { * @returns a new list of notices with disabled ones removed */ export function removeDisabledNotices(givenNoticeList) { + // NOTE: The function will fail if repoCode is not set in the notices passed to this function const remainingNoticeList = []; + let givenRepoCodeNotice = false; for (const thisNotice of givenNoticeList) { + if (thisNotice.repoCode === undefined && !givenRepoCodeNotice) { console.log(`removeDisabledNotices() cannot work without repoCode for ${JSON.stringify(thisNotice)} in list of ${givenNoticeList.length} notices.`); givenRepoCodeNotice = true; } if (!isDisabledNotice(thisNotice)) remainingNoticeList.push(thisNotice); // else console.log(` Removing disabled ${JSON.stringify(thisNotice)}`); diff --git a/src/core/tn-table-text-check.js b/src/core/tn-table-text-check.js index ec8d2db6..c5a2d81d 100644 --- a/src/core/tn-table-text-check.js +++ b/src/core/tn-table-text-check.js @@ -4,7 +4,7 @@ import { checkTN_TSVDataRow } from './tn-table-row-check'; import { removeDisabledNotices } from './disabled-notices'; -const TN_TABLE_TEXT_VALIDATOR_VERSION_STRING = '0.3.1'; +const TN_TABLE_TEXT_VALIDATOR_VERSION_STRING = '0.3.2'; const NUM_EXPECTED_TN_TSV_FIELDS = 9; // so expects 8 tabs per line const EXPECTED_TN_HEADING_LINE = 'Book\tChapter\tVerse\tID\tSupportReference\tOrigQuote\tOccurrence\tGLQuote\tOccurrenceNote'; @@ -68,6 +68,7 @@ export async function checkTN_TSVText(languageCode, bookID, filename, tableText, if (noticeObject.debugChain) noticeObject.debugChain = `checkTN_TSVText ${noticeObject.debugChain}`; // NOTE: We only add the repoCode here because this function is called directly by tC Create // and notice disabling currently depends on knowing the repoCode + if (noticeObject.repoCode) console.log(`checkTN_TSVText.addNoticePartial already had repoCode=${noticeObject.repoCode} (will be lost)`); ttResult.noticeList.push({ ...noticeObject, bookID, filename, repoCode: 'TN' }); } From 7b075a378eebdf27ee1b6ae2a096c18b052afe22 Mon Sep 17 00:00:00 2001 From: Robert Hunt Date: Mon, 18 Jan 2021 11:13:29 +1300 Subject: [PATCH 2/3] Give more details of origL quote checks failing with leading/trailing spaces --- noticeList.txt | 116 +++++++++--------- package.json | 2 +- .../tn-table-row-check.test.js.snap | 8 +- src/core/annotation-table-check.js | 2 +- src/core/orig-quote-check.js | 16 ++- 5 files changed, 76 insertions(+), 68 deletions(-) diff --git a/noticeList.txt b/noticeList.txt index 2262b5fa..932b5651 100644 --- a/noticeList.txt +++ b/noticeList.txt @@ -1,5 +1,5 @@ -Last updated 2021-01-05 20:43:54.006715 by makeNoticeList.py -Got 305 notices: +Last updated 2021-01-18 09:04:22.865682 by makeNoticeList.py +Got 307 notices: checkRepoResult.noticeList.push( 997, "Repository doesn’t exist", details, username, repoCode, repoName, location: givenLocation, extra: repoCode from checkRepo.js line 259 languageCode === 'en' || languageCode === 'fr' ? 490 : 190, "Expected header field to contain a mixed-case string", fieldName: `\\$marker`, extract: rest, C, V, location: lineLocation from usfm-text-check.js line 757 marker === 's5' ? 111 : 809, `$marker === 's5' ? 'Deprecated' : 'Unexpected' '\\$marker' marker at start of line`, C, V, lineNumber, characterIndex: 1, location: lineLocation from usfm-text-check.js line 780 @@ -35,7 +35,7 @@ Got 305 notices: 996, "Unable to load", details, bookID, location: generalLocation, extra: repoCode from checkBookPackage.js line 538 996, "Unable to load", details, bookID, C, V, filename: thisPath, location: `$generalLocation $thisPath`, extra: repoCode from checkBookPackage.js line 566 996, "Unable to load", details: `username=$username error=$cRgfError`, bookID: ourBookID, filename: thisFilename, location: `$givenLocation $thisFilepath`, extra: repoName from checkRepo.js line 263 - 995, "File extension is not recognized, so treated as plain text.", filename, location: filename from checkFileContents.js line 81 + 995, "File extension is not recognized, so treated as plain text.", filename, location: filename from checkFileContents.js line 84 993, "Unresolved GIT conflict", characterIndex, extract, location: ourLocation from field-text-check.js line 111 993, "Unresolved GIT conflict", characterIndex, extract, location: ourLocation from plain-text-check.js line 130 992, "Unresolved GIT conflict", characterIndex, extract, location: ourLocation from field-text-check.js line 117 @@ -44,7 +44,7 @@ Got 305 notices: 991, "Unresolved GIT conflict", characterIndex, extract, location: ourLocation from plain-text-check.js line 138 990, "Unable to load file", details: `username=$username`, repoName, filename ], elapsedSeconds: 0 ; from FileCheck.js line 63 989, "Unable to find/load repository", location: ourLocation from checkRepo.js line 186 - 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_TN_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 227 + 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_TN_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 238 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_ANNOTATION_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 228 987, C, V, "Expected \\id line to start with book identifier", lineNumber: n, characterIndex: 4, extract, location: ourLocation from usfm-text-check.js line 936 986, "Repository doesn’t seem to exist", details: `username=$username`, location: givenLocation, extra: repoName from checkRepo.js line 166 @@ -76,14 +76,16 @@ Got 305 notices: 920, yamlError.message, location: ourLocation ) from yaml-text-check.js line 161 919, "Missing OrigQuote field", fieldName: 'OrigQuote', rowID, location: ourRowLocation from tn-table-row-check.js line 453 919, "Missing Quote field", fieldName: 'Quote', rowID, location: ourRowLocation from annotation-row-check.js line 469 - 917, "Unable to find duplicate original language quote in verse text", details: `occurrence=$occurrenceString, passage ⸢$verseText⸣`, extract, location: ourLocation from orig-quote-check.js line 311 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 347 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 350 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 353 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 356 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 359 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 362 - 916, "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ⸢$verseText⸣`, extract, location: ourLocation from orig-quote-check.js line 365 + 917, "Unable to find duplicate original language quote in verse text", details: `occurrence=$occurrenceString, passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 311 + 916, "Unable to find original language quote in verse text", details: "quote which starts with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 348 + 916, "Unable to find original language quote in verse text", details: "quote which ends with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 351 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 354 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 357 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 360 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 363 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 366 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 369 + 916, "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 372 912, 'Missing | character in \\w line', lineNumber, C, V, characterIndex, extract, location: lineLocation from usfm-text-check.js line 627 911, 'Missing | character in \\w field', details, lineNumber, C, V, characterIndex, extract, location: lineLocation from usfm-text-check.js line 683 903, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from usfm-text-check.js line 801 @@ -93,12 +95,12 @@ Got 305 notices: 889, `Unable to find TA link`, extract: fieldText, location: `$ourLocation $filepath` from ta-reference-check.js line 108 888, `Error loading TA link`, extract: fieldText, location: `$ourLocation $filepath: $trcGCerror` from ta-reference-check.js line 113 887, `Linked TA article seems empty`, extract: fieldText, location: `$ourLocation $filepath` from ta-reference-check.js line 110 - 886, `Unable to find $fieldName TA link`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 222 + 886, `Unable to find $fieldName TA link`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 224 885, `Error loading $fieldName TA link`, extract: regexResultArray[0], location: `$ourLocation $filepath: $trcGCerror` from tn-links-check.js line 219 - 884, `Linked $fieldName TA article seems empty`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 224 - 883, `Unable to find $fieldName TW link`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 270 - 882, `Error loading $fieldName TW link`, extract: regexResultArray[0], location: `$ourLocation $filepath: $trcGCerror` from tn-links-check.js line 267 - 881, `Linked $fieldName TW article seems empty`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 273 + 884, `Linked $fieldName TA article seems empty`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 226 + 883, `Unable to find $fieldName TW link`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 273 + 882, `Error loading $fieldName TW link`, extract: regexResultArray[0], location: `$ourLocation $filepath: $trcGCerror` from tn-links-check.js line 270 + 881, `Linked $fieldName TW article seems empty`, extract: regexResultArray[0], location: `$ourLocation $filepath` from tn-links-check.js line 276 879, `Badly formatted Resource Container link`, extract: fieldText, location: `$ourLocation $filepath` from ta-reference-check.js line 95 875, "Unexpected USFM field", details, lineNumber, C, V, extract, location: lineLocation from usfm-text-check.js line 730 873, `Mismatched $opener$closer fields`, extract: `(left=$lCount.toLocaleString(), right=$rCount.toLocaleString())`, location: fileLocation from usfm-text-check.js line 552 @@ -108,9 +110,9 @@ Got 305 notices: 866, C: chapterNumberString, V: `$v`, "Verse seems to have no text", location: CVlocation from usfm-text-check.js line 460 851, bookID === 'OBS' ? "Unable to load OBS story text" : "Unable to load original language verse text", location: ourLocation from orig-quote-check.js line 276 849, `Unexpected '$badCharCombination' character combination`, characterIndex, extract, location: ourLocation from field-text-check.js line 362 - 845, `Mismatched [[ ]] link characters`, details: `left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 464 - 844, `Mismatched [[rc:// ]] link characters`, details: `left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 468 - 843, `Mismatched [ ]( ) link characters`, details: `left=$leftCount.toLocaleString(), middle=$middleCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 475 + 845, `Mismatched [[ ]] link characters`, details: `left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 467 + 844, `Mismatched [[rc:// ]] link characters`, details: `left=$leftCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 471 + 843, `Mismatched [ ]( ) link characters`, details: `left=$leftCount.toLocaleString(), middle=$middleCount.toLocaleString(), right=$rightCount.toLocaleString()`, location: ourLocation from tn-links-check.js line 478 824, `Invalid zero chapter number`, extract: C, rowID, fieldName: 'Chapter', location: ourRowLocation from tn-table-row-check.js line 354 824, `Invalid zero chapter number`, extract: C, rowID, fieldName: 'Reference', location: ourRowLocation from annotation-row-check.js line 361 823, `Invalid large chapter number`, extract: C, rowID, fieldName: 'Chapter', location: ourRowLocation from tn-table-row-check.js line 359 @@ -138,7 +140,7 @@ Got 305 notices: 792, `Invalid occurrence field`, fieldName: 'Occurrence', rowID, extract: occurrence, location: ourRowLocation from annotation-row-check.js line 483 791, `Missing occurrence field`, fieldName: 'Occurrence', rowID, location: ourRowLocation from tn-table-row-check.js line 472 791, `Missing occurrence field`, fieldName: 'Occurrence', rowID, location: ourRowLocation from annotation-row-check.js line 488 - 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from tn-table-text-check.js line 206 + 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from tn-table-text-check.js line 217 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from annotation-table-check.js line 207 788, "Only 'Just-In-Time Training' TA articles allowed here", fieldName: 'SupportReference', extract: supportReference, rowID, location: ourRowLocation from tn-table-row-check.js line 430 788, "Only 'Just-In-Time Training' TA articles allowed here", fieldName: 'SupportReference', extract: supportReference, rowID, location: ourRowLocation from annotation-row-check.js line 446 @@ -173,37 +175,37 @@ Got 305 notices: 750, "Missing occurrence field when we have an original quote", fieldName: 'Occurrence', rowID, location: ourRowLocation from annotation-row-check.js line 465 749, "Markdown image link seems faulty", lineNumber, extract: fetchLink, location: lineLocation from markdown-text-check.js line 139 748, "Error fetching markdown image link", lineNumber, extract: fetchLink, location: lineLocation from markdown-text-check.js line 148 - 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from tn-table-text-check.js line 86 + 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from tn-table-text-check.js line 97 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from annotation-table-check.js line 89 - 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from tn-table-text-check.js line 101 + 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from tn-table-text-check.js line 112 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from annotation-table-check.js line 105 - 745, C, V, `Wrong '$B' book identifier (expected '$bookID')`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 156 - 744, C, V, "Missing book identifier", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 159 - 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 319 - 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 371 - 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 423 - 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 325 - 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 377 - 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 429 - 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from tn-table-text-check.js line 183 + 745, C, V, `Wrong '$B' book identifier (expected '$bookID')`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 167 + 744, C, V, "Missing book identifier", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 170 + 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 322 + 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 374 + 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 426 + 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 328 + 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 380 + 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 432 + 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from tn-table-text-check.js line 194 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from annotation-table-check.js line 184 - 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 202 + 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 213 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 203 - 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 170 + 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 181 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from annotation-table-check.js line 171 - 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 174 + 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 185 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 175 - 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 176 + 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 187 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 177 - 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 180 - 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 192 + 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 191 + 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 203 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 181 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 193 - 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 196 + 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 207 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 197 - 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 212 + 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 223 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 213 - 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 210 + 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 221 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 211 724, C, V, "Unable to convert chapter number to integer", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : ''`, location: ourLocation from usfm-text-check.js line 881 723, C, V, "Unable to convert verse number to integer", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : ''`, location: ourLocation from usfm-text-check.js line 894 @@ -212,19 +214,19 @@ Got 305 notices: 716, `Misplaced $rightChar character`, extract: regexResultArray[0], location: ourLocation from field-text-check.js line 416 711, "Expected compulsory content", C, V, lineNumber, characterIndex: marker.length, location: ` after \\$marker marker$lineLocation` from usfm-text-check.js line 777 703, C, V, "Unexpected CarriageReturn character", lineNumber: n, characterIndex, extract, location: ourLocation from usfm-text-check.js line 845 - 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 341 - 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 393 - 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 445 - 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 343 - 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 395 - 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 447 - 649, "More [[ ]] links than valid TA/TW links", details: `detected $totalLinks2 link$totalLinks2 === 1 ? '' : 's' but $twaLinkCount ? `only $twaLinkCount` : 'no' TA/TW link$twaLinkCount === 1 ? '' : 's' from $JSON.stringify(linksList2)`, location: ourLocation from tn-links-check.js line 457 - 648, "More [ ]( ) links than valid Bible links", details: `detected $totalLinks1 link$totalLinks1 === 1 ? '' : 's' but $BibleLinkCount ? `only $BibleLinkCount` : 'no' Bible link$BibleLinkCount === 1 ? '' : 's' from $JSON.stringify(linksList1)`, location: ourLocation from tn-links-check.js line 454 + 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 344 + 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 396 + 655, "Bad chapter number in markdown Bible link", details: `$linkBookCode $chapterInt vs $numChaptersThisBook chapters`, extract: totalLink, location: ourLocation from tn-links-check.js line 448 + 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 346 + 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 398 + 653, "Bad verse number in markdown Bible link", details: `$linkBookCode $chapterInt:$verseInt vs $numVersesThisChapter verses`, extract: totalLink, location: ourLocation from tn-links-check.js line 450 + 649, "More [[ ]] links than valid TA/TW links", details: `detected $totalLinks2 link$totalLinks2 === 1 ? '' : 's' but $twaLinkCount ? `only $twaLinkCount` : 'no' TA/TW link$twaLinkCount === 1 ? '' : 's' from $JSON.stringify(linksList2)`, location: ourLocation from tn-links-check.js line 460 + 648, "More [ ]( ) links than valid Bible links", details: `detected $totalLinks1 link$totalLinks1 === 1 ? '' : 's' but $BibleLinkCount ? `only $BibleLinkCount` : 'no' Bible link$BibleLinkCount === 1 ? '' : 's' from $JSON.stringify(linksList1)`, location: ourLocation from tn-links-check.js line 457 644, "USFM3 Grammar Check (relaxed mode) doesn’t pass either", location: fileLocation from usfm-text-check.js line 239 638, "Only found whitespace", location: ourLocation from field-text-check.js line 102 638, "Only found whitespace", location: ourLocation from plain-text-check.js line 122 - 621, "Seems original language quote might not finish at the end of a word", details: `passage ►$verseText◄`, characterIndex: fieldText.length, extract, location: ourLocation from orig-quote-check.js line 336 - 620, "Seems original language quote might not start at the beginning of a word", details: `passage ⸢$verseText⸣`, characterIndex: 0, extract, location: ourLocation from orig-quote-check.js line 328 + 621, "Seems original language quote might not finish at the end of a word", details: `passage ►$verseText◄`, characterIndex: fieldText.length, extract, location: ourLocation from orig-quote-check.js line 337 + 620, "Seems original language quote might not start at the beginning of a word", details: `passage ►$verseText◄`, characterIndex: 0, extract, location: ourLocation from orig-quote-check.js line 328 603, "USFM marker doesn’t end with space", C, V, lineNumber, characterIndex, extract, location: ourLocation from usfm-text-check.js line 815 601, "Unable to load", details: `username=$username error=$gcUHBerror`, OBSPathname, location: ourLocation, extra: OBSRepoName from orig-quote-check.js line 99 601, "Unable to load", details: `username=$username error=$gcUHBerror`, filename, location: ourLocation, extra: originalLanguageRepoName from orig-quote-check.js line 131 @@ -233,9 +235,9 @@ Got 305 notices: 583, "Unexpected newLine character", characterIndex, extract, location: ourLocation from field-text-check.js line 230 582, "Unexpected carriageReturn character", characterIndex, extract, location: ourLocation from field-text-check.js line 236 581, "Unexpected non-break space character", characterIndex, extract, location: ourLocation from field-text-check.js line 242 - 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 190 + 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 201 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 191 - 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 168 + 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 179 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from annotation-table-check.js line 169 539, "File starts with empty line", characterIndex, extract, location: ourLocation from plain-text-check.js line 144 538, "File ends without newline character", characterIndex, extract, location: ourLocation from plain-text-check.js line 149 @@ -283,9 +285,9 @@ Got 305 notices: 157, "Unexpected space(s) beside ↔ divider character", characterIndex, extract, location: ourLocation from orig-quote-check.js line 253 156, "Unexpected space(s) beside ellipse characters", characterIndex, extract, location: ourLocation from orig-quote-check.js line 260 148, "'checking' key is missing", location: ourLocation from manifest-text-check.js line 642 - 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 310 - 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 362 - 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 414 + 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 313 + 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 365 + 143, "Unknown Bible book name in link", details: totalLink, extract: optionalB1, location: ourLocation from tn-links-check.js line 417 138, "File ends with additional blank line(s)", characterIndex, extract, location: ourLocation from plain-text-check.js line 154 111, `Bad options for checkFieldLinks: expectedCount=$linkOptions.expectedCount but allowedCount=$linkOptions.allowedCount` from field-link-check.js line 115 110, `Unexpected leading spaces`, characterIndex: 0, extract, location: ourLocation from field-text-check.js line 131 @@ -303,5 +305,5 @@ Got 305 notices: 64, "Unexpected leading space(s) after break", characterIndex, extract, location: ourLocation from field-text-check.js line 146 63, "Unexpected leading space(s) after line break", characterIndex, extract, location: ourLocation from field-text-check.js line 151 50, "Is this quote/occurrence correct???", details: `Occurrence=$occurrence`, extract: quoteBits, location: ourLocation from orig-quote-check.js line 286 - 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from tn-table-text-check.js line 239 + 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from tn-table-text-check.js line 250 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from annotation-table-check.js line 240 diff --git a/package.json b/package.json index f81bee4d..2b153898 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "uw-content-validation", "description": "Functions for Checking Door43.org Scriptural Content/Resources.", - "version": "1.0.2", + "version": "1.0.3", "private": false, "homepage": "https://unfoldingword.github.io/uw-content-validation/", "repository": { diff --git a/src/__tests__/__snapshots__/tn-table-row-check.test.js.snap b/src/__tests__/__snapshots__/tn-table-row-check.test.js.snap index bdd9aa12..24617247 100644 --- a/src/__tests__/__snapshots__/tn-table-row-check.test.js.snap +++ b/src/__tests__/__snapshots__/tn-table-row-check.test.js.snap @@ -151,7 +151,7 @@ Object { "C": "1", "V": "2", "bookID": "GEN", - "details": "passage ⸢וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃⸣", + "details": "passage ►וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃◄", "extract": "וְ⁠חֹ֖שחֹ֖שֶךְ", "fieldName": "OrigQuote", "location": " that was supplied", @@ -195,7 +195,7 @@ Object { "V": "2", "bookID": "GEN", "characterIndex": 0, - "details": "passage ⸢וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃⸣", + "details": "passage ►וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃◄", "extract": "(ּ=D1468/H5bc) וְ⁠חֹ֖שֶׁךְ", "fieldName": "OrigQuote", "location": " that was supplied", @@ -315,7 +315,7 @@ Object { "C": "1", "V": "2", "bookID": "GEN", - "details": "passage ⸢וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃⸣", + "details": "passage ►וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃◄", "extract": "‌וְ⁠חֹֹ֖֖שֶׁךְ", "fieldName": "OrigQuote", "location": " that was supplied", @@ -466,7 +466,7 @@ Object { "C": "1", "V": "2", "bookID": "GEN", - "details": "passage ⸢וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃⸣", + "details": "passage ►וְ⁠הָ⁠אָ֗רֶץ הָיְתָ֥ה תֹ֨הוּ֙ וָ⁠בֹ֔הוּ וְ⁠חֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְ⁠ר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַ⁠מָּֽיִם׃◄", "extract": "וְ⁠חֹ֖ש֖שֶׁךְ‌", "fieldName": "OrigQuote", "location": " that was supplied", diff --git a/src/core/annotation-table-check.js b/src/core/annotation-table-check.js index 781bfadd..a47db605 100644 --- a/src/core/annotation-table-check.js +++ b/src/core/annotation-table-check.js @@ -57,7 +57,7 @@ export async function checkAnnotationRows(languageCode, annotationType, bookID, console.assert(typeof noticeObject.location === 'string', `TSV addNoticePartial: 'location' parameter should be a string not a '${typeof noticeObject.location}': ${noticeObject.location}`); if (noticeObject.debugChain) noticeObject.debugChain = `checkAnnotationRows ${noticeObject.debugChain}`; - carResult.noticeList.push({ ...noticeObject, bookID, filename }); + carResult.noticeList.push({ ...noticeObject, bookID, filename, repoCode: annotationType }); } diff --git a/src/core/orig-quote-check.js b/src/core/orig-quote-check.js index 23a3d93d..349db79f 100644 --- a/src/core/orig-quote-check.js +++ b/src/core/orig-quote-check.js @@ -4,7 +4,7 @@ import { cachedGetFile } from '../core/getApi'; import { ourParseInt } from './utilities'; -// const QUOTE_VALIDATOR_VERSION_STRING = '0.7.7'; +// const QUOTE_VALIDATOR_VERSION_STRING = '0.7.8'; export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldText, occurrenceString, bookID, C, V, givenLocation, checkingOptions) { @@ -308,7 +308,7 @@ export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldT // console.log(`checkOriginalLanguageQuote is checking for ${occurrence} occurrences of ${fieldText}`); if (verseText.split(fieldText).length <= occurrence) { // There's not enough of them const extract = fieldText.substring(0, halfLength) + (fieldText.length > 2 * halfLength ? '…' : '') + fieldText.substring(fieldText.length - halfLength, fieldText.length); - addNotice({ priority: 917, message: "Unable to find duplicate original language quote in verse text", details: `occurrence=${occurrenceString}, passage ⸢${verseText}⸣`, extract, location: ourLocation }); + addNotice({ priority: 917, message: "Unable to find duplicate original language quote in verse text", details: `occurrence=${occurrenceString}, passage ►${verseText}◄`, extract, location: ourLocation }); } } else { // We only need to check for one occurrence // Double check that it doesn’t start/stop in the middle of a word @@ -325,7 +325,7 @@ export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldT // const badCharString = ` by '{badChar}' {unicodedata.name(badChar)}={hex(ord(badChar))}`; // console.log(`Seems '${fieldText}' might not start at the beginning of a word—it’s preceded ${badCharString} in '${verseText}'`); const extract = `(${remainingBits[0].slice(-1)}=D${remainingBits[0].slice(-1).charCodeAt()}/H${remainingBits[0].slice(-1).charCodeAt().toString(16)})` + fieldText.substring(0, extractLength - 3) + (fieldText.length > extractLength - 3 ? '…' : ''); - addNotice({ priority: 620, message: "Seems original language quote might not start at the beginning of a word", details: `passage ⸢${verseText}⸣`, characterIndex: 0, extract, location: ourLocation }); + addNotice({ priority: 620, message: "Seems original language quote might not start at the beginning of a word", details: `passage ►${verseText}◄`, characterIndex: 0, extract, location: ourLocation }); } // Note: There's some Hebrew (RTL) characters at the beginning of the following regex if (fieldText.slice(-1) !== ' ' && remainingBits[1] && remainingBits[1][0].search(/[^׃־A-Za-z\s.,:;?!–)]…/) !== -1) { @@ -343,7 +343,13 @@ export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldT if (noBreakSpaceText) fieldText = fieldText.replace(/\u00A0/g, '⍽'); // console.log(`722 fieldText='${fieldText}'${extraText}`); // console.log(`722 verseText='${verseText}'`); - if (fieldText[0] === '\u2060') { // Word joiner + if (fieldText[0] === ' ') { + const extract = fieldText.substring(0, extractLength) + fieldText.length > extractLength ? '…' : ''; + addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: "quote which starts with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation }); + } else if (fieldText.endsWith(' ')) { + const extract = fieldText.length > extractLength ? '…' : '' + fieldText.substring(fieldText.length - extractLength, fieldText.length); + addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: "quote which ends with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation }); + } else if (fieldText[0] === '\u2060') { // Word joiner const extract = fieldText.substring(0, extractLength) + fieldText.length > extractLength ? '…' : ''; addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: "quote which starts with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation }); } else if (fieldText.endsWith('\u2060')) { // Word joiner @@ -363,7 +369,7 @@ export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldT addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation }); } else { const extract = fieldText.substring(0, halfLength) + (fieldText.length > 2 * halfLength ? '…' : '') + fieldText.substring(fieldText.length - halfLength, fieldText.length); - addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ⸢${verseText}⸣`, extract, location: ourLocation }); + addNotice({ priority: 916, message: "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ►${verseText}◄`, extract, location: ourLocation }); } } } From 37a4964b0d905952adfc34859b384a1432c2b86a Mon Sep 17 00:00:00 2001 From: Robert Hunt Date: Mon, 18 Jan 2021 14:30:46 +1300 Subject: [PATCH 3/3] Improve checks and messages for finding TN OrigQuote snippets in verse text --- noticeList.txt | 71 ++++++++++++++++++------------------ src/core/orig-quote-check.js | 19 +++++++--- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/noticeList.txt b/noticeList.txt index 932b5651..24a3cbbf 100644 --- a/noticeList.txt +++ b/noticeList.txt @@ -1,5 +1,5 @@ -Last updated 2021-01-18 09:04:22.865682 by makeNoticeList.py -Got 307 notices: +Last updated 2021-01-18 14:28:03.991135 by makeNoticeList.py +Got 308 notices: checkRepoResult.noticeList.push( 997, "Repository doesn’t exist", details, username, repoCode, repoName, location: givenLocation, extra: repoCode from checkRepo.js line 259 languageCode === 'en' || languageCode === 'fr' ? 490 : 190, "Expected header field to contain a mixed-case string", fieldName: `\\$marker`, extract: rest, C, V, location: lineLocation from usfm-text-check.js line 757 marker === 's5' ? 111 : 809, `$marker === 's5' ? 'Deprecated' : 'Unexpected' '\\$marker' marker at start of line`, C, V, lineNumber, characterIndex: 1, location: lineLocation from usfm-text-check.js line 780 @@ -44,7 +44,7 @@ Got 307 notices: 991, "Unresolved GIT conflict", characterIndex, extract, location: ourLocation from plain-text-check.js line 138 990, "Unable to load file", details: `username=$username`, repoName, filename ], elapsedSeconds: 0 ; from FileCheck.js line 63 989, "Unable to find/load repository", location: ourLocation from checkRepo.js line 186 - 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_TN_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 238 + 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_TN_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 239 988, `Wrong number of tabbed fields (expected $NUM_EXPECTED_ANNOTATION_TSV_FIELDS)`, extract: `Found $fields.length field$fields.length === 1 ? '' : 's'`, C, V, rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 228 987, C, V, "Expected \\id line to start with book identifier", lineNumber: n, characterIndex: 4, extract, location: ourLocation from usfm-text-check.js line 936 986, "Repository doesn’t seem to exist", details: `username=$username`, location: givenLocation, extra: repoName from checkRepo.js line 166 @@ -76,16 +76,18 @@ Got 307 notices: 920, yamlError.message, location: ourLocation ) from yaml-text-check.js line 161 919, "Missing OrigQuote field", fieldName: 'OrigQuote', rowID, location: ourRowLocation from tn-table-row-check.js line 453 919, "Missing Quote field", fieldName: 'Quote', rowID, location: ourRowLocation from annotation-row-check.js line 469 - 917, "Unable to find duplicate original language quote in verse text", details: `occurrence=$occurrenceString, passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 311 - 916, "Unable to find original language quote in verse text", details: "quote which starts with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 348 - 916, "Unable to find original language quote in verse text", details: "quote which ends with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 351 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 354 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 357 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 360 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 363 - 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 366 - 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 369 - 916, "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 372 + 917, "Unable to find duplicate original language quote in verse text", details: `occurrence=$occurrenceString, passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 320 + 916, "Unable to find original language quote in verse text", details: "quote which starts with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 357 + 916, "Unable to find original language quote in verse text", details: "quote which ends with a space" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 360 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 363 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'word joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 366 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 369 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width space'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 372 + 916, "Unable to find original language quote in verse text", details: "quote which starts with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 375 + 916, "Unable to find original language quote in verse text", details: "quote which ends with 'zero-width joiner'" + (noBreakSpaceText ? ' ' + noBreakSpaceText : ''), extract, location: ourLocation from orig-quote-check.js line 378 + 916, "Unable to find original language quote in verse text", details: noBreakSpaceText ? noBreakSpaceText : `passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 381 + 915, "Unable to find original language quote portion in verse text", details: `passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 307 + 914, "Unable to find original language quote portion in the right place in the verse text", details: `passage ►$verseText◄`, extract, location: ourLocation from orig-quote-check.js line 304 912, 'Missing | character in \\w line', lineNumber, C, V, characterIndex, extract, location: lineLocation from usfm-text-check.js line 627 911, 'Missing | character in \\w field', details, lineNumber, C, V, characterIndex, extract, location: lineLocation from usfm-text-check.js line 683 903, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from usfm-text-check.js line 801 @@ -140,7 +142,7 @@ Got 307 notices: 792, `Invalid occurrence field`, fieldName: 'Occurrence', rowID, extract: occurrence, location: ourRowLocation from annotation-row-check.js line 483 791, `Missing occurrence field`, fieldName: 'Occurrence', rowID, location: ourRowLocation from tn-table-row-check.js line 472 791, `Missing occurrence field`, fieldName: 'Occurrence', rowID, location: ourRowLocation from annotation-row-check.js line 488 - 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from tn-table-text-check.js line 217 + 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from tn-table-text-check.js line 218 790, C, V, "Missing verse number", rowID, lineNumber: n + 1, location: ` after $C:$lastV$ourLocation` from annotation-table-check.js line 207 788, "Only 'Just-In-Time Training' TA articles allowed here", fieldName: 'SupportReference', extract: supportReference, rowID, location: ourRowLocation from tn-table-row-check.js line 430 788, "Only 'Just-In-Time Training' TA articles allowed here", fieldName: 'SupportReference', extract: supportReference, rowID, location: ourRowLocation from annotation-row-check.js line 446 @@ -175,41 +177,40 @@ Got 307 notices: 750, "Missing occurrence field when we have an original quote", fieldName: 'Occurrence', rowID, location: ourRowLocation from annotation-row-check.js line 465 749, "Markdown image link seems faulty", lineNumber, extract: fetchLink, location: lineLocation from markdown-text-check.js line 139 748, "Error fetching markdown image link", lineNumber, extract: fetchLink, location: lineLocation from markdown-text-check.js line 148 - 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from tn-table-text-check.js line 97 + 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from tn-table-text-check.js line 98 747, "Bad function call: should be given a valid book abbreviation", extract: bookID, location: ` (not '$bookID')$ourLocation` from annotation-table-check.js line 89 - 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from tn-table-text-check.js line 112 + 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from tn-table-text-check.js line 113 746, "Bad TSV header", lineNumber: n + 1, location: `$ourLocation: '$lines[0]'` from annotation-table-check.js line 105 - 745, C, V, `Wrong '$B' book identifier (expected '$bookID')`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 167 - 744, C, V, "Missing book identifier", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 170 + 745, C, V, `Wrong '$B' book identifier (expected '$bookID')`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 168 + 744, C, V, "Missing book identifier", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 171 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 322 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 374 743, "Chapter numbers of markdown Bible link don’t match", details: `$C1 vs $chapterInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 426 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 328 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 380 742, "Verse numbers of markdown Bible link don’t match", details: `$V1 vs $verseInt`, extract: totalLink, location: ourLocation from tn-links-check.js line 432 - 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from tn-table-text-check.js line 194 + 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from tn-table-text-check.js line 195 739, C, V, "Missing chapter number", rowID, lineNumber: n + 1, location: ` after $lastC:$V$ourLocation` from annotation-table-check.js line 184 - 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 213 + 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 214 738, C, V, "Bad verse number", rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 203 - 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 181 + 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 182 737, C, V, "Invalid large chapter number", rowID, lineNumber: n + 1, extract: C, location: ourLocation from annotation-table-check.js line 171 - 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 185 + 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 186 736, C, V, "Receding chapter number", details: `'$C' after '$lastC'`, rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 175 - 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 187 + 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 188 735, C, V, "Advancing chapter number", details: `'$C' after '$lastC'`.rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 177 - 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 191 - 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 203 + 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 192 + 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 204 734, C, V, "Bad chapter number", rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 181 734, C, V, "Invalid large verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 193 - 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 207 + 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 208 733, C, V, "Receding verse number", details: `'$V' after '$lastV for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 197 - 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 223 + 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 224 730, C, V, "Missing ID", fieldName: 'ID', lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 213 - 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 221 + 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from tn-table-text-check.js line 222 729, C, V, `Duplicate '$rowID' ID`, fieldName: 'ID', rowID, lineNumber: n + 1, location: ourLocation from annotation-table-check.js line 211 724, C, V, "Unable to convert chapter number to integer", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : ''`, location: ourLocation from usfm-text-check.js line 881 723, C, V, "Unable to convert verse number to integer", lineNumber: n, characterIndex: 3, extract: `$rest.substring(0, halfLength)$rest.length > halfLength ? '…' : ''`, location: ourLocation from usfm-text-check.js line 894 - 721, "Unable to find original language quote in verse text", extract, location: ourLocation from orig-quote-check.js line 300 720, C, V, "Unable to convert internal verse number to integer", lineNumber: n, characterIndex: 3, extract: `$restRest.substring(0, halfLength)$restRest.length > halfLength ? '…' : ''`, location: ourLocation from usfm-text-check.js line 925 716, `Misplaced $rightChar character`, extract: regexResultArray[0], location: ourLocation from field-text-check.js line 416 711, "Expected compulsory content", C, V, lineNumber, characterIndex: marker.length, location: ` after \\$marker marker$lineLocation` from usfm-text-check.js line 777 @@ -225,8 +226,8 @@ Got 307 notices: 644, "USFM3 Grammar Check (relaxed mode) doesn’t pass either", location: fileLocation from usfm-text-check.js line 239 638, "Only found whitespace", location: ourLocation from field-text-check.js line 102 638, "Only found whitespace", location: ourLocation from plain-text-check.js line 122 - 621, "Seems original language quote might not finish at the end of a word", details: `passage ►$verseText◄`, characterIndex: fieldText.length, extract, location: ourLocation from orig-quote-check.js line 337 - 620, "Seems original language quote might not start at the beginning of a word", details: `passage ►$verseText◄`, characterIndex: 0, extract, location: ourLocation from orig-quote-check.js line 328 + 621, "Seems original language quote might not finish at the end of a word", details: `passage ►$verseText◄`, characterIndex: fieldText.length, extract, location: ourLocation from orig-quote-check.js line 346 + 620, "Seems original language quote might not start at the beginning of a word", details: `passage ►$verseText◄`, characterIndex: 0, extract, location: ourLocation from orig-quote-check.js line 337 603, "USFM marker doesn’t end with space", C, V, lineNumber, characterIndex, extract, location: ourLocation from usfm-text-check.js line 815 601, "Unable to load", details: `username=$username error=$gcUHBerror`, OBSPathname, location: ourLocation, extra: OBSRepoName from orig-quote-check.js line 99 601, "Unable to load", details: `username=$username error=$gcUHBerror`, filename, location: ourLocation, extra: originalLanguageRepoName from orig-quote-check.js line 131 @@ -235,9 +236,9 @@ Got 307 notices: 583, "Unexpected newLine character", characterIndex, extract, location: ourLocation from field-text-check.js line 230 582, "Unexpected carriageReturn character", characterIndex, extract, location: ourLocation from field-text-check.js line 236 581, "Unexpected non-break space character", characterIndex, extract, location: ourLocation from field-text-check.js line 242 - 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 201 + 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from tn-table-text-check.js line 202 552, C, V, "Invalid zero verse number", details: `for chapter $C`, rowID, lineNumber: n + 1, extract: V, location: ourLocation from annotation-table-check.js line 191 - 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 179 + 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from tn-table-text-check.js line 180 551, C, V, `Invalid zero chapter number`, rowID, lineNumber: n + 1, extract: C, location: ourLocation from annotation-table-check.js line 169 539, "File starts with empty line", characterIndex, extract, location: ourLocation from plain-text-check.js line 144 538, "File ends without newline character", characterIndex, extract, location: ourLocation from plain-text-check.js line 149 @@ -251,7 +252,7 @@ Got 307 notices: 438, `Blank field / missing link (expected $linkOptions.expectedCount link$linkOptions.expectedCount === 1 ? "" : "s")`, location: ourLocation from field-link-check.js line 105 401, `Unexpected content after \\$marker marker`, C, V, lineNumber, characterIndex: marker.length, extract: rest, location: lineLocation from usfm-text-check.js line 775 399, C, V, "Useless paragraph marker", lineNumber: n, characterIndex: 1, details: `'\\$lastMarker' before '\\$marker'`, location: ourLocation from usfm-text-check.js line 949 - 375, "Ellipsis without surrounding snippet", location: ourLocation from orig-quote-check.js line 304 + 375, "Ellipsis without surrounding snippet", location: ourLocation from orig-quote-check.js line 313 374, "Field contains zero-width space(s)", fieldName: 'SupportReference', rowID, location: ourRowLocation from tn-table-row-check.js line 438 374, "Field contains zero-width space(s)", fieldName: 'GLQuote', rowID, location: ourRowLocation from tn-table-row-check.js line 478 374, "Field contains zero-width space(s)", fieldName: 'OccurrenceNote', rowID, location: ourRowLocation from tn-table-row-check.js line 491 @@ -305,5 +306,5 @@ Got 307 notices: 64, "Unexpected leading space(s) after break", characterIndex, extract, location: ourLocation from field-text-check.js line 146 63, "Unexpected leading space(s) after line break", characterIndex, extract, location: ourLocation from field-text-check.js line 151 50, "Is this quote/occurrence correct???", details: `Occurrence=$occurrence`, extract: quoteBits, location: ourLocation from orig-quote-check.js line 286 - 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from tn-table-text-check.js line 250 + 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from tn-table-text-check.js line 251 20, "Note that 'disableAllLinkFetchingFlag' was set so link targets were not checked", location: ourLocation from annotation-table-check.js line 240 diff --git a/src/core/orig-quote-check.js b/src/core/orig-quote-check.js index 349db79f..71aeeaab 100644 --- a/src/core/orig-quote-check.js +++ b/src/core/orig-quote-check.js @@ -4,7 +4,7 @@ import { cachedGetFile } from '../core/getApi'; import { ourParseInt } from './utilities'; -// const QUOTE_VALIDATOR_VERSION_STRING = '0.7.8'; +// const QUOTE_VALIDATOR_VERSION_STRING = '0.8.0'; export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldText, occurrenceString, bookID, C, V, givenLocation, checkingOptions) { @@ -287,18 +287,27 @@ export async function checkOriginalLanguageQuote(languageCode, fieldName, fieldT } const numQuoteBits = quoteBits.length; if (numQuoteBits >= 2) { + let quoteIndex = -1; // These parts have to be in order, i.e., found in the verse one AFTER the other for (let bitIndex = 0; bitIndex < numQuoteBits; bitIndex++) { - if (verseText.indexOf(quoteBits[bitIndex]) < 0) { // this is what we really want to catch + // console.log(`Checking quote part ${bitIndex} '${quoteBits[bitIndex]}' in '${verseText.substring(quoteIndex)}' from '${verseText}'`) + if ((quoteIndex = verseText.indexOf(quoteBits[bitIndex], quoteIndex + 1)) < 0) { // this is what we really want to catch // If the quote has multiple parts, create a description of the current part let partDescription; if (numQuoteBits === 1) partDescription = ''; else if (bitIndex === 0) partDescription = 'beginning'; else if (bitIndex === numQuoteBits - 1) partDescription = 'end'; else partDescription = `middle${numQuoteBits > 3 ? bitIndex : ''}`; - // console.log(`721 Unable to find '${fieldText}' ${numQuoteBits === 1? '': `'${quoteBits[bitIndex]}' `}${partDescription? '('+partDescription+') ':''}in '${verseText}'`); - const extract = `${quoteBits[bitIndex]}' ${partDescription ? '(' + partDescription + ')' : ''}`; - addNotice({ priority: 721, message: "Unable to find original language quote in verse text", extract, location: ourLocation }); + const extract = `${partDescription ? '(' + partDescription + ' quote portion)' : ''} '${quoteBits[bitIndex]}'`; + if (verseText.indexOf(quoteBits[bitIndex]) >= 0) { + console.assert(bitIndex > 0, "This shouldn't happen for bitIndex of zero!"); + // console.log(`914, Unable to find '${fieldText}' ${numQuoteBits === 1 ? '' : `'${quoteBits[bitIndex]}' `}${partDescription ? '(' + partDescription + ') ' : ''}in '${verseText}'`); + addNotice({ priority: 914, message: "Unable to find original language quote portion in the right place in the verse text", details: `passage ►${verseText}◄`, extract, location: ourLocation }); + } else { + // console.log(`915, Unable to find '${fieldText}' ${numQuoteBits === 1 ? '' : `'${quoteBits[bitIndex]}' `}${partDescription ? '(' + partDescription + ') ' : ''}in '${verseText}'`); + addNotice({ priority: 915, message: "Unable to find original language quote portion in verse text", details: `passage ►${verseText}◄`, extract, location: ourLocation }); + } } + // else console.log(`Found quote ${bitIndex} at ${quoteIndex} (num text chars = ${verseText.length})`); } } else // < 2 addNotice({ priority: 375, message: "Ellipsis without surrounding snippet", location: ourLocation });