kordoc 4.24.13 → 4.24.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{-NBCZTPBD.js → -MG25ST6Y.js} +11 -11
- package/dist/{chunk-UVQOPGOA.js → chunk-3LFNTOL7.js} +14 -9
- package/dist/chunk-3LFNTOL7.js.map +1 -0
- package/dist/{chunk-BC4LVU4D.js → chunk-7VNYQHJV.js} +2 -2
- package/dist/{chunk-CKOCIQU6.js → chunk-AM6TECXD.js} +2 -2
- package/dist/{chunk-X2E5QCKO.js → chunk-AULD3QAB.js} +2 -2
- package/dist/{chunk-XGESPSWE.cjs → chunk-BUGXM2H5.cjs} +3 -3
- package/dist/{chunk-XGESPSWE.cjs.map → chunk-BUGXM2H5.cjs.map} +1 -1
- package/dist/{chunk-ZUMOEVMV.js → chunk-DIFJPJGN.js} +3 -3
- package/dist/{chunk-XWWQGSEP.js → chunk-ERYRF3EA.js} +2 -2
- package/dist/{chunk-QAGPSWGH.js → chunk-FGERVDQZ.js} +2 -2
- package/dist/{chunk-ZSCDH3NU.js → chunk-FUC3V2FR.js} +2 -2
- package/dist/{chunk-U2VAABMK.cjs → chunk-GV7ECKOK.cjs} +44 -27
- package/dist/chunk-GV7ECKOK.cjs.map +1 -0
- package/dist/{chunk-2H2VYPM2.cjs → chunk-HVILFVAT.cjs} +2 -2
- package/dist/{chunk-2H2VYPM2.cjs.map → chunk-HVILFVAT.cjs.map} +1 -1
- package/dist/{chunk-OVQWOOS3.js → chunk-J3OJWUON.js} +2 -2
- package/dist/{chunk-QVEAR6IR.js → chunk-LMQT2JFS.js} +22 -5
- package/dist/chunk-LMQT2JFS.js.map +1 -0
- package/dist/{chunk-37MTSMUF.js → chunk-LSFVBS2I.js} +2 -2
- package/dist/{chunk-IQGXY63Y.js → chunk-MACV3MZF.js} +23 -6
- package/dist/chunk-MACV3MZF.js.map +1 -0
- package/dist/{chunk-QW2H2HHS.js → chunk-MIJYCKJA.js} +115 -6
- package/dist/chunk-MIJYCKJA.js.map +1 -0
- package/dist/{chunk-DMPX4KLC.js → chunk-NIPFEMJJ.js} +2 -2
- package/dist/{chunk-WOVJRXIA.js → chunk-NVD24SLL.js} +2 -2
- package/dist/{chunk-A232MW5F.js → chunk-PVAJ4DBW.js} +2 -2
- package/dist/{chunk-BJBPBU5B.js → chunk-SSDHVKLM.js} +2 -2
- package/dist/{chunk-4I2CKMKU.js → chunk-TPZPICDM.js} +3 -3
- package/dist/{chunk-KTXDK5A6.js → chunk-UTLHDVC5.js} +2 -2
- package/dist/{chunk-PUHBCAXI.js → chunk-UUNCLJB7.js} +11 -11
- package/dist/{chunk-W52B6GOE.cjs → chunk-V26UPU2L.cjs} +3 -3
- package/dist/{chunk-W52B6GOE.cjs.map → chunk-V26UPU2L.cjs.map} +1 -1
- package/dist/{chunk-A4CYMI55.js → chunk-VBOFP27O.js} +2 -2
- package/dist/{chunk-FJ3IKKDV.js → chunk-WFOPOJHN.js} +115 -6
- package/dist/chunk-WFOPOJHN.js.map +1 -0
- package/dist/{chunk-VPKZB6Y7.cjs → chunk-ZBHS7KLW.cjs} +6 -6
- package/dist/{chunk-VPKZB6Y7.cjs.map → chunk-ZBHS7KLW.cjs.map} +1 -1
- package/dist/{chunk-WAWREGAC.js → chunk-ZIGWQ3IS.js} +2 -2
- package/dist/{chunk-QZ2H4ZTO.cjs → chunk-ZX66BXB5.cjs} +190 -81
- package/dist/chunk-ZX66BXB5.cjs.map +1 -0
- package/dist/chunks-JGSWNVLF.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-M4FM364X.js → formula-4KFXQSEG.js} +4 -4
- package/dist/{formula-ZKZGV6JV.cjs → formula-N6GWFPHK.cjs} +9 -9
- package/dist/{formula-ZKZGV6JV.cjs.map → formula-N6GWFPHK.cjs.map} +1 -1
- package/dist/{formula-WFL6JRCR.js → formula-WAYIKS54.js} +3 -3
- package/dist/{image-ocr-2V3M3ZEA.cjs → image-ocr-GY7SZAHN.cjs} +17 -17
- package/dist/{image-ocr-2V3M3ZEA.cjs.map → image-ocr-GY7SZAHN.cjs.map} +1 -1
- package/dist/{image-ocr-YJISJPKE.js → image-ocr-P5S2QDKW.js} +6 -6
- package/dist/{image-ocr-47CBNIS5.js → image-ocr-QBCR7ZD6.js} +9 -9
- package/dist/index.cjs +368 -363
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +23 -23
- package/dist/{model-bundle-7W344HDI.js → model-bundle-QAM24SYG.js} +5 -5
- package/dist/{models-TBHMNI7M.js → models-YHC236MP.js} +5 -5
- package/dist/{parse-worker-v2-JUYUEXCY.js → parse-worker-v2-LP7NKQBP.js} +12 -12
- package/dist/{parser-EKQCZLML.js → parser-26YUZU55.js} +12 -12
- package/dist/{parser-RNJ4KSDF.js → parser-DFJZ3CCE.js} +9 -9
- package/dist/{parser-R44KTBZX.cjs → parser-JWU6HYZZ.cjs} +159 -159
- package/dist/{parser-R44KTBZX.cjs.map → parser-JWU6HYZZ.cjs.map} +1 -1
- package/dist/{pdf-ocr-EE5KGFVX.js → pdf-ocr-BO6ACAGL.js} +9 -9
- package/dist/{pdf-ocr-ZAF4P74R.js → pdf-ocr-EEWQFS7P.js} +6 -6
- package/dist/pdf-ocr-Z4PBLB75.cjs +35 -0
- package/dist/{pdf-ocr-74BOCXAT.cjs.map → pdf-ocr-Z4PBLB75.cjs.map} +1 -1
- package/dist/{profile-io-RU3RVIYV.js → profile-io-PQXYWUBL.js} +3 -3
- package/dist/{rasterize-UNCPM26D.js → rasterize-CS7WZUGF.js} +3 -3
- package/dist/{redact-doc-BFE4UZCY.js → redact-doc-PI4JNHV6.js} +11 -11
- package/dist/{render-3DXTLKIA.js → render-M2CIEOF4.js} +7 -7
- package/dist/seal-4755WLFB.js +10 -0
- package/dist/{setup-7POQAKDG.js → setup-HGPUR27M.js} +3 -3
- package/dist/visual-JWWGGTKQ.js +21 -0
- package/dist/{watch-37YCXJWW.js → watch-B5ISBY3N.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-FJ3IKKDV.js.map +0 -1
- package/dist/chunk-IQGXY63Y.js.map +0 -1
- package/dist/chunk-QVEAR6IR.js.map +0 -1
- package/dist/chunk-QW2H2HHS.js.map +0 -1
- package/dist/chunk-QZ2H4ZTO.cjs.map +0 -1
- package/dist/chunk-U2VAABMK.cjs.map +0 -1
- package/dist/chunk-UVQOPGOA.js.map +0 -1
- package/dist/chunks-IXFBIZPW.js +0 -10
- package/dist/pdf-ocr-74BOCXAT.cjs +0 -35
- package/dist/seal-3LBTETDG.js +0 -10
- package/dist/visual-7SVIGIJC.js +0 -21
- /package/dist/{-NBCZTPBD.js.map → -MG25ST6Y.js.map} +0 -0
- /package/dist/{chunk-BC4LVU4D.js.map → chunk-7VNYQHJV.js.map} +0 -0
- /package/dist/{chunk-CKOCIQU6.js.map → chunk-AM6TECXD.js.map} +0 -0
- /package/dist/{chunk-X2E5QCKO.js.map → chunk-AULD3QAB.js.map} +0 -0
- /package/dist/{chunk-ZUMOEVMV.js.map → chunk-DIFJPJGN.js.map} +0 -0
- /package/dist/{chunk-XWWQGSEP.js.map → chunk-ERYRF3EA.js.map} +0 -0
- /package/dist/{chunk-QAGPSWGH.js.map → chunk-FGERVDQZ.js.map} +0 -0
- /package/dist/{chunk-ZSCDH3NU.js.map → chunk-FUC3V2FR.js.map} +0 -0
- /package/dist/{chunk-OVQWOOS3.js.map → chunk-J3OJWUON.js.map} +0 -0
- /package/dist/{chunk-37MTSMUF.js.map → chunk-LSFVBS2I.js.map} +0 -0
- /package/dist/{chunk-DMPX4KLC.js.map → chunk-NIPFEMJJ.js.map} +0 -0
- /package/dist/{chunk-WOVJRXIA.js.map → chunk-NVD24SLL.js.map} +0 -0
- /package/dist/{chunk-A232MW5F.js.map → chunk-PVAJ4DBW.js.map} +0 -0
- /package/dist/{chunk-BJBPBU5B.js.map → chunk-SSDHVKLM.js.map} +0 -0
- /package/dist/{chunk-4I2CKMKU.js.map → chunk-TPZPICDM.js.map} +0 -0
- /package/dist/{chunk-KTXDK5A6.js.map → chunk-UTLHDVC5.js.map} +0 -0
- /package/dist/{chunk-PUHBCAXI.js.map → chunk-UUNCLJB7.js.map} +0 -0
- /package/dist/{chunk-A4CYMI55.js.map → chunk-VBOFP27O.js.map} +0 -0
- /package/dist/{chunk-WAWREGAC.js.map → chunk-ZIGWQ3IS.js.map} +0 -0
- /package/dist/{chunks-IXFBIZPW.js.map → chunks-JGSWNVLF.js.map} +0 -0
- /package/dist/{formula-M4FM364X.js.map → formula-4KFXQSEG.js.map} +0 -0
- /package/dist/{formula-WFL6JRCR.js.map → formula-WAYIKS54.js.map} +0 -0
- /package/dist/{image-ocr-YJISJPKE.js.map → image-ocr-P5S2QDKW.js.map} +0 -0
- /package/dist/{image-ocr-47CBNIS5.js.map → image-ocr-QBCR7ZD6.js.map} +0 -0
- /package/dist/{model-bundle-7W344HDI.js.map → model-bundle-QAM24SYG.js.map} +0 -0
- /package/dist/{models-TBHMNI7M.js.map → models-YHC236MP.js.map} +0 -0
- /package/dist/{parse-worker-v2-JUYUEXCY.js.map → parse-worker-v2-LP7NKQBP.js.map} +0 -0
- /package/dist/{parser-EKQCZLML.js.map → parser-26YUZU55.js.map} +0 -0
- /package/dist/{parser-RNJ4KSDF.js.map → parser-DFJZ3CCE.js.map} +0 -0
- /package/dist/{pdf-ocr-EE5KGFVX.js.map → pdf-ocr-BO6ACAGL.js.map} +0 -0
- /package/dist/{pdf-ocr-ZAF4P74R.js.map → pdf-ocr-EEWQFS7P.js.map} +0 -0
- /package/dist/{profile-io-RU3RVIYV.js.map → profile-io-PQXYWUBL.js.map} +0 -0
- /package/dist/{rasterize-UNCPM26D.js.map → rasterize-CS7WZUGF.js.map} +0 -0
- /package/dist/{redact-doc-BFE4UZCY.js.map → redact-doc-PI4JNHV6.js.map} +0 -0
- /package/dist/{render-3DXTLKIA.js.map → render-M2CIEOF4.js.map} +0 -0
- /package/dist/{seal-3LBTETDG.js.map → seal-4755WLFB.js.map} +0 -0
- /package/dist/{setup-7POQAKDG.js.map → setup-HGPUR27M.js.map} +0 -0
- /package/dist/{visual-7SVIGIJC.js.map → visual-JWWGGTKQ.js.map} +0 -0
- /package/dist/{watch-37YCXJWW.js.map → watch-B5ISBY3N.js.map} +0 -0
|
@@ -35,14 +35,14 @@ var _chunkTK3FDAEEcjs = require('./chunk-TK3FDAEE.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkGV7ECKOKcjs = require('./chunk-GV7ECKOK.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunkZBHS7KLWcjs = require('./chunk-ZBHS7KLW.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _chunkHVILFVATcjs = require('./chunk-HVILFVAT.cjs');
|
|
46
46
|
|
|
47
47
|
// src/ocr/ruling-lines.ts
|
|
48
48
|
var INK_LUMA_MAX = 205;
|
|
@@ -389,9 +389,10 @@ var INKLESS_DELTA = 32;
|
|
|
389
389
|
function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
390
390
|
const chars = [...text];
|
|
391
391
|
if (chars.length !== steps.length) return text;
|
|
392
|
-
const gray =
|
|
393
|
-
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink:
|
|
392
|
+
const gray = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
393
|
+
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink: _chunkGV7ECKOKcjs.inkStats.call(void 0, gray) };
|
|
394
394
|
if (/[[\]]/.test(text)) brackets(c);
|
|
395
|
+
if (text.includes("'")) cornerQuotes(c);
|
|
395
396
|
if (/['"]/.test(text)) quotes(c);
|
|
396
397
|
if (/(^|\D)[1-9](\D|$)/.test(text)) circled(c);
|
|
397
398
|
if (text.includes("*")) stars(c);
|
|
@@ -406,7 +407,7 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
|
406
407
|
function trimInklessEnds(rgba, pageW, box, text, steps, stepPx) {
|
|
407
408
|
const chars = [...text], { w, h } = box;
|
|
408
409
|
if (chars.length !== steps.length || steps.some((s) => (s + 0.5) * stepPx > w + stepPx)) return { text, steps };
|
|
409
|
-
const gray =
|
|
410
|
+
const gray = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
410
411
|
const hist = new Uint32Array(256);
|
|
411
412
|
for (const v of gray) hist[v]++;
|
|
412
413
|
let bg = 0;
|
|
@@ -437,19 +438,32 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
|
|
|
437
438
|
continue;
|
|
438
439
|
}
|
|
439
440
|
if (open > 0) {
|
|
440
|
-
const f =
|
|
441
|
-
if (f &&
|
|
441
|
+
const f = _chunkGV7ECKOKcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
442
|
+
if (f && _chunkGV7ECKOKcjs.bracketShape.call(void 0, f, true) === "\u300D") {
|
|
442
443
|
chars[i] = "\u300D";
|
|
443
444
|
open--;
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
}
|
|
447
448
|
}
|
|
449
|
+
function cornerQuotes({ chars, cx, gray, w, h, ink }) {
|
|
450
|
+
for (let i = 0; i < chars.length; i++) {
|
|
451
|
+
if (chars[i] !== "'" || !/^[가-힣]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
452
|
+
const f = _chunkGV7ECKOKcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
453
|
+
if (!f || f.ch < f.charH * 0.45 || _chunkGV7ECKOKcjs.bracketShape.call(void 0, f, false) !== "\u300C") continue;
|
|
454
|
+
const rest = chars.slice(i + 1), end = rest.findIndex((c) => c === "'" || c === "\u300D" || c === ",");
|
|
455
|
+
const pair = end >= 0 && rest[end] !== "'" && (rest[end] === "\u300D" || (() => {
|
|
456
|
+
const g = _chunkGV7ECKOKcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
|
|
457
|
+
return !!g && _chunkGV7ECKOKcjs.bracketShape.call(void 0, g, true) === "\u300D";
|
|
458
|
+
})());
|
|
459
|
+
if (pair) chars[i] = "\u300C";
|
|
460
|
+
}
|
|
461
|
+
}
|
|
448
462
|
function brackets({ chars, cx, gray, w, h, ink }) {
|
|
449
463
|
for (let i = 0; i < chars.length; i++) {
|
|
450
464
|
if (chars[i] !== "[" && chars[i] !== "]") continue;
|
|
451
|
-
const f =
|
|
452
|
-
const shape = f &&
|
|
465
|
+
const f = _chunkGV7ECKOKcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
466
|
+
const shape = f && _chunkGV7ECKOKcjs.bracketShape.call(void 0, f, chars[i] === "]");
|
|
453
467
|
if (shape) chars[i] = shape;
|
|
454
468
|
}
|
|
455
469
|
}
|
|
@@ -470,7 +484,7 @@ function quotes({ chars, cx, gray, w, h, ink }) {
|
|
|
470
484
|
continue;
|
|
471
485
|
}
|
|
472
486
|
if (!year(i) && !single[kind]) continue;
|
|
473
|
-
const r =
|
|
487
|
+
const r = _chunkGV7ECKOKcjs.quoteHead.call(void 0, gray, w, h, ink, cx(i));
|
|
474
488
|
if (r !== null && r >= 0.47) {
|
|
475
489
|
chars[i] = kind === "'" ? "\u2018" : "\u201C";
|
|
476
490
|
open[kind] = true;
|
|
@@ -481,7 +495,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
481
495
|
const head = chars.findIndex((c) => c.trim()), letters = chars.some((c) => /[가-힣A-Za-z]/.test(c));
|
|
482
496
|
for (let i = 0; i < chars.length; i++) {
|
|
483
497
|
if (!/^[-\u2013\u2014]$/.test(chars[i])) continue;
|
|
484
|
-
const r =
|
|
498
|
+
const r = _chunkGV7ECKOKcjs.dashRatio.call(void 0, gray, w, h, ink, cx(i));
|
|
485
499
|
if (r === null) continue;
|
|
486
500
|
if (r < 0.65) chars[i] = "-";
|
|
487
501
|
else if (r > 0.75 && i === head && letters) chars[i] = "\u2014";
|
|
@@ -490,7 +504,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
490
504
|
function circled({ chars, cx, gray, w, h, ink }) {
|
|
491
505
|
const at = chars.flatMap((c, i) => /^[1-9]$/.test(c) && !/\d/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) && !/\d/.test(_nullishCoalesce(chars[i + 1], () => ( ""))) ? [i] : []);
|
|
492
506
|
if (!at.length) return;
|
|
493
|
-
const hit =
|
|
507
|
+
const hit = _chunkGV7ECKOKcjs.circledAt.call(void 0, gray, w, h, ink, at.map(cx));
|
|
494
508
|
at.forEach((i, k) => {
|
|
495
509
|
if (hit[k]) chars[i] = String.fromCharCode(9311 + Number(chars[i]));
|
|
496
510
|
});
|
|
@@ -500,16 +514,16 @@ function stars({ chars, cx, gray, w, h, ink }) {
|
|
|
500
514
|
if (chars[i] !== "*" || chars[i - 1] === "*") continue;
|
|
501
515
|
let e = i;
|
|
502
516
|
while (chars[e + 1] === "*") e++;
|
|
503
|
-
const n =
|
|
517
|
+
const n = _chunkGV7ECKOKcjs.starRun.call(void 0, gray, w, h, ink, cx(i));
|
|
504
518
|
if (n > e - i + 1 && n <= 4) chars[e] += "*".repeat(n - (e - i + 1));
|
|
505
519
|
i = e;
|
|
506
520
|
}
|
|
507
521
|
}
|
|
508
522
|
function discs({ chars, cx, gray, w, h, ink }) {
|
|
509
|
-
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) &&
|
|
523
|
+
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) && _chunkGV7ECKOKcjs.discAt.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u25CF";
|
|
510
524
|
}
|
|
511
525
|
function gaps({ chars, cx, gray, w, h, ink }) {
|
|
512
|
-
const { glyphs, bandH } =
|
|
526
|
+
const { glyphs, bandH } = _chunkGV7ECKOKcjs.gapGlyphs.call(void 0, gray, w, h, ink);
|
|
513
527
|
if (!glyphs.length) return;
|
|
514
528
|
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
515
529
|
if (!live.length) return;
|
|
@@ -546,6 +560,14 @@ function gaps({ chars, cx, gray, w, h, ink }) {
|
|
|
546
560
|
if (loose.some((o) => o !== g && Math.abs((o.x0 + o.x1) / 2 - mid) <= pitch * 1.5)) continue;
|
|
547
561
|
if (/[\u2026.\u00b7]$/.test(prev) || /^[\u2026.\u00b7]/.test(next)) continue;
|
|
548
562
|
}
|
|
563
|
+
if (g.mark === "\u300C") {
|
|
564
|
+
let sp = chars.findIndex((c, i) => c === " " && near(i));
|
|
565
|
+
if (sp >= 0) while (chars[sp + 1] === " ") sp++;
|
|
566
|
+
if (sp >= 0) {
|
|
567
|
+
chars[sp] = g.mark;
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
549
571
|
if (g.mark === "\xB7") {
|
|
550
572
|
if (/^\d/.test(next)) continue;
|
|
551
573
|
const sp = chars.findIndex((c, i) => c === " " && near(i));
|
|
@@ -559,10 +581,23 @@ function gaps({ chars, cx, gray, w, h, ink }) {
|
|
|
559
581
|
}
|
|
560
582
|
function ring({ chars, cx, gray, w, h, ink }) {
|
|
561
583
|
const k = chars.findIndex((c) => c.trim());
|
|
562
|
-
if (k < 0 || !/^[\u3147Oo0\
|
|
584
|
+
if (k < 0 || !/^[\u3147Oo0\u25cbCc]$/.test(chars[k])) return false;
|
|
563
585
|
const rest = chars.slice(k + 1).join("").trimStart();
|
|
586
|
+
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
587
|
+
if (live.length <= 3 && live.every((i) => /^[Oo]$/.test(chars[i]))) {
|
|
588
|
+
if (_optionalChain([_chunkGV7ECKOKcjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _2 => _2.mark]) === "\u25CE") return false;
|
|
589
|
+
if (!live.every((i) => _chunkGV7ECKOKcjs.ringBullet.call(void 0, gray, w, h, ink, cx(i)) === "\u25CB")) return false;
|
|
590
|
+
for (const i of live) chars[i] = "\u25CB";
|
|
591
|
+
return true;
|
|
592
|
+
}
|
|
593
|
+
if (/^[A-Z]{2,}/.test(rest) && /^[Oo0]$/.test(chars[k])) {
|
|
594
|
+
if (_chunkGV7ECKOKcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k)) !== "\u25CB") return false;
|
|
595
|
+
chars[k] = chars[k + 1] === " " ? "\u25CB" : "\u25CB ";
|
|
596
|
+
return true;
|
|
597
|
+
}
|
|
564
598
|
if (!/^[(\[「【<]?\d*[가-힣]/.test(rest)) return false;
|
|
565
|
-
const r =
|
|
599
|
+
const r = _chunkGV7ECKOKcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k));
|
|
600
|
+
if (/^[Cc]$/.test(chars[k]) && r !== "\u25CB") return false;
|
|
566
601
|
if (r) chars[k] = r;
|
|
567
602
|
return r !== null;
|
|
568
603
|
}
|
|
@@ -570,7 +605,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
570
605
|
const ROMAN = /^[IⅠ-Ⅲ]$/, LATIN = /[A-Za-z]$/;
|
|
571
606
|
for (let i = 0; i < chars.length; i++) {
|
|
572
607
|
if (chars[i] !== "1" || /[\dA-Za-z]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || /^[\dA-Za-z,]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
573
|
-
if (
|
|
608
|
+
if (_chunkGV7ECKOKcjs.serifOne.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u2160";
|
|
574
609
|
}
|
|
575
610
|
for (let i = 0; i < chars.length; i++) {
|
|
576
611
|
if (chars[i] !== "|" || chars[i - 1] === "|" || chars[i + 1] === "|") continue;
|
|
@@ -579,13 +614,13 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
579
614
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
580
615
|
const glued = /[가-힣]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || (_nullishCoalesce(chars[i + 1], () => ( ""))) === "." || chars[p] === "-" && chars[q] === "-";
|
|
581
616
|
if (!glued) continue;
|
|
582
|
-
const n =
|
|
617
|
+
const n = _chunkGV7ECKOKcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity);
|
|
583
618
|
if (n) chars[i] = String.fromCharCode(8543 + n);
|
|
584
619
|
}
|
|
585
620
|
const inRoman = (i) => ROMAN.test(chars[i]) || chars[i] === "1" && (ROMAN.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || ROMAN.test(_nullishCoalesce(chars[i + 1], () => ( ""))));
|
|
586
621
|
const k = chars.findIndex((c) => c.trim());
|
|
587
622
|
if (chars[k] === "." && chars.slice(k + 1).some((c) => /[가-힣A-Za-z0-9]/.test(c))) {
|
|
588
|
-
const n =
|
|
623
|
+
const n = _chunkGV7ECKOKcjs.romanStems.call(void 0, gray, w, h, ink, -Infinity, cx(k));
|
|
589
624
|
if (n) chars[k] = String.fromCharCode(8543 + n) + chars[k];
|
|
590
625
|
}
|
|
591
626
|
for (let s = 0; s < chars.length; ) {
|
|
@@ -603,7 +638,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
603
638
|
let p = s - 1, q = e;
|
|
604
639
|
while (p >= 0 && !chars[p].trim()) p--;
|
|
605
640
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
606
|
-
const n =
|
|
641
|
+
const n = _chunkGV7ECKOKcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity);
|
|
607
642
|
const canon = n ? [["\u2160", "I"], ["\u2161", "II"], ["\u2162", "III"]][n - 1] : null;
|
|
608
643
|
if (canon && !canon.includes(tok)) {
|
|
609
644
|
chars[s] = canon[0];
|
|
@@ -696,7 +731,7 @@ function joinLeaderItems(items, ends) {
|
|
|
696
731
|
for (const o of items) if (!gone.has(o) && junk(o) && sameLine(o, left) && o.x + o.w / 2 >= left.x + left.w - left.h && o.x + o.w / 2 <= right.x + right.h) gone.add(o);
|
|
697
732
|
};
|
|
698
733
|
for (const it of [...items].sort((a, b) => b.x - a.x)) {
|
|
699
|
-
if (gone.has(it) || !_optionalChain([ends, 'access',
|
|
734
|
+
if (gone.has(it) || !_optionalChain([ends, 'access', _3 => _3.get, 'call', _4 => _4(it), 'optionalAccess', _5 => _5.lead])) continue;
|
|
700
735
|
const left = neighbor(it, true);
|
|
701
736
|
if (left) {
|
|
702
737
|
dropJunkBetween(left, it);
|
|
@@ -704,7 +739,7 @@ function joinLeaderItems(items, ends) {
|
|
|
704
739
|
}
|
|
705
740
|
}
|
|
706
741
|
for (const it of [...items].sort((a, b) => a.x - b.x)) {
|
|
707
|
-
if (gone.has(it) || !_optionalChain([ends, 'access',
|
|
742
|
+
if (gone.has(it) || !_optionalChain([ends, 'access', _6 => _6.get, 'call', _7 => _7(it), 'optionalAccess', _8 => _8.trail])) continue;
|
|
708
743
|
const right = neighbor(it, false);
|
|
709
744
|
if (right) {
|
|
710
745
|
dropJunkBetween(it, right);
|
|
@@ -869,6 +904,71 @@ var MIN_INK_RATIO = 0.01;
|
|
|
869
904
|
var MAX_LOCAL_MODEL_BYTES = 1024 * 1024 * 1024;
|
|
870
905
|
var DET_MEAN = [0.485, 0.456, 0.406];
|
|
871
906
|
var DET_STD = [0.229, 0.224, 0.225];
|
|
907
|
+
function footerInkBox(rgba, width, height, boxes) {
|
|
908
|
+
const y0 = Math.floor(height * 0.88), x0 = Math.floor(width * 0.3), x1 = Math.ceil(width * 0.7);
|
|
909
|
+
let minX = Infinity, maxX = -1, minY = Infinity, maxY = -1;
|
|
910
|
+
for (let y = y0; y < height; y++) for (let x = x0; x < x1; x++) {
|
|
911
|
+
const p = (y * width + x) * 4;
|
|
912
|
+
if (rgba[p] * 77 + rgba[p + 1] * 150 + rgba[p + 2] * 29 >> 8 >= 128) continue;
|
|
913
|
+
if (boxes.some((b) => x >= b.x && x < b.x + b.w && y >= b.y && y < b.y + b.h)) continue;
|
|
914
|
+
if (x < minX) minX = x;
|
|
915
|
+
if (x > maxX) maxX = x;
|
|
916
|
+
if (y < minY) minY = y;
|
|
917
|
+
if (y > maxY) maxY = y;
|
|
918
|
+
}
|
|
919
|
+
if (maxX < 0) return null;
|
|
920
|
+
const bh = maxY - minY + 1;
|
|
921
|
+
if (bh < height * 5e-3 || bh > height * 0.025 || maxX - minX + 1 > width * 0.2) return null;
|
|
922
|
+
const pad = 4, bx = Math.max(0, minX - pad), by = Math.max(0, minY - pad);
|
|
923
|
+
return { x: bx, y: by, w: Math.min(width, maxX + pad + 1) - bx, h: Math.min(height, maxY + pad + 1) - by };
|
|
924
|
+
}
|
|
925
|
+
function closingParens(rgba, width, items) {
|
|
926
|
+
const out = [];
|
|
927
|
+
const dark = (x, y) => {
|
|
928
|
+
const p = (y * width + x) * 4;
|
|
929
|
+
return rgba[p] * 77 + rgba[p + 1] * 150 + rgba[p + 2] * 29 >> 8 < 128;
|
|
930
|
+
};
|
|
931
|
+
for (const it of items) {
|
|
932
|
+
const t = it.text.replace(/\s+$/, "");
|
|
933
|
+
if ((_nullishCoalesce(_optionalChain([t, 'access', _9 => _9.match, 'call', _10 => _10(/\(/g), 'optionalAccess', _11 => _11.length]), () => ( 0))) <= (_nullishCoalesce(_optionalChain([t, 'access', _12 => _12.match, 'call', _13 => _13(/\)/g), 'optionalAccess', _14 => _14.length]), () => ( 0))) || !/\([^()]*$/.test(t)) continue;
|
|
934
|
+
const x0 = it.x + it.w + 2;
|
|
935
|
+
const next = items.filter((o) => o !== it && o.x >= x0 && o.y < it.y + it.h && o.y + o.h > it.y).reduce((m, o) => Math.min(m, o.x), Infinity);
|
|
936
|
+
const x1 = Math.min(width, next, x0 + it.h * 8);
|
|
937
|
+
let minX = Infinity, maxX = -1, minY = Infinity, maxY = -1, cols = 0, prevOn = false, runs = 0;
|
|
938
|
+
for (let x = x0; x < x1; x++) {
|
|
939
|
+
let on = false;
|
|
940
|
+
for (let y = it.y; y < it.y + it.h; y++) if (dark(x, y)) {
|
|
941
|
+
on = true;
|
|
942
|
+
if (y < minY) minY = y;
|
|
943
|
+
if (y > maxY) maxY = y;
|
|
944
|
+
}
|
|
945
|
+
if (on) {
|
|
946
|
+
cols++;
|
|
947
|
+
if (!prevOn) runs++;
|
|
948
|
+
if (x < minX) minX = x;
|
|
949
|
+
maxX = x;
|
|
950
|
+
}
|
|
951
|
+
prevOn = on;
|
|
952
|
+
}
|
|
953
|
+
if (runs !== 1 || maxX - minX + 1 > it.h * 0.5 || maxY - minY + 1 < it.h * 0.6) continue;
|
|
954
|
+
let rule = false;
|
|
955
|
+
for (let x = minX; x <= maxX && !rule; x++) rule = minY > 1 && dark(x, minY - 2) || dark(x, Math.min(maxY + 2, Math.floor(rgba.length / 4 / width) - 1));
|
|
956
|
+
if (rule) continue;
|
|
957
|
+
const meanX = (ya, yb) => {
|
|
958
|
+
let sx = 0, k = 0;
|
|
959
|
+
for (let y = ya; y < yb; y++) for (let x = minX; x <= maxX; x++) if (dark(x, y)) {
|
|
960
|
+
sx += x;
|
|
961
|
+
k++;
|
|
962
|
+
}
|
|
963
|
+
return k ? sx / k : NaN;
|
|
964
|
+
};
|
|
965
|
+
const ch = maxY - minY + 1, band = Math.max(1, Math.round(ch * 0.2));
|
|
966
|
+
const ends = (meanX(minY, minY + band) + meanX(maxY + 1 - band, maxY + 1)) / 2, mid = meanX(minY + Math.floor(ch * 0.4), minY + Math.ceil(ch * 0.6));
|
|
967
|
+
if (!(mid - ends >= 0.8)) continue;
|
|
968
|
+
out.push({ text: ")", x: minX, y: minY, w: maxX - minX + 1, h: maxY - minY + 1, confidence: it.confidence });
|
|
969
|
+
}
|
|
970
|
+
return out;
|
|
971
|
+
}
|
|
872
972
|
var OcrEngine = class _OcrEngine {
|
|
873
973
|
|
|
874
974
|
|
|
@@ -882,7 +982,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
882
982
|
this.ort = parts.ort;
|
|
883
983
|
this.sharp = parts.sharp;
|
|
884
984
|
}
|
|
885
|
-
static async create(models =
|
|
985
|
+
static async create(models = _chunkGV7ECKOKcjs.DEFAULT_OCR_MODELS) {
|
|
886
986
|
_chunkTK3FDAEEcjs.disableOrtTelemetry.call(void 0, );
|
|
887
987
|
const [ortMod, sharpModRaw] = await Promise.all([
|
|
888
988
|
tryImport("onnxruntime-node", () => Promise.resolve().then(() => _interopRequireWildcard(require("onnxruntime-node")))),
|
|
@@ -902,16 +1002,16 @@ var OcrEngine = class _OcrEngine {
|
|
|
902
1002
|
const local = (s) => "spec" in s ? Promise.resolve(null) : verifiedBytes(s);
|
|
903
1003
|
const [detBytes, recBytes, dictBytes] = await Promise.all([local(models.det), local(models.rec), local(models.dict)]);
|
|
904
1004
|
const session = (s, bytes) => bytes ? ortMod.InferenceSession.create(bytes, sessionOpts).catch(() => {
|
|
905
|
-
throw new (0,
|
|
906
|
-
}) : ortMod.InferenceSession.create(
|
|
1005
|
+
throw new (0, _chunkHVILFVATcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkGV7ECKOKcjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
|
|
1006
|
+
}) : ortMod.InferenceSession.create(_chunkGV7ECKOKcjs.ocrSourcePath.call(void 0, s), sessionOpts);
|
|
907
1007
|
const [det, rec, dictYml] = await Promise.all([
|
|
908
1008
|
session(models.det, detBytes),
|
|
909
1009
|
session(models.rec, recBytes),
|
|
910
|
-
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0,
|
|
1010
|
+
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0, _chunkGV7ECKOKcjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
|
|
911
1011
|
]);
|
|
912
|
-
const dict =
|
|
1012
|
+
const dict = _chunkGV7ECKOKcjs.parseCharacterDict.call(void 0, dictYml);
|
|
913
1013
|
if (dict.length === 0) {
|
|
914
|
-
throw "spec" in models.dict ? new Error("OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 \uBAA8\uB378 \uCE90\uC2DC\uB97C \uC0AD\uC81C \uD6C4 \uC7AC\uB2E4\uC6B4\uB85C\uB4DC\uD558\uC138\uC694") : new (0,
|
|
1014
|
+
throw "spec" in models.dict ? new Error("OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 \uBAA8\uB378 \uCE90\uC2DC\uB97C \uC0AD\uC81C \uD6C4 \uC7AC\uB2E4\uC6B4\uB85C\uB4DC\uD558\uC138\uC694") : new (0, _chunkHVILFVATcjs.KordocError)(`OCR \uC0AC\uC804 \uD30C\uC2F1 \uC2E4\uD328 \u2014 ${_path.basename.call(void 0, models.dict.file.path)} \uC5D0 PostProcess.character_dict \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
915
1015
|
}
|
|
916
1016
|
return new _OcrEngine({ det, rec, dict, ort: ortMod, sharp: sharpMod });
|
|
917
1017
|
}
|
|
@@ -943,10 +1043,10 @@ var OcrEngine = class _OcrEngine {
|
|
|
943
1043
|
if (it.x - x < it.h * 0.8) return;
|
|
944
1044
|
if (items.some((o) => o !== it && o.x < it.x && o.x + o.w > x && o.y < it.y + it.h && o.y + o.h > it.y)) return;
|
|
945
1045
|
const box = { x, y: it.y, w: it.x + it.w - x, h: it.h };
|
|
946
|
-
const g =
|
|
947
|
-
const b =
|
|
948
|
-
if (_optionalChain([b, 'optionalAccess',
|
|
949
|
-
const ink =
|
|
1046
|
+
const g = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, box);
|
|
1047
|
+
const b = _chunkGV7ECKOKcjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g), it.x - x, 1.05);
|
|
1048
|
+
if (_optionalChain([b, 'optionalAccess', _15 => _15.mark]) !== "\u25A1" || b.covers) return;
|
|
1049
|
+
const ink = _chunkGV7ECKOKcjs.inkStats.call(void 0, g), on = (v) => ink.darkInk ? v <= ink.threshold : v > ink.threshold;
|
|
950
1050
|
let left = 0;
|
|
951
1051
|
while (left < it.x - x && !Array.from({ length: box.h }, (_, y) => g[y * box.w + left]).some(on)) left++;
|
|
952
1052
|
it.text = "\u25A1 " + it.text;
|
|
@@ -958,16 +1058,17 @@ var OcrEngine = class _OcrEngine {
|
|
|
958
1058
|
const detected = await this.detect(rgba, width, height, tuning, stats);
|
|
959
1059
|
const rows = rowRules.length ? detected.flatMap((b) => splitBoxAtRowRules(b, rowRules)) : detected;
|
|
960
1060
|
const boxes = cellRules.length ? rows.flatMap((b) => splitBoxAtCellRules(b, cellRules)) : rows;
|
|
1061
|
+
const footer = tuning.postprocess ? footerInkBox(rgba, width, height, boxes) : null;
|
|
961
1062
|
const jobs = [];
|
|
962
1063
|
const joins = [];
|
|
963
1064
|
let group = 0;
|
|
964
1065
|
for (const b of boxes) {
|
|
965
|
-
const gray =
|
|
966
|
-
const ink =
|
|
1066
|
+
const gray = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, b);
|
|
1067
|
+
const ink = _chunkGV7ECKOKcjs.inkStats.call(void 0, gray);
|
|
967
1068
|
if (tuning.minInkContrast > 0 && ink.contrast < tuning.minInkContrast) continue;
|
|
968
1069
|
if (tuning.minInkContrast > 0 && ink.inkRatio < MIN_INK_RATIO) continue;
|
|
969
1070
|
if (tuning.splitTall && b.h >= b.w * TALL_RATIO) {
|
|
970
|
-
const bands =
|
|
1071
|
+
const bands = _chunkGV7ECKOKcjs.splitRowBands.call(void 0, gray, b.w, b.h, ink, 0.45);
|
|
971
1072
|
if (bands.length >= 2) {
|
|
972
1073
|
for (const sub of bandBoxes(b, bands, height)) jobs.push({ box: sub, rot: 0, group: group++ });
|
|
973
1074
|
continue;
|
|
@@ -978,9 +1079,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
978
1079
|
continue;
|
|
979
1080
|
}
|
|
980
1081
|
}
|
|
981
|
-
const trim = tuning.trimEdges ?
|
|
1082
|
+
const trim = tuning.trimEdges ? _chunkGV7ECKOKcjs.edgeTrim.call(void 0, gray, b.w, b.h, ink) : null;
|
|
982
1083
|
const keep = trim ? { ...trim, bg: median(gray) } : void 0;
|
|
983
|
-
const leaders = tuning.splitLeaders ?
|
|
1084
|
+
const leaders = tuning.splitLeaders ? _chunkGV7ECKOKcjs.leaderRuns.call(void 0, gray, b.w, b.h, ink, LEADER_MIN_DOTS) : [];
|
|
984
1085
|
if (leaders.length) {
|
|
985
1086
|
const join = joins.length;
|
|
986
1087
|
joins.push({ box: b, parts: [], trailDots: false });
|
|
@@ -989,7 +1090,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
989
1090
|
const bare = { x: b.x + x0, y: b.y, w: a - x0, h: b.h };
|
|
990
1091
|
const end = c > a ? Math.min(c, a + Math.round(b.h * LEADER_CONTEXT)) : a;
|
|
991
1092
|
x0 = c;
|
|
992
|
-
if (bare.w >= DET_MIN_SIZE &&
|
|
1093
|
+
if (bare.w >= DET_MIN_SIZE && _chunkGV7ECKOKcjs.inkStats.call(void 0, _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, bare)).contrast >= Math.max(1, tuning.minInkContrast)) {
|
|
993
1094
|
jobs.push({ box: { ...bare, w: end - (bare.x - b.x) }, rot: 0, group: group++, join, dotsBefore: dots, trimDots: end > a });
|
|
994
1095
|
dots = false;
|
|
995
1096
|
}
|
|
@@ -1001,6 +1102,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1001
1102
|
if (keep) jobs.push({ box: b, rot: 0, group, keep });
|
|
1002
1103
|
jobs.push({ box: b, rot: 0, group: group++ });
|
|
1003
1104
|
}
|
|
1105
|
+
if (footer) jobs.push({ box: footer, rot: 0, group: group++, footer: true });
|
|
1004
1106
|
const results = await this.recognizeJobs(rgba, width, jobs, tuning.recBatch);
|
|
1005
1107
|
const best = /* @__PURE__ */ new Map();
|
|
1006
1108
|
const score = (job, confidence) => confidence - (job.keep ? KEEP_MARGIN : 0);
|
|
@@ -1018,38 +1120,44 @@ var OcrEngine = class _OcrEngine {
|
|
|
1018
1120
|
const raw = tuning.postprocess && job.rot === 0 ? restoreGlyphs(rgba, width, job.box, read, steps, stepPx, note) : read;
|
|
1019
1121
|
let text = tuning.postprocess ? restoreSymbols(raw.trim(), note.ringLead) : raw;
|
|
1020
1122
|
if (!text.trim()) continue;
|
|
1021
|
-
if (tuning.postprocess && job.rot === 0 && !/^[
|
|
1123
|
+
if (tuning.postprocess && job.rot === 0 && !/^[◎●▪□■▣❐❏○ㅇ◆◇◈]/.test(text)) {
|
|
1022
1124
|
const chars = [...read], k = chars.findIndex((c) => c.trim());
|
|
1023
1125
|
if (k >= 0 && steps.length === chars.length) {
|
|
1024
|
-
const g =
|
|
1025
|
-
const b =
|
|
1126
|
+
const g = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1127
|
+
const b = _chunkGV7ECKOKcjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx);
|
|
1026
1128
|
const body = (_nullishCoalesce(text.match(/[가-힣]/g), () => ( []))).length >= 4;
|
|
1027
1129
|
const miss = /^[Oo0•·ㆍ∙‧○]/.test(text);
|
|
1028
|
-
if (_optionalChain([b, 'optionalAccess',
|
|
1029
|
-
else if (_optionalChain([b, 'optionalAccess',
|
|
1130
|
+
if (_optionalChain([b, 'optionalAccess', _16 => _16.mark]) === "\u25CE" && b.covers && /^[Oo0○]/.test(text)) text = b.mark + " " + text.slice(1).trimStart();
|
|
1131
|
+
else if (_optionalChain([b, 'optionalAccess', _17 => _17.mark]) === "\u25A1" || _optionalChain([b, 'optionalAccess', _18 => _18.mark]) === "\u25A3") {
|
|
1030
1132
|
if (!b.covers && body) text = b.mark + " " + text;
|
|
1031
|
-
} else if (_optionalChain([b, 'optionalAccess',
|
|
1133
|
+
} else if (_optionalChain([b, 'optionalAccess', _19 => _19.mark]) === "\u25C6" || _optionalChain([b, 'optionalAccess', _20 => _20.mark]) === "\u25C7" || _optionalChain([b, 'optionalAccess', _21 => _21.mark]) === "\u25C8") {
|
|
1134
|
+
if (b.covers ? /^[\p{S}\p{P}]/u.test(text) : body) text = b.covers ? b.mark + " " + text.slice(1).trimStart() : b.mark + " " + text;
|
|
1135
|
+
} else if (_optionalChain([b, 'optionalAccess', _22 => _22.mark]) === "\u2023") {
|
|
1032
1136
|
if (b.covers ? text.startsWith("\u2192") : body) text = b.covers ? b.mark + " " + text.slice(1).trimStart() : b.mark + " " + text;
|
|
1033
|
-
} else if (_optionalChain([b, 'optionalAccess',
|
|
1137
|
+
} else if (_optionalChain([b, 'optionalAccess', _23 => _23.mark]) === "\u2750" || _optionalChain([b, 'optionalAccess', _24 => _24.mark]) === "\u274F") {
|
|
1034
1138
|
if (b.covers ? /^[ㅁ口]/.test(text) : body) text = b.covers ? b.mark + text.slice(1) : b.mark + " " + text;
|
|
1035
1139
|
} else if (b && b.mark !== "\u25CE" && body) text = b.covers ? miss ? b.mark + " " + text.slice(1).trimStart() : text : b.mark + " " + text;
|
|
1036
|
-
else if (!b && body && /^[가-힣]/.test(chars[k]) &&
|
|
1140
|
+
else if (!b && body && /^[가-힣]/.test(chars[k]) && _chunkGV7ECKOKcjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx)) text = "\u25CB " + text;
|
|
1037
1141
|
}
|
|
1038
1142
|
}
|
|
1039
1143
|
if (tuning.postprocess && /^\d/.test(text) && job.rot === 0) {
|
|
1040
|
-
const g =
|
|
1041
|
-
const tri =
|
|
1144
|
+
const g = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1145
|
+
const tri = _chunkGV7ECKOKcjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g));
|
|
1042
1146
|
if (tri) text = tri + text;
|
|
1043
1147
|
}
|
|
1044
1148
|
if (tuning.postprocess && text === "\u2192" && job.rot === 0 && job.join === void 0) {
|
|
1045
|
-
const g =
|
|
1046
|
-
text = _nullishCoalesce(
|
|
1149
|
+
const g = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1150
|
+
text = _nullishCoalesce(_chunkGV7ECKOKcjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g)), () => ( text));
|
|
1151
|
+
}
|
|
1152
|
+
if (job.footer) {
|
|
1153
|
+
if (!/^[-\u2013\u2014]?\s*(?:\d{1,4}|[ivxIVXⅰ-ⅹⅠ-Ⅹ]{1,4})\s*[-\u2013\u2014]?$/.test(text.trim())) continue;
|
|
1154
|
+
text = text.replace(/[\u2013\u2014]/g, "-");
|
|
1047
1155
|
}
|
|
1048
1156
|
if (tuning.postprocess && isDotFragment(text)) continue;
|
|
1049
1157
|
if (confidence < tuning.textScore) {
|
|
1050
1158
|
if (stats) {
|
|
1051
1159
|
stats.droppedLowConf++;
|
|
1052
|
-
_optionalChain([stats, 'access',
|
|
1160
|
+
_optionalChain([stats, 'access', _25 => _25.dropped, 'optionalAccess', _26 => _26.push, 'call', _27 => _27({ text, ...this.itemBox(rgba, width, job.box, tuning), confidence })]);
|
|
1053
1161
|
}
|
|
1054
1162
|
continue;
|
|
1055
1163
|
}
|
|
@@ -1059,7 +1167,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1059
1167
|
continue;
|
|
1060
1168
|
}
|
|
1061
1169
|
const item = { text, ...this.itemBox(rgba, width, job.box, tuning), confidence };
|
|
1062
|
-
if (job.rot === 0)
|
|
1170
|
+
if (job.rot === 0) _chunkGV7ECKOKcjs.rememberOcrTextGaps.call(void 0, item, _chunkGV7ECKOKcjs.findOcrTextGaps.call(void 0, rgba, width, job.box, read, text, steps, stepPx));
|
|
1063
1171
|
items.push(item);
|
|
1064
1172
|
}
|
|
1065
1173
|
const leaderEnds = /* @__PURE__ */ new Map();
|
|
@@ -1083,6 +1191,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1083
1191
|
if (leaderEnds.size) items = joinLeaderItems(items, leaderEnds);
|
|
1084
1192
|
if (tuning.postprocess) items = dropNestedFragments(items);
|
|
1085
1193
|
if (tuning.postprocess) for (const it of items) this.outerSquare(rgba, width, it, items);
|
|
1194
|
+
if (tuning.postprocess) items.push(...closingParens(rgba, width, items));
|
|
1086
1195
|
if (tuning.postprocess) restoreBulletItems(items);
|
|
1087
1196
|
items.sort((a, b) => a.y - b.y || a.x - b.x);
|
|
1088
1197
|
return items;
|
|
@@ -1090,8 +1199,8 @@ var OcrEngine = class _OcrEngine {
|
|
|
1090
1199
|
/** 결과 좌표 — det 박스 그대로 또는 박스 안 잉크 외곽 (tightBoxes) */
|
|
1091
1200
|
itemBox(rgba, width, b, tuning) {
|
|
1092
1201
|
if (!tuning.tightBoxes) return b;
|
|
1093
|
-
const gray =
|
|
1094
|
-
const t =
|
|
1202
|
+
const gray = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, width, b);
|
|
1203
|
+
const t = _chunkGV7ECKOKcjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, gray));
|
|
1095
1204
|
return { x: b.x + t.x0, y: b.y + t.y0, w: t.x1 - t.x0, h: t.y1 - t.y0 };
|
|
1096
1205
|
}
|
|
1097
1206
|
// ─── det ─────────────────────────────────────────────
|
|
@@ -1164,7 +1273,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1164
1273
|
const out = await this.rec.run({ [this.rec.inputNames[0]]: tensor });
|
|
1165
1274
|
const logits = out[this.rec.outputNames[0]];
|
|
1166
1275
|
const [, T, C] = logits.dims;
|
|
1167
|
-
if (C !== this.dict.length + 2) throw new (0,
|
|
1276
|
+
if (C !== this.dict.length + 2) throw new (0, _chunkHVILFVATcjs.KordocError)(`OCR rec \uCD9C\uB825 \uD074\uB798\uC2A4 ${C}\uAC1C\uAC00 \uC0AC\uC804 ${this.dict.length}\uC790 + 2 \uC640 \uB2E4\uB985\uB2C8\uB2E4 \u2014 \uBAA8\uB378\uC5D0 \uB9DE\uB294 \uC0AC\uC804(ocrRecDict)\uC744 \uC9C0\uC815\uD558\uC138\uC694`);
|
|
1168
1277
|
const data = logits.data;
|
|
1169
1278
|
idx.forEach((ci, k) => {
|
|
1170
1279
|
const r = ctcDecode(data.subarray(k * T * C, (k + 1) * T * C), T, C, this.dict);
|
|
@@ -1174,9 +1283,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
1174
1283
|
const chars = r ? [...r.text] : [];
|
|
1175
1284
|
if (r && job.rot === 0 && chars.length === r.steps.length && r.steps.some((t) => t > last) && !r.text.includes("(cid:")) {
|
|
1176
1285
|
const tallCh = (c) => !/[\s.,:;\u00b7\u2026'"\u2018-\u201d`\-_~]/.test(c);
|
|
1177
|
-
const g =
|
|
1286
|
+
const g = _chunkGV7ECKOKcjs.grayCrop.call(void 0, rgba, pageW, job.box);
|
|
1178
1287
|
const inside = chars.filter((c, i) => r.steps[i] <= last && tallCh(c)).length;
|
|
1179
|
-
let budget = inside <= 2 ?
|
|
1288
|
+
let budget = inside <= 2 ? _chunkGV7ECKOKcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkGV7ECKOKcjs.inkStats.call(void 0, g)) - inside : Infinity;
|
|
1180
1289
|
const keep = chars.map((c, i) => r.steps[i] <= last || !tallCh(c) || budget-- > 0);
|
|
1181
1290
|
if (!keep.every(Boolean)) kept = { ...r, text: chars.filter((_, i) => keep[i]).join(""), steps: r.steps.filter((_, i) => keep[i]) };
|
|
1182
1291
|
}
|
|
@@ -1287,13 +1396,13 @@ async function tryImport(name, loader) {
|
|
|
1287
1396
|
return await loader();
|
|
1288
1397
|
} catch (e) {
|
|
1289
1398
|
throw new Error(
|
|
1290
|
-
`\uB0B4\uC7A5 OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${
|
|
1399
|
+
`\uB0B4\uC7A5 OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkHVILFVATcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
1291
1400
|
);
|
|
1292
1401
|
}
|
|
1293
1402
|
}
|
|
1294
1403
|
async function verifiedBytes(s) {
|
|
1295
1404
|
const name = _path.basename.call(void 0, s.file.path);
|
|
1296
|
-
const fail = (why2) => new (0,
|
|
1405
|
+
const fail = (why2) => new (0, _chunkHVILFVATcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
|
|
1297
1406
|
const why = (e) => {
|
|
1298
1407
|
const code = e.code;
|
|
1299
1408
|
return code === "ENOENT" ? "\uD30C\uC77C\uC774 \uC5C6\uC74C" : code === "EACCES" || code === "EPERM" ? "\uAD8C\uD55C \uC5C6\uC74C" : "\uC77D\uAE30 \uC2E4\uD328";
|
|
@@ -1314,13 +1423,13 @@ async function verifiedBytes(s) {
|
|
|
1314
1423
|
}
|
|
1315
1424
|
const actual = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex");
|
|
1316
1425
|
if (actual !== s.file.sha256) {
|
|
1317
|
-
throw new (0,
|
|
1426
|
+
throw new (0, _chunkHVILFVATcjs.KordocError)(`OCR \uBAA8\uB378 SHA256 mismatch: ${_path.basename.call(void 0, s.file.path)} \u2014 expected ${s.file.sha256}, got ${actual} (\uB85C\uB4DC \uAC70\uBD80)`);
|
|
1318
1427
|
}
|
|
1319
1428
|
return bytes;
|
|
1320
1429
|
}
|
|
1321
1430
|
var engines = /* @__PURE__ */ new Map();
|
|
1322
|
-
function getOcrEngine(models =
|
|
1323
|
-
const key =
|
|
1431
|
+
function getOcrEngine(models = _chunkGV7ECKOKcjs.DEFAULT_OCR_MODELS) {
|
|
1432
|
+
const key = _chunkGV7ECKOKcjs.ocrSelectionKey.call(void 0, models);
|
|
1324
1433
|
let p = engines.get(key);
|
|
1325
1434
|
if (!p) {
|
|
1326
1435
|
p = OcrEngine.create(models).catch((err) => {
|
|
@@ -1423,13 +1532,13 @@ function rotateRgba(rgba, width, height, deg) {
|
|
|
1423
1532
|
var OCR_RENDER_SCALE = 3;
|
|
1424
1533
|
var MAX_OCR_PIXELS = 24e6;
|
|
1425
1534
|
var PAGE_TIMEOUT_MS = 12e4;
|
|
1426
|
-
var DEFAULT_BUILTIN_OCR = Object.freeze({ models:
|
|
1535
|
+
var DEFAULT_BUILTIN_OCR = Object.freeze({ models: _chunkGV7ECKOKcjs.DEFAULT_OCR_MODELS, tuning: DEFAULT_OCR_TUNING });
|
|
1427
1536
|
function builtinOcrConfig(o) {
|
|
1428
1537
|
if (!o || o.ocrDet === void 0 && o.ocrDetLongSide === void 0 && o.ocrRec === void 0 && o.ocrRecDict === void 0 && !o.ocrLines) return DEFAULT_BUILTIN_OCR;
|
|
1429
|
-
const bad =
|
|
1430
|
-
if (bad) throw new (0,
|
|
1538
|
+
const bad = _chunkZBHS7KLWcjs.validateOcrOptions.call(void 0, o);
|
|
1539
|
+
if (bad) throw new (0, _chunkHVILFVATcjs.KordocError)(bad);
|
|
1431
1540
|
return {
|
|
1432
|
-
models:
|
|
1541
|
+
models: _chunkGV7ECKOKcjs.resolveOcrModels.call(void 0, o),
|
|
1433
1542
|
tuning: o.ocrDetLongSide === void 0 ? DEFAULT_OCR_TUNING : { ...DEFAULT_OCR_TUNING, detLongSide: o.ocrDetLongSide },
|
|
1434
1543
|
lines: o.ocrLines === "all" ? "all" : o.ocrLines ? "kept" : void 0
|
|
1435
1544
|
};
|
|
@@ -1463,7 +1572,7 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
1463
1572
|
"@hyzyla/pdfium",
|
|
1464
1573
|
() => Promise.resolve().then(() => _interopRequireWildcard(require("@hyzyla/pdfium")))
|
|
1465
1574
|
);
|
|
1466
|
-
if (mode === "builtin") await
|
|
1575
|
+
if (mode === "builtin") await _chunkGV7ECKOKcjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
|
|
1467
1576
|
const engine = mode === "builtin" ? await getOcrEngine(config.models) : null;
|
|
1468
1577
|
const pdfium = await pdfiumMod.PDFiumLibrary.init();
|
|
1469
1578
|
const doc = await pdfium.loadDocument(new Uint8Array(buffer));
|
|
@@ -1472,15 +1581,15 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
1472
1581
|
const count = doc.getPageCount();
|
|
1473
1582
|
for (const pageNo of [...targets].filter((p) => p >= 1 && p <= count).sort((a, b) => a - b)) {
|
|
1474
1583
|
const page = doc.getPage(pageNo - 1);
|
|
1475
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
1584
|
+
_optionalChain([onProgress, 'optionalCall', _28 => _28(++done, targets.size)]);
|
|
1476
1585
|
try {
|
|
1477
1586
|
const { blocks, lines } = await withTimeout(
|
|
1478
|
-
ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, _optionalChain([vectorOps, 'optionalAccess',
|
|
1587
|
+
ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, _optionalChain([vectorOps, 'optionalAccess', _29 => _29.get, 'call', _30 => _30(pageNo)]), _optionalChain([imageRegions, 'optionalAccess', _31 => _31.get, 'call', _32 => _32(pageNo)]), config),
|
|
1479
1588
|
PAGE_TIMEOUT_MS,
|
|
1480
1589
|
`OCR \uD398\uC774\uC9C0 ${pageNo} \uD0C0\uC784\uC544\uC6C3 (${PAGE_TIMEOUT_MS / 1e3}\uCD08)`
|
|
1481
1590
|
);
|
|
1482
1591
|
result.set(pageNo, blocks);
|
|
1483
|
-
if (lines) _optionalChain([linesOut, 'optionalAccess',
|
|
1592
|
+
if (lines) _optionalChain([linesOut, 'optionalAccess', _33 => _33.set, 'call', _34 => _34(pageNo, lines)]);
|
|
1484
1593
|
} catch (e) {
|
|
1485
1594
|
warnings.push({
|
|
1486
1595
|
page: pageNo,
|
|
@@ -1545,7 +1654,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
1545
1654
|
const regionBlocks = regions.flatMap((r, k) => {
|
|
1546
1655
|
let own = items.filter((it) => inside(it, r));
|
|
1547
1656
|
const near = reads[k];
|
|
1548
|
-
if (_optionalChain([near, 'optionalAccess',
|
|
1657
|
+
if (_optionalChain([near, 'optionalAccess', _35 => _35.length]) && meanConfidence(near) > meanConfidence(own)) {
|
|
1549
1658
|
own = near;
|
|
1550
1659
|
reread.add(k);
|
|
1551
1660
|
}
|
|
@@ -1553,9 +1662,9 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
1553
1662
|
for (const it of own) used.add(it);
|
|
1554
1663
|
const blocks = ocrItemsToBlocks(own, pageNo, pdfW, pdfH, scale, ruling && rulingToPdfLines(ruling, scale, pdfH), detectTables, void 0, true);
|
|
1555
1664
|
const x1 = r.x1 * scale - 2, x2 = r.x2 * scale + 2, y1 = (pdfH - r.y2) * scale - 2, y2 = (pdfH - r.y1) * scale + 2;
|
|
1556
|
-
const columnRules = _nullishCoalesce(_optionalChain([ruling, 'optionalAccess',
|
|
1665
|
+
const columnRules = _nullishCoalesce(_optionalChain([ruling, 'optionalAccess', _36 => _36.verticals, 'access', _37 => _37.filter, 'call', _38 => _38((s) => Math.min(s.x1, s.x2) >= x1 && Math.max(s.x1, s.x2) <= x2 && Math.min(s.y1, s.y2) >= y1 && Math.max(s.y1, s.y2) <= y2), 'access', _39 => _39.length]), () => ( 0));
|
|
1557
1666
|
if (columnRules < 2) {
|
|
1558
|
-
for (const b of blocks) if (b.type === "table")
|
|
1667
|
+
for (const b of blocks) if (b.type === "table") _chunkGV7ECKOKcjs.UNRULED_REGION_TABLES.add(b);
|
|
1559
1668
|
}
|
|
1560
1669
|
return blocks;
|
|
1561
1670
|
});
|
|
@@ -1614,7 +1723,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
1614
1723
|
const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
|
|
1615
1724
|
out.push(items.map((it) => {
|
|
1616
1725
|
const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
|
|
1617
|
-
|
|
1726
|
+
_chunkGV7ECKOKcjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
|
|
1618
1727
|
return placed;
|
|
1619
1728
|
}));
|
|
1620
1729
|
}
|
|
@@ -1622,7 +1731,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
1622
1731
|
}
|
|
1623
1732
|
var proseBox = (b) => {
|
|
1624
1733
|
const t = b.text.replace(/\s/g, "");
|
|
1625
|
-
return b.w >= b.h * 7 && (_nullishCoalesce(_optionalChain([t, 'access',
|
|
1734
|
+
return b.w >= b.h * 7 && (_nullishCoalesce(_optionalChain([t, 'access', _40 => _40.match, 'call', _41 => _41(/\d/g), 'optionalAccess', _42 => _42.length]), () => ( 0))) < t.length * 0.3;
|
|
1626
1735
|
};
|
|
1627
1736
|
function groupOcrLines(items, figureRegion = false) {
|
|
1628
1737
|
const order = items.map((_, i) => i).sort((a, b) => items[a].y + items[a].h / 2 - (items[b].y + items[b].h / 2));
|
|
@@ -1694,17 +1803,17 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
1694
1803
|
isHidden: false,
|
|
1695
1804
|
...xs[i].space ? { hasSpaceBefore: true } : {}
|
|
1696
1805
|
};
|
|
1697
|
-
|
|
1806
|
+
_chunkGV7ECKOKcjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
|
|
1698
1807
|
return normalized;
|
|
1699
1808
|
});
|
|
1700
|
-
return
|
|
1809
|
+
return _chunkGV7ECKOKcjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables);
|
|
1701
1810
|
}
|
|
1702
1811
|
async function tryImport2(name, loader) {
|
|
1703
1812
|
try {
|
|
1704
1813
|
return await loader();
|
|
1705
1814
|
} catch (e) {
|
|
1706
1815
|
throw new Error(
|
|
1707
|
-
`OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${
|
|
1816
|
+
`OCR \uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 optional dependency '${name}' \uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \`npm install ${name}\` \uD6C4 \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.${_chunkHVILFVATcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
1708
1817
|
);
|
|
1709
1818
|
}
|
|
1710
1819
|
}
|
|
@@ -1752,4 +1861,4 @@ function bgraToRgba(bgra) {
|
|
|
1752
1861
|
|
|
1753
1862
|
|
|
1754
1863
|
exports.getOcrEngine = getOcrEngine; exports.detectRulingLines = detectRulingLines; exports.rulingToPdfLines = rulingToPdfLines; exports.deskewPage = deskewPage; exports.MAX_OCR_PIXELS = MAX_OCR_PIXELS; exports.DEFAULT_BUILTIN_OCR = DEFAULT_BUILTIN_OCR; exports.builtinOcrConfig = builtinOcrConfig; exports.reportModelDownload = reportModelDownload; exports.toOcrLine = toOcrLine; exports.pageLines = pageLines; exports.cellEdgeVerticals = cellEdgeVerticals; exports.cellEdgeHorizontals = cellEdgeHorizontals; exports.runPdfOcr = runPdfOcr; exports.ocrOnePage = ocrOnePage; exports.groupOcrLines = groupOcrLines; exports.ocrItemsToBlocks = ocrItemsToBlocks;
|
|
1755
|
-
//# sourceMappingURL=chunk-
|
|
1864
|
+
//# sourceMappingURL=chunk-ZX66BXB5.cjs.map
|