refactor: Clean up OCR debug table structure and remove redundant regex checks

This commit is contained in:
Ross
2026-05-11 12:32:54 +01:00
parent f9a9b9bb38
commit 35887fbcaf
+15 -22
View File
@@ -272,21 +272,21 @@
<strong>Samples:</strong> ${debug.processedSamples}/${debug.totalSamples} · <strong>Flagged series:</strong> ${debug.flaggedSeriesCount} <strong>Samples:</strong> ${debug.processedSamples}/${debug.totalSamples} · <strong>Flagged series:</strong> ${debug.flaggedSeriesCount}
</div> </div>
${sampleRows ? ` ${sampleRows ? `
<div class="table-responsive ocr-debug-table-wrap"> <div class="table-responsive ocr-debug-table-wrap">
<table class="table table-sm align-middle ocr-debug-table"> <table class="table table-sm align-middle ocr-debug-table">
<thead> <thead>
<tr> <tr>
<th>Series UID</th> <th>Series UID</th>
<th>File</th> <th>File</th>
<th>Result</th> <th>Result</th>
<th>Match reasons</th> <th>Match reasons</th>
<th>OCR preview</th> <th>OCR preview</th>
</tr> </tr>
</thead> </thead>
<tbody>${sampleRows}</tbody> <tbody>${sampleRows}</tbody>
</table> </table>
</div> </div>
` : ""} ` : ""}
`; `;
} }
@@ -754,13 +754,6 @@
return getOcrPhiReasons(text).length > 0; return getOcrPhiReasons(text).length > 0;
} }
return /(ref|rk9|rh8|ra9|rbz|rba)\d+/i.test(value)
|| /\b\d{3}[\s-]?\d{3}[\s-]?\d{4}\b/.test(value)
|| /\b\d{10}\b/.test(value)
|| /\b\d{6,8}\b/.test(value)
|| /\b(?:dob|d\.o\.b|birth|born)\b/.test(value);
}
function buildOcrSamples(records) { function buildOcrSamples(records) {
const includeRecords = records.filter((record) => record.include); const includeRecords = records.filter((record) => record.include);
const seriesMap = {}; const seriesMap = {};