kordoc 4.24.75 → 4.24.76
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 +2 -2
- package/dist/{-IA5KLKYE.js → -2LCJEMU4.js} +22 -22
- package/dist/{chunk-7JMND4DW.cjs → chunk-2P3SFHOF.cjs} +88 -88
- package/dist/{chunk-7JMND4DW.cjs.map → chunk-2P3SFHOF.cjs.map} +1 -1
- package/dist/{chunk-UXWF3PM7.js → chunk-2P5GYSEI.js} +2 -2
- package/dist/{chunk-RYYDGS4R.js → chunk-2ZQUSUDC.js} +5 -5
- package/dist/{chunk-UNIYOWUQ.js → chunk-3X3ETOLW.js} +7 -7
- package/dist/{chunk-XNHDKTTV.cjs → chunk-43VUUMKV.cjs} +6 -6
- package/dist/{chunk-XNHDKTTV.cjs.map → chunk-43VUUMKV.cjs.map} +1 -1
- package/dist/{chunk-BX6TAXOM.js → chunk-45AT4XJD.js} +2 -2
- package/dist/{chunk-JQ6N26LA.js → chunk-4L3SF7EF.js} +2 -2
- package/dist/{chunk-RJBQXQAM.js → chunk-4RB5OPUZ.js} +2 -2
- package/dist/{chunk-HY3LV5HN.cjs → chunk-A7QRUXCJ.cjs} +3 -3
- package/dist/{chunk-HY3LV5HN.cjs.map → chunk-A7QRUXCJ.cjs.map} +1 -1
- package/dist/{chunk-V5XT2PRB.js → chunk-BUZLNJXB.js} +2 -2
- package/dist/{chunk-SODVNDR5.js → chunk-CWEB4XAH.js} +5 -5
- package/dist/{chunk-6F54BTUN.cjs → chunk-DIUYXWT2.cjs} +3 -3
- package/dist/{chunk-6F54BTUN.cjs.map → chunk-DIUYXWT2.cjs.map} +1 -1
- package/dist/{chunk-SEO3FQLR.cjs → chunk-DKRKNL2X.cjs} +58 -58
- package/dist/{chunk-SEO3FQLR.cjs.map → chunk-DKRKNL2X.cjs.map} +1 -1
- package/dist/{chunk-M33WZZPM.js → chunk-DTKVCSRC.js} +2 -2
- package/dist/{chunk-IITWVZF5.js → chunk-E2RQPNXX.js} +2 -2
- package/dist/{chunk-QQTMRZUG.cjs → chunk-HHRQX733.cjs} +203 -162
- package/dist/chunk-HHRQX733.cjs.map +1 -0
- package/dist/{chunk-RGSVM7RL.js → chunk-HQXVNLH2.js} +6 -6
- package/dist/{chunk-7USEKDFP.js → chunk-IRCO55NY.js} +2 -2
- package/dist/{chunk-TSACZSXD.js → chunk-J6RLB6KE.js} +2 -2
- package/dist/{chunk-WQQVAAPX.js → chunk-JT54JHR3.js} +2 -2
- package/dist/{chunk-GBOVNTH6.js → chunk-JYNG27VR.js} +54 -13
- package/dist/chunk-JYNG27VR.js.map +1 -0
- package/dist/{chunk-H7OEE7UV.js → chunk-LFXIZHPE.js} +16 -16
- package/dist/{chunk-N564V2TH.js → chunk-MHDVZBUV.js} +2 -2
- package/dist/{chunk-XV6A6WHZ.js → chunk-MQ44UJN6.js} +55 -14
- package/dist/chunk-MQ44UJN6.js.map +1 -0
- package/dist/{chunk-NNTUIJLC.js → chunk-MRHLGVK5.js} +2 -2
- package/dist/{chunk-SOW4ES4Y.js → chunk-ODJRLTXE.js} +2 -2
- package/dist/{chunk-DZPF2PWU.js → chunk-ODQJEBCB.js} +2 -2
- package/dist/{chunk-XJID65VS.js → chunk-PATC34WZ.js} +10 -10
- package/dist/{chunk-2RTRPVUB.js → chunk-PE3XRCTM.js} +4 -4
- package/dist/{chunk-XJNRTANY.js → chunk-PJ32UFPA.js} +2 -2
- package/dist/{chunk-QKOORIR2.cjs → chunk-QCH63KBP.cjs} +104 -104
- package/dist/{chunk-QKOORIR2.cjs.map → chunk-QCH63KBP.cjs.map} +1 -1
- package/dist/{chunk-SDQZSUFR.js → chunk-QDETIVPA.js} +6 -6
- package/dist/{chunk-NI3YCMGC.cjs → chunk-QIVOVMEC.cjs} +2 -2
- package/dist/{chunk-NI3YCMGC.cjs.map → chunk-QIVOVMEC.cjs.map} +1 -1
- package/dist/{chunk-YIW4AEC6.js → chunk-RNBBMRKF.js} +2 -2
- package/dist/{chunk-CXQXLQVT.js → chunk-RZXJFM3A.js} +2 -2
- package/dist/{chunk-ZOXPQZ4D.js → chunk-SABDVSQU.js} +11 -11
- package/dist/{chunk-S3RWTPEO.js → chunk-SQ7BI34M.js} +3 -3
- package/dist/{chunk-BIHQG2N7.js → chunk-T7YHAP4A.js} +3 -3
- package/dist/{chunk-SJG57YQQ.js → chunk-TGM5V7UD.js} +2 -2
- package/dist/{chunk-OQAE5NDF.js → chunk-U7EJ6QY7.js} +3 -3
- package/dist/{chunk-FZMAFLAY.js → chunk-V3MVGLWO.js} +5 -5
- package/dist/{chunk-CJYGYR2V.js → chunk-WTKISVEW.js} +2 -2
- package/dist/{chunk-MG2DFKP7.js → chunk-XIUXBJHE.js} +2 -2
- package/dist/{chunk-TOBOXNSE.cjs → chunk-XM4VBVYH.cjs} +8 -8
- package/dist/{chunk-TOBOXNSE.cjs.map → chunk-XM4VBVYH.cjs.map} +1 -1
- package/dist/{chunk-IPR3I6YO.js → chunk-XOC5PVAC.js} +2 -2
- package/dist/{chunk-FV57PXPQ.js → chunk-ZWA3MWAE.js} +3 -3
- package/dist/chunks-INR44FWQ.js +11 -0
- package/dist/cli.js +46 -46
- package/dist/{formula-XSFAUBCL.js → formula-3RUSZL2X.js} +4 -4
- package/dist/{formula-VPH2VTGN.cjs → formula-PNWIA2MN.cjs} +9 -9
- package/dist/{formula-VPH2VTGN.cjs.map → formula-PNWIA2MN.cjs.map} +1 -1
- package/dist/{formula-PMHBDDCI.js → formula-UJKRUT4H.js} +3 -3
- package/dist/generator-335G75L5.js +11 -0
- package/dist/generator-3S2MTXHO.cjs +12 -0
- package/dist/{generator-GFSOVACB.cjs.map → generator-3S2MTXHO.cjs.map} +1 -1
- package/dist/generator-R2CZZ2KU.js +18 -0
- package/dist/{hancom-UZAYAZLU.cjs → hancom-35Z4YAJB.cjs} +5 -5
- package/dist/{hancom-UZAYAZLU.cjs.map → hancom-35Z4YAJB.cjs.map} +1 -1
- package/dist/{hancom-Q2VC3YBY.js → hancom-4LFQU2RS.js} +2 -2
- package/dist/{hancom-MOQ5X7BT.js → hancom-VLS77NRS.js} +2 -2
- package/dist/{image-ocr-4RGMDWKZ.cjs → image-ocr-AGEB22EF.cjs} +36 -36
- package/dist/{image-ocr-4RGMDWKZ.cjs.map → image-ocr-AGEB22EF.cjs.map} +1 -1
- package/dist/{image-ocr-2Q2ZJYAJ.js → image-ocr-B7RRK43I.js} +8 -8
- package/dist/{image-ocr-KVV5JKY6.js → image-ocr-CCLUXSWY.js} +11 -11
- package/dist/index.cjs +1113 -1113
- package/dist/index.js +10 -10
- package/dist/mcp.js +37 -37
- package/dist/memo-SPNLGMIZ.js +17 -0
- package/dist/{model-bundle-SKRKICE4.js → model-bundle-KFPWVEFB.js} +5 -5
- package/dist/{models-QRQ4SU52.js → models-IOX5WK67.js} +5 -5
- package/dist/{parse-worker-v2-4BSQYNJ4.js → parse-worker-v2-IL6U65X3.js} +23 -23
- package/dist/{parser-B6YSYZTH.js → parser-ANWES7Z3.js} +12 -12
- package/dist/{parser-LVDXYJ2F.js → parser-ATU5CQZY.js} +9 -9
- package/dist/{parser-N5CJ252P.cjs → parser-NCSJG5KJ.cjs} +164 -164
- package/dist/{parser-N5CJ252P.cjs.map → parser-NCSJG5KJ.cjs.map} +1 -1
- package/dist/{pdf-ocr-5X2ZFG5O.js → pdf-ocr-7IH7FGKQ.js} +9 -9
- package/dist/pdf-ocr-F3ABLLXD.cjs +43 -0
- package/dist/{pdf-ocr-ZEP6O2UV.cjs.map → pdf-ocr-F3ABLLXD.cjs.map} +1 -1
- package/dist/{pdf-ocr-BJFC7NL3.js → pdf-ocr-ZUGHKM32.js} +6 -6
- package/dist/{profile-io-C55VLUZW.js → profile-io-BGUQJDGK.js} +3 -3
- package/dist/{rasterize-LCD3Q43I.js → rasterize-JOAG2QCQ.js} +3 -3
- package/dist/{redact-doc-BKNJOYE3.js → redact-doc-WL2GWBMN.js} +22 -22
- package/dist/{render-TWO5VQNJ.js → render-672D354C.js} +12 -12
- package/dist/{rewrite-fallback-AH3RNFIL.js → rewrite-fallback-2JAAIU6G.js} +13 -13
- package/dist/seal-XLDIGIIE.js +16 -0
- package/dist/{setup-VPGX6IJS.js → setup-L4PVFG65.js} +3 -3
- package/dist/{to-hwpx-JUWORW4M.js → to-hwpx-FR6GDNMY.js} +7 -7
- package/dist/{to-hwpx-TZFO5KL2.js → to-hwpx-OHZK2KBP.js} +4 -4
- package/dist/to-hwpx-VBVI5H4N.cjs +16 -0
- package/dist/{to-hwpx-LJQWVGOZ.cjs.map → to-hwpx-VBVI5H4N.cjs.map} +1 -1
- package/dist/visual-IXMRTYJK.js +40 -0
- package/dist/{watch-3J3O5GZN.js → watch-OH4BMY2N.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-GBOVNTH6.js.map +0 -1
- package/dist/chunk-QQTMRZUG.cjs.map +0 -1
- package/dist/chunk-XV6A6WHZ.js.map +0 -1
- package/dist/chunks-SC2MGE4B.js +0 -11
- package/dist/generator-4P5RXII7.js +0 -18
- package/dist/generator-GFSOVACB.cjs +0 -12
- package/dist/generator-NABTD6TU.js +0 -11
- package/dist/memo-K65K6E5J.js +0 -17
- package/dist/pdf-ocr-ZEP6O2UV.cjs +0 -43
- package/dist/seal-OCTCBT5O.js +0 -16
- package/dist/to-hwpx-LJQWVGOZ.cjs +0 -16
- package/dist/visual-SDJQ6EGR.js +0 -40
- /package/dist/{-IA5KLKYE.js.map → -2LCJEMU4.js.map} +0 -0
- /package/dist/{chunk-UXWF3PM7.js.map → chunk-2P5GYSEI.js.map} +0 -0
- /package/dist/{chunk-RYYDGS4R.js.map → chunk-2ZQUSUDC.js.map} +0 -0
- /package/dist/{chunk-UNIYOWUQ.js.map → chunk-3X3ETOLW.js.map} +0 -0
- /package/dist/{chunk-BX6TAXOM.js.map → chunk-45AT4XJD.js.map} +0 -0
- /package/dist/{chunk-JQ6N26LA.js.map → chunk-4L3SF7EF.js.map} +0 -0
- /package/dist/{chunk-RJBQXQAM.js.map → chunk-4RB5OPUZ.js.map} +0 -0
- /package/dist/{chunk-V5XT2PRB.js.map → chunk-BUZLNJXB.js.map} +0 -0
- /package/dist/{chunk-SODVNDR5.js.map → chunk-CWEB4XAH.js.map} +0 -0
- /package/dist/{chunk-M33WZZPM.js.map → chunk-DTKVCSRC.js.map} +0 -0
- /package/dist/{chunk-IITWVZF5.js.map → chunk-E2RQPNXX.js.map} +0 -0
- /package/dist/{chunk-RGSVM7RL.js.map → chunk-HQXVNLH2.js.map} +0 -0
- /package/dist/{chunk-7USEKDFP.js.map → chunk-IRCO55NY.js.map} +0 -0
- /package/dist/{chunk-TSACZSXD.js.map → chunk-J6RLB6KE.js.map} +0 -0
- /package/dist/{chunk-WQQVAAPX.js.map → chunk-JT54JHR3.js.map} +0 -0
- /package/dist/{chunk-H7OEE7UV.js.map → chunk-LFXIZHPE.js.map} +0 -0
- /package/dist/{chunk-N564V2TH.js.map → chunk-MHDVZBUV.js.map} +0 -0
- /package/dist/{chunk-NNTUIJLC.js.map → chunk-MRHLGVK5.js.map} +0 -0
- /package/dist/{chunk-SOW4ES4Y.js.map → chunk-ODJRLTXE.js.map} +0 -0
- /package/dist/{chunk-DZPF2PWU.js.map → chunk-ODQJEBCB.js.map} +0 -0
- /package/dist/{chunk-XJID65VS.js.map → chunk-PATC34WZ.js.map} +0 -0
- /package/dist/{chunk-2RTRPVUB.js.map → chunk-PE3XRCTM.js.map} +0 -0
- /package/dist/{chunk-XJNRTANY.js.map → chunk-PJ32UFPA.js.map} +0 -0
- /package/dist/{chunk-SDQZSUFR.js.map → chunk-QDETIVPA.js.map} +0 -0
- /package/dist/{chunk-YIW4AEC6.js.map → chunk-RNBBMRKF.js.map} +0 -0
- /package/dist/{chunk-CXQXLQVT.js.map → chunk-RZXJFM3A.js.map} +0 -0
- /package/dist/{chunk-ZOXPQZ4D.js.map → chunk-SABDVSQU.js.map} +0 -0
- /package/dist/{chunk-S3RWTPEO.js.map → chunk-SQ7BI34M.js.map} +0 -0
- /package/dist/{chunk-BIHQG2N7.js.map → chunk-T7YHAP4A.js.map} +0 -0
- /package/dist/{chunk-SJG57YQQ.js.map → chunk-TGM5V7UD.js.map} +0 -0
- /package/dist/{chunk-OQAE5NDF.js.map → chunk-U7EJ6QY7.js.map} +0 -0
- /package/dist/{chunk-FZMAFLAY.js.map → chunk-V3MVGLWO.js.map} +0 -0
- /package/dist/{chunk-CJYGYR2V.js.map → chunk-WTKISVEW.js.map} +0 -0
- /package/dist/{chunk-MG2DFKP7.js.map → chunk-XIUXBJHE.js.map} +0 -0
- /package/dist/{chunk-IPR3I6YO.js.map → chunk-XOC5PVAC.js.map} +0 -0
- /package/dist/{chunk-FV57PXPQ.js.map → chunk-ZWA3MWAE.js.map} +0 -0
- /package/dist/{chunks-SC2MGE4B.js.map → chunks-INR44FWQ.js.map} +0 -0
- /package/dist/{formula-XSFAUBCL.js.map → formula-3RUSZL2X.js.map} +0 -0
- /package/dist/{formula-PMHBDDCI.js.map → formula-UJKRUT4H.js.map} +0 -0
- /package/dist/{generator-4P5RXII7.js.map → generator-335G75L5.js.map} +0 -0
- /package/dist/{generator-NABTD6TU.js.map → generator-R2CZZ2KU.js.map} +0 -0
- /package/dist/{hancom-Q2VC3YBY.js.map → hancom-4LFQU2RS.js.map} +0 -0
- /package/dist/{hancom-MOQ5X7BT.js.map → hancom-VLS77NRS.js.map} +0 -0
- /package/dist/{image-ocr-2Q2ZJYAJ.js.map → image-ocr-B7RRK43I.js.map} +0 -0
- /package/dist/{image-ocr-KVV5JKY6.js.map → image-ocr-CCLUXSWY.js.map} +0 -0
- /package/dist/{memo-K65K6E5J.js.map → memo-SPNLGMIZ.js.map} +0 -0
- /package/dist/{model-bundle-SKRKICE4.js.map → model-bundle-KFPWVEFB.js.map} +0 -0
- /package/dist/{models-QRQ4SU52.js.map → models-IOX5WK67.js.map} +0 -0
- /package/dist/{parse-worker-v2-4BSQYNJ4.js.map → parse-worker-v2-IL6U65X3.js.map} +0 -0
- /package/dist/{parser-B6YSYZTH.js.map → parser-ANWES7Z3.js.map} +0 -0
- /package/dist/{parser-LVDXYJ2F.js.map → parser-ATU5CQZY.js.map} +0 -0
- /package/dist/{pdf-ocr-5X2ZFG5O.js.map → pdf-ocr-7IH7FGKQ.js.map} +0 -0
- /package/dist/{pdf-ocr-BJFC7NL3.js.map → pdf-ocr-ZUGHKM32.js.map} +0 -0
- /package/dist/{profile-io-C55VLUZW.js.map → profile-io-BGUQJDGK.js.map} +0 -0
- /package/dist/{rasterize-LCD3Q43I.js.map → rasterize-JOAG2QCQ.js.map} +0 -0
- /package/dist/{redact-doc-BKNJOYE3.js.map → redact-doc-WL2GWBMN.js.map} +0 -0
- /package/dist/{render-TWO5VQNJ.js.map → render-672D354C.js.map} +0 -0
- /package/dist/{rewrite-fallback-AH3RNFIL.js.map → rewrite-fallback-2JAAIU6G.js.map} +0 -0
- /package/dist/{seal-OCTCBT5O.js.map → seal-XLDIGIIE.js.map} +0 -0
- /package/dist/{setup-VPGX6IJS.js.map → setup-L4PVFG65.js.map} +0 -0
- /package/dist/{to-hwpx-JUWORW4M.js.map → to-hwpx-FR6GDNMY.js.map} +0 -0
- /package/dist/{to-hwpx-TZFO5KL2.js.map → to-hwpx-OHZK2KBP.js.map} +0 -0
- /package/dist/{visual-SDJQ6EGR.js.map → visual-IXMRTYJK.js.map} +0 -0
- /package/dist/{watch-3J3O5GZN.js.map → watch-OH4BMY2N.js.map} +0 -0
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkHHRQX733cjs = require('./chunk-HHRQX733.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var _chunkMMK32GPDcjs = require('./chunk-MMK32GPD.cjs');
|
|
@@ -50,7 +50,7 @@ var _chunk64H2FCYFcjs = require('./chunk-64H2FCYF.cjs');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkQIVOVMECcjs = require('./chunk-QIVOVMEC.cjs');
|
|
54
54
|
|
|
55
55
|
// src/ocr/ocr-stacked-rows.ts
|
|
56
56
|
var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p원]?$|^[-–—·∼~]원?$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
|
|
@@ -849,8 +849,8 @@ var INKLESS_DELTA = 32;
|
|
|
849
849
|
function ringAsks(rgba, pageW, box, text, steps, stepPx) {
|
|
850
850
|
const chars = [...text];
|
|
851
851
|
if (chars.length !== steps.length || !/[가-힣]/.test(text)) return [];
|
|
852
|
-
const gray =
|
|
853
|
-
const rings =
|
|
852
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
853
|
+
const rings = _chunkHHRQX733cjs.ringBoxes.call(void 0, gray, box.w, box.h, _chunkHHRQX733cjs.inkStats.call(void 0, gray));
|
|
854
854
|
const owner = ringOwners(chars, (i) => (steps[i] + 0.5) * stepPx, rings);
|
|
855
855
|
return rings.flatMap((r, k) => {
|
|
856
856
|
const at = owner.indexOf(k);
|
|
@@ -890,8 +890,8 @@ function ringGlyph(read, jamo = null, confidence = 1) {
|
|
|
890
890
|
function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}, rings = []) {
|
|
891
891
|
const chars = [...text];
|
|
892
892
|
if (chars.length !== steps.length) return text;
|
|
893
|
-
const gray =
|
|
894
|
-
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink:
|
|
893
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
894
|
+
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink: _chunkHHRQX733cjs.inkStats.call(void 0, gray) };
|
|
895
895
|
if (/[[\]]/.test(text)) brackets(c);
|
|
896
896
|
if (text.includes("'")) cornerQuotes(c);
|
|
897
897
|
if (/['"]/.test(text)) quotes(c);
|
|
@@ -921,7 +921,7 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}, rings =
|
|
|
921
921
|
function trimInklessEnds(rgba, pageW, box, text, steps, stepPx) {
|
|
922
922
|
const chars = [...text], { w, h } = box;
|
|
923
923
|
if (chars.length !== steps.length || steps.some((s) => (s + 0.5) * stepPx > w + stepPx)) return { text, steps };
|
|
924
|
-
const gray =
|
|
924
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
925
925
|
const hist = new Uint32Array(256);
|
|
926
926
|
for (const v of gray) hist[v]++;
|
|
927
927
|
let bg = 0;
|
|
@@ -952,8 +952,8 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
|
|
|
952
952
|
continue;
|
|
953
953
|
}
|
|
954
954
|
if (open > 0) {
|
|
955
|
-
const f =
|
|
956
|
-
if (f &&
|
|
955
|
+
const f = _chunkHHRQX733cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
956
|
+
if (f && _chunkHHRQX733cjs.bracketShape.call(void 0, f, true) === "\u300D") {
|
|
957
957
|
chars[i] = "\u300D";
|
|
958
958
|
open--;
|
|
959
959
|
}
|
|
@@ -963,12 +963,12 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
|
|
|
963
963
|
function cornerQuotes({ chars, cx, gray, w, h, ink }) {
|
|
964
964
|
for (let i = 0; i < chars.length; i++) {
|
|
965
965
|
if (chars[i] !== "'" || !/^[가-힣]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
966
|
-
const f =
|
|
967
|
-
if (!f || f.ch < f.charH * 0.45 ||
|
|
966
|
+
const f = _chunkHHRQX733cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
967
|
+
if (!f || f.ch < f.charH * 0.45 || _chunkHHRQX733cjs.bracketShape.call(void 0, f, false) !== "\u300C") continue;
|
|
968
968
|
const rest = chars.slice(i + 1), end = rest.findIndex((c) => c === "'" || c === "\u300D" || c === ",");
|
|
969
969
|
const pair = end >= 0 && rest[end] !== "'" && (rest[end] === "\u300D" || (() => {
|
|
970
|
-
const g =
|
|
971
|
-
return !!g &&
|
|
970
|
+
const g = _chunkHHRQX733cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
|
|
971
|
+
return !!g && _chunkHHRQX733cjs.bracketShape.call(void 0, g, true) === "\u300D";
|
|
972
972
|
})());
|
|
973
973
|
if (pair) chars[i] = "\u300C";
|
|
974
974
|
}
|
|
@@ -976,8 +976,8 @@ function cornerQuotes({ chars, cx, gray, w, h, ink }) {
|
|
|
976
976
|
function brackets({ chars, cx, gray, w, h, ink }) {
|
|
977
977
|
const shape = chars.map((c, i) => {
|
|
978
978
|
if (c !== "[" && c !== "]") return null;
|
|
979
|
-
const f =
|
|
980
|
-
return f &&
|
|
979
|
+
const f = _chunkHHRQX733cjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
980
|
+
return f && _chunkHHRQX733cjs.bracketShape.call(void 0, f, c === "]");
|
|
981
981
|
});
|
|
982
982
|
for (let i = 0; i < chars.length; i++) {
|
|
983
983
|
if (chars[i] !== "[") continue;
|
|
@@ -1009,7 +1009,7 @@ function quotes({ chars, cx, gray, w, h, ink }) {
|
|
|
1009
1009
|
continue;
|
|
1010
1010
|
}
|
|
1011
1011
|
if (!year(i) && !single[kind]) continue;
|
|
1012
|
-
const r =
|
|
1012
|
+
const r = _chunkHHRQX733cjs.quoteHead.call(void 0, gray, w, h, ink, cx(i));
|
|
1013
1013
|
if (r !== null && r >= 0.47) {
|
|
1014
1014
|
chars[i] = kind === "'" ? "\u2018" : "\u201C";
|
|
1015
1015
|
open[kind] = true;
|
|
@@ -1020,7 +1020,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
1020
1020
|
const head = chars.findIndex((c) => c.trim()), letters = chars.some((c) => /[가-힣A-Za-z]/.test(c));
|
|
1021
1021
|
for (let i = 0; i < chars.length; i++) {
|
|
1022
1022
|
if (!/^[-\u2013\u2014]$/.test(chars[i])) continue;
|
|
1023
|
-
const r =
|
|
1023
|
+
const r = _chunkHHRQX733cjs.dashRatio.call(void 0, gray, w, h, ink, cx(i));
|
|
1024
1024
|
if (r === null) continue;
|
|
1025
1025
|
if (r < 0.65) chars[i] = "-";
|
|
1026
1026
|
else if (r > 0.75 && i === head && letters) chars[i] = "\u2014";
|
|
@@ -1030,7 +1030,7 @@ function circled({ chars, cx, gray, w, h, ink }) {
|
|
|
1030
1030
|
const alone = (re, i) => re.test(chars[i]) && !re.test(_nullishCoalesce(chars[i - 1], () => ( ""))) && !re.test(_nullishCoalesce(chars[i + 1], () => ( "")));
|
|
1031
1031
|
const at = chars.flatMap((_, i) => alone(/^\d$/, i) && chars[i] !== "0" || alone(/^[ㄱ-ㅎ]$/, i) || alone(/^[A-Za-z]$/, i) && /[a-zCSUVWXZ]/.test(chars[i]) ? [i] : []);
|
|
1032
1032
|
if (!at.length) return;
|
|
1033
|
-
const hit =
|
|
1033
|
+
const hit = _chunkHHRQX733cjs.circledAt.call(void 0, gray, w, h, ink, at.map(cx));
|
|
1034
1034
|
const JAMO = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
|
|
1035
1035
|
at.forEach((i, k) => {
|
|
1036
1036
|
if (!hit[k]) return;
|
|
@@ -1043,16 +1043,16 @@ function stars({ chars, cx, gray, w, h, ink }) {
|
|
|
1043
1043
|
if (chars[i] !== "*" || chars[i - 1] === "*") continue;
|
|
1044
1044
|
let e = i;
|
|
1045
1045
|
while (chars[e + 1] === "*") e++;
|
|
1046
|
-
const n =
|
|
1046
|
+
const n = _chunkHHRQX733cjs.starRun.call(void 0, gray, w, h, ink, cx(i));
|
|
1047
1047
|
if (n > e - i + 1 && n <= 4) chars[e] += "*".repeat(n - (e - i + 1));
|
|
1048
1048
|
i = e;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
function discs({ chars, cx, gray, w, h, ink }) {
|
|
1052
|
-
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) &&
|
|
1052
|
+
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) && _chunkHHRQX733cjs.discAt.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u25CF";
|
|
1053
1053
|
}
|
|
1054
1054
|
function gaps({ chars, cx, gray, w, h, ink }) {
|
|
1055
|
-
const { glyphs, bandH } =
|
|
1055
|
+
const { glyphs, bandH } = _chunkHHRQX733cjs.gapGlyphs.call(void 0, gray, w, h, ink);
|
|
1056
1056
|
if (!glyphs.length) return;
|
|
1057
1057
|
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
1058
1058
|
if (!live.length) return;
|
|
@@ -1123,18 +1123,18 @@ function ring({ chars, cx, gray, w, h, ink }) {
|
|
|
1123
1123
|
const rest = chars.slice(k + 1).join("").trimStart();
|
|
1124
1124
|
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
1125
1125
|
if (live.length <= 3 && live.every((i) => /^[Oo]$/.test(chars[i]))) {
|
|
1126
|
-
if (_optionalChain([
|
|
1127
|
-
if (!live.every((i) =>
|
|
1126
|
+
if (_optionalChain([_chunkHHRQX733cjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _11 => _11.mark]) === "\u25CE") return false;
|
|
1127
|
+
if (!live.every((i) => _chunkHHRQX733cjs.ringBullet.call(void 0, gray, w, h, ink, cx(i)) === "\u25CB")) return false;
|
|
1128
1128
|
for (const i of live) chars[i] = "\u25CB";
|
|
1129
1129
|
return true;
|
|
1130
1130
|
}
|
|
1131
1131
|
if (/^[A-Z]{2,}/.test(rest) && /^[Oo0]$/.test(chars[k])) {
|
|
1132
|
-
if (
|
|
1132
|
+
if (_chunkHHRQX733cjs.ringBullet.call(void 0, gray, w, h, ink, cx(k)) !== "\u25CB") return false;
|
|
1133
1133
|
chars[k] = chars[k + 1] === " " ? "\u25CB" : "\u25CB ";
|
|
1134
1134
|
return true;
|
|
1135
1135
|
}
|
|
1136
1136
|
if (!/^[(\[「【<]?\d*[가-힣]/.test(rest)) return false;
|
|
1137
|
-
const r =
|
|
1137
|
+
const r = _chunkHHRQX733cjs.ringBullet.call(void 0, gray, w, h, ink, cx(k));
|
|
1138
1138
|
if (/^[Cc]$/.test(chars[k]) && r !== "\u25CB") return false;
|
|
1139
1139
|
if (r) chars[k] = r;
|
|
1140
1140
|
return r !== null;
|
|
@@ -1151,7 +1151,7 @@ function parallels({ chars, cx, gray, w, h, ink }) {
|
|
|
1151
1151
|
let p = s - 1, q = e + 1;
|
|
1152
1152
|
while (p >= 0 && !chars[p].trim()) p--;
|
|
1153
1153
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
1154
|
-
if (
|
|
1154
|
+
if (_chunkHHRQX733cjs.slantedPair.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity)) {
|
|
1155
1155
|
chars[s] = "\u2225";
|
|
1156
1156
|
for (let k = s + 1; k <= e; k++) chars[k] = "";
|
|
1157
1157
|
}
|
|
@@ -1163,7 +1163,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
1163
1163
|
const ROMAN = /^[IⅠ-Ⅲ]$/, LATIN = /[A-Za-z]$/;
|
|
1164
1164
|
for (let i = 0; i < chars.length; i++) {
|
|
1165
1165
|
if (chars[i] !== "1" || /[\dA-Za-z]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || /^[\dA-Za-z,]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
1166
|
-
if (
|
|
1166
|
+
if (_chunkHHRQX733cjs.serifOne.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u2160";
|
|
1167
1167
|
}
|
|
1168
1168
|
for (let i = 0; i < chars.length; i++) {
|
|
1169
1169
|
const hangul = /^[파피]$/.test(chars[i]);
|
|
@@ -1173,13 +1173,13 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
1173
1173
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
1174
1174
|
const glued = hangul ? chars[p] === "(" && chars[q] === "-" : /[가-힣]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || (_nullishCoalesce(chars[i + 1], () => ( ""))) === "." || chars[p] === "-" && chars[q] === "-";
|
|
1175
1175
|
if (!glued) continue;
|
|
1176
|
-
const n =
|
|
1176
|
+
const n = _chunkHHRQX733cjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
|
|
1177
1177
|
if (n) chars[i] = String.fromCharCode(8543 + n);
|
|
1178
1178
|
}
|
|
1179
1179
|
const inRoman = (i) => ROMAN.test(chars[i]) || chars[i] === "1" && (ROMAN.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || ROMAN.test(_nullishCoalesce(chars[i + 1], () => ( ""))));
|
|
1180
1180
|
const k = chars.findIndex((c) => c.trim());
|
|
1181
1181
|
if (chars[k] === "." && chars.slice(k + 1).some((c) => /[가-힣A-Za-z0-9]/.test(c))) {
|
|
1182
|
-
const n =
|
|
1182
|
+
const n = _chunkHHRQX733cjs.romanStems.call(void 0, gray, w, h, ink, -Infinity, cx(k));
|
|
1183
1183
|
if (n) chars[k] = String.fromCharCode(8543 + n) + chars[k];
|
|
1184
1184
|
}
|
|
1185
1185
|
for (let s = 0; s < chars.length; ) {
|
|
@@ -1197,7 +1197,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
1197
1197
|
let p = s - 1, q = e;
|
|
1198
1198
|
while (p >= 0 && !chars[p].trim()) p--;
|
|
1199
1199
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
1200
|
-
const n =
|
|
1200
|
+
const n = _chunkHHRQX733cjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
|
|
1201
1201
|
const canon = n ? [["\u2160", "I"], ["\u2161", "II"], ["\u2162", "III"]][n - 1] : null;
|
|
1202
1202
|
if (canon && !canon.includes(tok)) {
|
|
1203
1203
|
chars[s] = canon[0];
|
|
@@ -1626,8 +1626,8 @@ function joinGapLeaders(rgba, width, items) {
|
|
|
1626
1626
|
if (g1 - g0 < h * 3) continue;
|
|
1627
1627
|
const pad = Math.round(h * 0.25), y = Math.max(0, Math.min(left.y, num.y) - pad), x = Math.max(0, Math.round(g0 - h));
|
|
1628
1628
|
const box = { x, y, w: Math.min(width, Math.round(g1 + h)) - x, h: Math.min(Math.floor(rgba.length / 4 / width), Math.max(left.y + left.h, num.y + num.h) + pad) - y };
|
|
1629
|
-
const gray =
|
|
1630
|
-
const runs =
|
|
1629
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, box);
|
|
1630
|
+
const runs = _chunkHHRQX733cjs.leaderRuns.call(void 0, gray, box.w, box.h, _chunkHHRQX733cjs.inkStats.call(void 0, gray), LEADER_MIN_DOTS);
|
|
1631
1631
|
const cover = runs.reduce((k, [a, b]) => k + Math.max(0, Math.min(b, g1 - box.x) - Math.max(a, g0 - box.x)), 0);
|
|
1632
1632
|
if (cover < (g1 - g0) * 0.6) continue;
|
|
1633
1633
|
for (const o of items) if (junk(o) && sameLine(o, num) && o.x >= g0 - 2 && o.x + o.w <= g1 + 2) gone.add(o);
|
|
@@ -1910,7 +1910,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1910
1910
|
this.ort = parts.ort;
|
|
1911
1911
|
this.sharp = parts.sharp;
|
|
1912
1912
|
}
|
|
1913
|
-
static async create(models =
|
|
1913
|
+
static async create(models = _chunkHHRQX733cjs.DEFAULT_OCR_MODELS) {
|
|
1914
1914
|
_chunkTK3FDAEEcjs.disableOrtTelemetry.call(void 0, );
|
|
1915
1915
|
const [ortMod, sharpModRaw] = await Promise.all([
|
|
1916
1916
|
tryImport("onnxruntime-node", () => Promise.resolve().then(() => _interopRequireWildcard(require("onnxruntime-node")))),
|
|
@@ -1930,16 +1930,16 @@ var OcrEngine = class _OcrEngine {
|
|
|
1930
1930
|
const local = (s) => "spec" in s ? Promise.resolve(null) : verifiedBytes(s);
|
|
1931
1931
|
const [detBytes, recBytes, dictBytes] = await Promise.all([local(models.det), local(models.rec), local(models.dict)]);
|
|
1932
1932
|
const session = (s, bytes) => bytes ? ortMod.InferenceSession.create(bytes, sessionOpts).catch(() => {
|
|
1933
|
-
throw new (0,
|
|
1934
|
-
}) : ortMod.InferenceSession.create(
|
|
1933
|
+
throw new (0, _chunkQIVOVMECcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkHHRQX733cjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
|
|
1934
|
+
}) : ortMod.InferenceSession.create(_chunkHHRQX733cjs.ocrSourcePath.call(void 0, s), sessionOpts);
|
|
1935
1935
|
const [det, rec, dictYml] = await Promise.all([
|
|
1936
1936
|
session(models.det, detBytes),
|
|
1937
1937
|
session(models.rec, recBytes),
|
|
1938
|
-
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0,
|
|
1938
|
+
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0, _chunkHHRQX733cjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
|
|
1939
1939
|
]);
|
|
1940
|
-
const dict =
|
|
1940
|
+
const dict = _chunkHHRQX733cjs.parseCharacterDict.call(void 0, dictYml);
|
|
1941
1941
|
if (dict.length === 0) {
|
|
1942
|
-
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,
|
|
1942
|
+
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, _chunkQIVOVMECcjs.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`);
|
|
1943
1943
|
}
|
|
1944
1944
|
return new _OcrEngine({ det, rec, dict, ort: ortMod, sharp: sharpMod });
|
|
1945
1945
|
}
|
|
@@ -1971,10 +1971,10 @@ var OcrEngine = class _OcrEngine {
|
|
|
1971
1971
|
if (it.x - x < it.h * 0.8) return;
|
|
1972
1972
|
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;
|
|
1973
1973
|
const box = { x, y: it.y, w: it.x + it.w - x, h: it.h };
|
|
1974
|
-
const g =
|
|
1975
|
-
const b =
|
|
1974
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, box);
|
|
1975
|
+
const b = _chunkHHRQX733cjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g), it.x - x, 1.05);
|
|
1976
1976
|
if (_optionalChain([b, 'optionalAccess', _36 => _36.mark]) !== "\u25A1" || b.covers) return;
|
|
1977
|
-
const ink =
|
|
1977
|
+
const ink = _chunkHHRQX733cjs.inkStats.call(void 0, g), on = (v) => ink.darkInk ? v <= ink.threshold : v > ink.threshold;
|
|
1978
1978
|
let left = 0;
|
|
1979
1979
|
while (left < it.x - x && !Array.from({ length: box.h }, (_, y) => g[y * box.w + left]).some(on)) left++;
|
|
1980
1980
|
it.text = "\u25A1 " + it.text;
|
|
@@ -2006,12 +2006,12 @@ var OcrEngine = class _OcrEngine {
|
|
|
2006
2006
|
const joins = [];
|
|
2007
2007
|
let group = 0;
|
|
2008
2008
|
for (const b of boxes) {
|
|
2009
|
-
const gray =
|
|
2010
|
-
const ink =
|
|
2009
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, b);
|
|
2010
|
+
const ink = _chunkHHRQX733cjs.inkStats.call(void 0, gray);
|
|
2011
2011
|
if (tuning.minInkContrast > 0 && ink.contrast < tuning.minInkContrast) continue;
|
|
2012
2012
|
if (tuning.minInkContrast > 0 && ink.inkRatio < MIN_INK_RATIO) continue;
|
|
2013
2013
|
if (tuning.splitTall && b.h >= b.w * TALL_RATIO) {
|
|
2014
|
-
const bands =
|
|
2014
|
+
const bands = _chunkHHRQX733cjs.splitRowBands.call(void 0, gray, b.w, b.h, ink, 0.45);
|
|
2015
2015
|
if (bands.length >= 2) {
|
|
2016
2016
|
for (const sub of bandBoxes(b, bands, height)) jobs.push({ box: sub, rot: 0, group: group++ });
|
|
2017
2017
|
continue;
|
|
@@ -2035,9 +2035,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
2035
2035
|
continue;
|
|
2036
2036
|
}
|
|
2037
2037
|
}
|
|
2038
|
-
const trim = tuning.trimEdges ?
|
|
2038
|
+
const trim = tuning.trimEdges ? _chunkHHRQX733cjs.edgeTrim.call(void 0, gray, b.w, b.h, ink) : null;
|
|
2039
2039
|
const keep = trim ? { ...trim, bg: median(gray) } : void 0;
|
|
2040
|
-
const leaders = tuning.splitLeaders ?
|
|
2040
|
+
const leaders = tuning.splitLeaders ? _chunkHHRQX733cjs.leaderRuns.call(void 0, gray, b.w, b.h, ink, LEADER_MIN_DOTS) : [];
|
|
2041
2041
|
if (leaders.length) {
|
|
2042
2042
|
const join = joins.length;
|
|
2043
2043
|
joins.push({ box: b, parts: [], trailDots: false });
|
|
@@ -2046,7 +2046,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
2046
2046
|
const bare = { x: b.x + x0, y: b.y, w: a - x0, h: b.h };
|
|
2047
2047
|
const end = c > a ? Math.min(c, a + Math.round(b.h * LEADER_CONTEXT)) : a;
|
|
2048
2048
|
x0 = c;
|
|
2049
|
-
if (bare.w >= DET_MIN_SIZE &&
|
|
2049
|
+
if (bare.w >= DET_MIN_SIZE && _chunkHHRQX733cjs.inkStats.call(void 0, _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, bare)).contrast >= Math.max(1, tuning.minInkContrast)) {
|
|
2050
2050
|
jobs.push({ box: { ...bare, w: end - (bare.x - b.x) }, rot: 0, group: group++, join, dotsBefore: dots, trimDots: end > a });
|
|
2051
2051
|
dots = false;
|
|
2052
2052
|
}
|
|
@@ -2095,15 +2095,15 @@ var OcrEngine = class _OcrEngine {
|
|
|
2095
2095
|
let text = tuning.postprocess ? restoreSymbols(raw.trim(), note.ringLead) : raw;
|
|
2096
2096
|
if (!text.trim()) continue;
|
|
2097
2097
|
if (tuning.postprocess && job.rot === 0 && text !== "/" && /^[(:;/)]+$/.test(text) && text.includes("/")) {
|
|
2098
|
-
const g =
|
|
2099
|
-
if (
|
|
2098
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2099
|
+
if (_chunkHHRQX733cjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g)) === 1) text = "/";
|
|
2100
2100
|
}
|
|
2101
2101
|
let ringByShape = false;
|
|
2102
2102
|
if (tuning.postprocess && job.rot === 0 && !/^[◎●▪□■▣❐❏○ㅇ◆◇◈]/.test(text)) {
|
|
2103
2103
|
const chars = [...read], k = chars.findIndex((c) => c.trim());
|
|
2104
2104
|
if (k >= 0 && steps.length === chars.length) {
|
|
2105
|
-
const g =
|
|
2106
|
-
const b =
|
|
2105
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2106
|
+
const b = _chunkHHRQX733cjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx);
|
|
2107
2107
|
const body = (_nullishCoalesce(text.match(/[가-힣]/g), () => ( []))).length >= 4;
|
|
2108
2108
|
const miss = /^[Oo0•·ㆍ∙‧○]/.test(text);
|
|
2109
2109
|
if (_optionalChain([b, 'optionalAccess', _39 => _39.mark]) === "\u25CE" && b.covers && /^[Oo0○©]/.test(text)) {
|
|
@@ -2118,17 +2118,17 @@ var OcrEngine = class _OcrEngine {
|
|
|
2118
2118
|
} else if (_optionalChain([b, 'optionalAccess', _46 => _46.mark]) === "\u2750" || _optionalChain([b, 'optionalAccess', _47 => _47.mark]) === "\u274F") {
|
|
2119
2119
|
if (b.covers ? /^[ㅁ口]/.test(text) : body) text = b.covers ? b.mark + text.slice(1) : b.mark + " " + text;
|
|
2120
2120
|
} else if (b && b.mark !== "\u25CE" && body) text = b.covers ? miss ? b.mark + " " + text.slice(1).trimStart() : text : b.mark + " " + text;
|
|
2121
|
-
else if (!b && body && /^[가-힣]/.test(chars[k]) &&
|
|
2121
|
+
else if (!b && body && /^[가-힣]/.test(chars[k]) && _chunkHHRQX733cjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx)) text = "\u25CB " + text;
|
|
2122
2122
|
}
|
|
2123
2123
|
}
|
|
2124
2124
|
if (tuning.postprocess && /^\d/.test(text) && job.rot === 0) {
|
|
2125
|
-
const g =
|
|
2126
|
-
const tri =
|
|
2125
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2126
|
+
const tri = _chunkHHRQX733cjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g));
|
|
2127
2127
|
if (tri) text = tri + text;
|
|
2128
2128
|
}
|
|
2129
2129
|
if (tuning.postprocess && text === "\u2192" && job.rot === 0 && job.join === void 0) {
|
|
2130
|
-
const g =
|
|
2131
|
-
text = _nullishCoalesce(
|
|
2130
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2131
|
+
text = _nullishCoalesce(_chunkHHRQX733cjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g)), () => ( text));
|
|
2132
2132
|
}
|
|
2133
2133
|
if (job.footer) {
|
|
2134
2134
|
if (!/^[-\u2013\u2014]?\s*(?:\d{1,4}|[ivxIVXⅰ-ⅹⅠ-Ⅹ]{1,4})\s*[-\u2013\u2014]?$/.test(text.trim())) continue;
|
|
@@ -2152,7 +2152,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
2152
2152
|
continue;
|
|
2153
2153
|
}
|
|
2154
2154
|
const item = { text, ...this.itemBox(rgba, width, job.box, tuning), confidence };
|
|
2155
|
-
if (job.rot === 0)
|
|
2155
|
+
if (job.rot === 0) _chunkHHRQX733cjs.rememberOcrTextGaps.call(void 0, item, _chunkHHRQX733cjs.findOcrTextGaps.call(void 0, rgba, width, job.box, read, text, steps, stepPx));
|
|
2156
2156
|
if (job.rot === 0 && job.keep === void 0) boxOf.set(item, job.box);
|
|
2157
2157
|
items.push(item);
|
|
2158
2158
|
}
|
|
@@ -2166,7 +2166,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
2166
2166
|
const merged = rereadNumberText(it.text, r.text);
|
|
2167
2167
|
if (merged === null) return;
|
|
2168
2168
|
it.text = merged;
|
|
2169
|
-
|
|
2169
|
+
_chunkHHRQX733cjs.rememberOcrTextGaps.call(void 0, it, _chunkHHRQX733cjs.findOcrTextGaps.call(void 0, rgba, width, boxOf.get(it), r.text, it.text, r.steps, r.stepPx));
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
2172
|
const pairs = tuning.postprocess ? items.filter((it) => boxOf.has(it) && NUMBER_PAIR.test(it.text.trim())) : [];
|
|
@@ -2194,8 +2194,8 @@ var OcrEngine = class _OcrEngine {
|
|
|
2194
2194
|
const halves = [];
|
|
2195
2195
|
for (const it of tall) {
|
|
2196
2196
|
const b = boxOf.get(it);
|
|
2197
|
-
const gray =
|
|
2198
|
-
const cut = _nullishCoalesce(midBlankRow(gray, b.w, b.h,
|
|
2197
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, b);
|
|
2198
|
+
const cut = _nullishCoalesce(midBlankRow(gray, b.w, b.h, _chunkHHRQX733cjs.inkStats.call(void 0, gray)), () => ( valleyRow(gray, b.w, b.h, _chunkHHRQX733cjs.inkStats.call(void 0, gray))));
|
|
2199
2199
|
if (cut) halves.push({ it, top: { ...b, h: cut[0] }, bottom: { ...b, y: b.y + cut[1], h: b.h - cut[1] } });
|
|
2200
2200
|
}
|
|
2201
2201
|
const res = halves.length ? await this.recognizeJobs(rgba, width, halves.flatMap((hv, k) => [{ box: hv.top, rot: 0, group: 2 * k }, { box: hv.bottom, rot: 0, group: 2 * k + 1 }]), tuning.recBatch) : [];
|
|
@@ -2216,15 +2216,15 @@ var OcrEngine = class _OcrEngine {
|
|
|
2216
2216
|
const subs = [];
|
|
2217
2217
|
const stacks = [];
|
|
2218
2218
|
for (const b of [...retry, ...blank2]) {
|
|
2219
|
-
const gray =
|
|
2220
|
-
const ink =
|
|
2219
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, b);
|
|
2220
|
+
const ink = _chunkHHRQX733cjs.inkStats.call(void 0, gray);
|
|
2221
2221
|
const cut = retry.includes(b) ? midBlankRow(gray, b.w, b.h, ink) : null;
|
|
2222
2222
|
const inCell = cellRules.some((r) => r.x1 <= b.x + 2 && r.y1 <= b.y && r.y2 >= b.y + b.h) && cellRules.some((r) => r.x1 >= b.x + b.w - 2 && r.y1 <= b.y && r.y2 >= b.y + b.h);
|
|
2223
2223
|
if (cut && b.w >= (inCell ? 2 : 3) * Math.max(cut[0], b.h - cut[1])) {
|
|
2224
2224
|
subs.push({ ...b, h: cut[0] }, { ...b, y: b.y + cut[1], h: b.h - cut[1] });
|
|
2225
2225
|
continue;
|
|
2226
2226
|
}
|
|
2227
|
-
const bands =
|
|
2227
|
+
const bands = _chunkHHRQX733cjs.stackedGlyphBands.call(void 0, gray, b.w, b.h, ink);
|
|
2228
2228
|
if (bands) stacks.push({ box: b, parts: bandBoxes(b, bands, height), word: bands.every((x, i) => i === 0 || x.y0 - bands[i - 1].y1 <= STACK_WORD_GAP * Math.max(x.y1 - x.y0, bands[i - 1].y1 - bands[i - 1].y0)) });
|
|
2229
2229
|
}
|
|
2230
2230
|
const overlap = (a, o) => Math.max(0, Math.min(a.x + a.w, o.x + o.w) - Math.max(a.x, o.x)) * Math.max(0, Math.min(a.y + a.h, o.y + o.h) - Math.max(a.y, o.y));
|
|
@@ -2303,8 +2303,8 @@ var OcrEngine = class _OcrEngine {
|
|
|
2303
2303
|
/** 결과 좌표 — det 박스 그대로 또는 박스 안 잉크 외곽 (tightBoxes) */
|
|
2304
2304
|
itemBox(rgba, width, b, tuning) {
|
|
2305
2305
|
if (!tuning.tightBoxes) return b;
|
|
2306
|
-
const gray =
|
|
2307
|
-
const t =
|
|
2306
|
+
const gray = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, width, b);
|
|
2307
|
+
const t = _chunkHHRQX733cjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkHHRQX733cjs.inkStats.call(void 0, gray));
|
|
2308
2308
|
return { x: b.x + t.x0, y: b.y + t.y0, w: t.x1 - t.x0, h: t.y1 - t.y0 };
|
|
2309
2309
|
}
|
|
2310
2310
|
// ─── det ─────────────────────────────────────────────
|
|
@@ -2375,7 +2375,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
2375
2375
|
const out = await this.rec.run({ [this.rec.inputNames[0]]: tensor });
|
|
2376
2376
|
const logits = out[this.rec.outputNames[0]];
|
|
2377
2377
|
const [, T, C] = logits.dims;
|
|
2378
|
-
if (C !== this.dict.length + 2) throw new (0,
|
|
2378
|
+
if (C !== this.dict.length + 2) throw new (0, _chunkQIVOVMECcjs.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`);
|
|
2379
2379
|
const data = logits.data;
|
|
2380
2380
|
idx.forEach((ci, k) => {
|
|
2381
2381
|
const r = ctcDecode(data.subarray(k * T * C, (k + 1) * T * C), T, C, this.dict);
|
|
@@ -2385,9 +2385,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
2385
2385
|
const chars = r ? [...r.text] : [];
|
|
2386
2386
|
if (r && job.rot === 0 && chars.length === r.steps.length && r.steps.some((t) => t > last) && !r.text.includes("(cid:")) {
|
|
2387
2387
|
const tallCh = (c) => !/[\s.,:;\u00b7\u2026'"\u2018-\u201d`\-_~]/.test(c);
|
|
2388
|
-
const g =
|
|
2388
|
+
const g = _chunkHHRQX733cjs.grayCrop.call(void 0, rgba, pageW, job.box);
|
|
2389
2389
|
const inside = chars.filter((c, i) => r.steps[i] <= last && tallCh(c)).length;
|
|
2390
|
-
let budget = inside <= 2 ?
|
|
2390
|
+
let budget = inside <= 2 ? _chunkHHRQX733cjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkHHRQX733cjs.inkStats.call(void 0, g)) - inside : Infinity;
|
|
2391
2391
|
const keep = chars.map((c, i) => r.steps[i] <= last || !tallCh(c) || budget-- > 0);
|
|
2392
2392
|
if (!keep.every(Boolean)) kept = { ...r, text: chars.filter((_, i) => keep[i]).join(""), steps: r.steps.filter((_, i) => keep[i]) };
|
|
2393
2393
|
}
|
|
@@ -2498,13 +2498,13 @@ async function tryImport(name, loader) {
|
|
|
2498
2498
|
return await loader();
|
|
2499
2499
|
} catch (e) {
|
|
2500
2500
|
throw new Error(
|
|
2501
|
-
`\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.${
|
|
2501
|
+
`\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.${_chunkQIVOVMECcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
2502
2502
|
);
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
2505
|
async function verifiedBytes(s) {
|
|
2506
2506
|
const name = _path.basename.call(void 0, s.file.path);
|
|
2507
|
-
const fail = (why2) => new (0,
|
|
2507
|
+
const fail = (why2) => new (0, _chunkQIVOVMECcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
|
|
2508
2508
|
const why = (e) => {
|
|
2509
2509
|
const code = e.code;
|
|
2510
2510
|
return code === "ENOENT" ? "\uD30C\uC77C\uC774 \uC5C6\uC74C" : code === "EACCES" || code === "EPERM" ? "\uAD8C\uD55C \uC5C6\uC74C" : "\uC77D\uAE30 \uC2E4\uD328";
|
|
@@ -2525,13 +2525,13 @@ async function verifiedBytes(s) {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
const actual = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex");
|
|
2527
2527
|
if (actual !== s.file.sha256) {
|
|
2528
|
-
throw new (0,
|
|
2528
|
+
throw new (0, _chunkQIVOVMECcjs.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)`);
|
|
2529
2529
|
}
|
|
2530
2530
|
return bytes;
|
|
2531
2531
|
}
|
|
2532
2532
|
var engines = /* @__PURE__ */ new Map();
|
|
2533
|
-
function getOcrEngine(models =
|
|
2534
|
-
const key =
|
|
2533
|
+
function getOcrEngine(models = _chunkHHRQX733cjs.DEFAULT_OCR_MODELS) {
|
|
2534
|
+
const key = _chunkHHRQX733cjs.ocrSelectionKey.call(void 0, models);
|
|
2535
2535
|
let p = engines.get(key);
|
|
2536
2536
|
if (!p) {
|
|
2537
2537
|
p = OcrEngine.create(models).catch((err) => {
|
|
@@ -3007,20 +3007,20 @@ var REDETECT = { minDropped: 15, minShare: 0.15, scale: 5 / 3 };
|
|
|
3007
3007
|
var AUTO_REC = { pageConf: 0.9, gain: 0.06 };
|
|
3008
3008
|
var DEFAULT_AUTO_REC = { pageConf: 0.9, gain: 0.08, altConf: 0.95, sureGain: 0.1, minDiff: 0.08, minChars: 80, lazy: true };
|
|
3009
3009
|
var DEFAULT_BUILTIN_OCR = Object.freeze({
|
|
3010
|
-
models:
|
|
3010
|
+
models: _chunkHHRQX733cjs.DEFAULT_OCR_MODELS,
|
|
3011
3011
|
tuning: DEFAULT_OCR_TUNING,
|
|
3012
|
-
handwriting:
|
|
3012
|
+
handwriting: _chunkHHRQX733cjs.handwritingFallbackModels.call(void 0, _chunkHHRQX733cjs.DEFAULT_OCR_MODELS),
|
|
3013
3013
|
autoRec: DEFAULT_AUTO_REC
|
|
3014
3014
|
});
|
|
3015
3015
|
var DEFAULT_BUILTIN_OCR_FETCH = Object.freeze({ ...DEFAULT_BUILTIN_OCR, autoRec: { ...DEFAULT_AUTO_REC, fetch: true } });
|
|
3016
3016
|
function builtinOcrConfig(o) {
|
|
3017
3017
|
if (!o || o.ocrDet === void 0 && o.ocrDetLongSide === void 0 && o.ocrRec === void 0 && o.ocrRecDict === void 0 && !o.ocrLines) return _optionalChain([o, 'optionalAccess', _78 => _78.ocr]) ? DEFAULT_BUILTIN_OCR_FETCH : DEFAULT_BUILTIN_OCR;
|
|
3018
3018
|
const bad = _chunkMMK32GPDcjs.validateOcrOptions.call(void 0, o);
|
|
3019
|
-
if (bad) throw new (0,
|
|
3020
|
-
const models =
|
|
3019
|
+
if (bad) throw new (0, _chunkQIVOVMECcjs.KordocError)(bad);
|
|
3020
|
+
const models = _chunkHHRQX733cjs.resolveOcrModels.call(void 0, o);
|
|
3021
3021
|
return {
|
|
3022
3022
|
models,
|
|
3023
|
-
...o.ocrRec === "auto" ? { handwriting:
|
|
3023
|
+
...o.ocrRec === "auto" ? { handwriting: _chunkHHRQX733cjs.handwritingFallbackModels.call(void 0, models), autoRec: AUTO_REC } : o.ocrRec === void 0 ? { handwriting: _chunkHHRQX733cjs.handwritingFallbackModels.call(void 0, models), autoRec: o.ocr ? { ...DEFAULT_AUTO_REC, fetch: true } : DEFAULT_AUTO_REC } : {},
|
|
3024
3024
|
tuning: o.ocrDetLongSide === void 0 ? DEFAULT_OCR_TUNING : { ...DEFAULT_OCR_TUNING, detLongSide: o.ocrDetLongSide },
|
|
3025
3025
|
lines: o.ocrLines === "all" ? "all" : o.ocrLines ? "kept" : void 0
|
|
3026
3026
|
};
|
|
@@ -3046,8 +3046,8 @@ async function withHandwritingRec(items, config, tuning, rgba, width, height, st
|
|
|
3046
3046
|
const altStats = { droppedLowConf: 0, ...stats.dropped ? { dropped: [] } : {} };
|
|
3047
3047
|
let alt;
|
|
3048
3048
|
try {
|
|
3049
|
-
if (auto.lazy && !auto.fetch && !await
|
|
3050
|
-
if (auto.lazy) await
|
|
3049
|
+
if (auto.lazy && !auto.fetch && !await _chunkHHRQX733cjs.ocrModelsCached.call(void 0, config.handwriting)) return items;
|
|
3050
|
+
if (auto.lazy) await _chunkHHRQX733cjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
|
|
3051
3051
|
alt = await (await getOcrEngine(config.handwriting)).recognizePage(rgba, width, height, altStats, tuning, cellRules, rowRules);
|
|
3052
3052
|
} catch (e) {
|
|
3053
3053
|
if (!auto.lazy) throw e;
|
|
@@ -3093,8 +3093,8 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
3093
3093
|
"@hyzyla/pdfium",
|
|
3094
3094
|
() => Promise.resolve().then(() => _interopRequireWildcard(require("@hyzyla/pdfium")))
|
|
3095
3095
|
);
|
|
3096
|
-
if (mode === "builtin") await
|
|
3097
|
-
if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await
|
|
3096
|
+
if (mode === "builtin") await _chunkHHRQX733cjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
|
|
3097
|
+
if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await _chunkHHRQX733cjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
|
|
3098
3098
|
const engine = mode === "builtin" ? await getOcrEngine(config.models) : null;
|
|
3099
3099
|
const pdfium = await pdfiumMod.PDFiumLibrary.init();
|
|
3100
3100
|
const doc = await pdfium.loadDocument(new Uint8Array(buffer));
|
|
@@ -3207,7 +3207,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
3207
3207
|
const x1 = r.x1 * scale - 2, x2 = r.x2 * scale + 2, y1 = (pdfH - r.y2) * scale - 2, y2 = (pdfH - r.y1) * scale + 2;
|
|
3208
3208
|
const columnRules = _nullishCoalesce(_optionalChain([ruling, 'optionalAccess', _89 => _89.verticals, 'access', _90 => _90.filter, 'call', _91 => _91((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', _92 => _92.length]), () => ( 0));
|
|
3209
3209
|
if (columnRules < 2) {
|
|
3210
|
-
for (const b of blocks) if (b.type === "table")
|
|
3210
|
+
for (const b of blocks) if (b.type === "table") _chunkHHRQX733cjs.UNRULED_REGION_TABLES.add(b);
|
|
3211
3211
|
}
|
|
3212
3212
|
return blocks;
|
|
3213
3213
|
});
|
|
@@ -3279,7 +3279,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
3279
3279
|
const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
|
|
3280
3280
|
out.push(items.map((it) => {
|
|
3281
3281
|
const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
|
|
3282
|
-
|
|
3282
|
+
_chunkHHRQX733cjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
|
|
3283
3283
|
return placed;
|
|
3284
3284
|
}));
|
|
3285
3285
|
}
|
|
@@ -3371,7 +3371,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
3371
3371
|
isHidden: false,
|
|
3372
3372
|
...xs[i].space ? { hasSpaceBefore: true } : {}
|
|
3373
3373
|
};
|
|
3374
|
-
|
|
3374
|
+
_chunkHHRQX733cjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
|
|
3375
3375
|
return normalized;
|
|
3376
3376
|
}).filter((it) => it.text);
|
|
3377
3377
|
if (_optionalChain([extraLines, 'optionalAccess', _96 => _96.verticals, 'access', _97 => _97.length]) && items.length) {
|
|
@@ -3387,7 +3387,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
3387
3387
|
})
|
|
3388
3388
|
};
|
|
3389
3389
|
}
|
|
3390
|
-
const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(
|
|
3390
|
+
const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(_chunkHHRQX733cjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))))), pdfH);
|
|
3391
3391
|
const blocks = figureRegion ? laid : splitOcrProseRows(laid);
|
|
3392
3392
|
if (!figureRegion) markOcrHeadings(blocks);
|
|
3393
3393
|
return blocks;
|
|
@@ -3448,7 +3448,7 @@ async function tryImport2(name, loader) {
|
|
|
3448
3448
|
return await loader();
|
|
3449
3449
|
} catch (e) {
|
|
3450
3450
|
throw new Error(
|
|
3451
|
-
`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.${
|
|
3451
|
+
`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.${_chunkQIVOVMECcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
3452
3452
|
);
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
@@ -3501,4 +3501,4 @@ function bgraToRgba(bgra) {
|
|
|
3501
3501
|
|
|
3502
3502
|
|
|
3503
3503
|
exports.rescueEmptyCells = rescueEmptyCells; exports.getOcrEngine = getOcrEngine; exports.detectRulingLines = detectRulingLines; exports.rulingToPdfLines = rulingToPdfLines; exports.deskewPage = deskewPage; exports.rotateQuarter = rotateQuarter; exports.MAX_OCR_PIXELS = MAX_OCR_PIXELS; exports.DEFAULT_BUILTIN_OCR = DEFAULT_BUILTIN_OCR; exports.builtinOcrConfig = builtinOcrConfig; exports.recognizeOcrPage = recognizeOcrPage; exports.reportModelDownload = reportModelDownload; exports.toOcrLine = toOcrLine; exports.pageLines = pageLines; exports.cellEdgeVerticals = cellEdgeVerticals; exports.cellEdgeHorizontals = cellEdgeHorizontals; exports.runPdfOcr = runPdfOcr; exports.ocrOnePage = ocrOnePage; exports.stretchFaintCrop = stretchFaintCrop; exports.groupOcrLines = groupOcrLines; exports.ocrItemsToBlocks = ocrItemsToBlocks; exports.markOcrHeadings = markOcrHeadings;
|
|
3504
|
-
//# sourceMappingURL=chunk-
|
|
3504
|
+
//# sourceMappingURL=chunk-2P3SFHOF.cjs.map
|