kordoc 4.24.39 → 4.24.41
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 +4 -4
- package/dist/{-7VE547IT.js → -5XLO3RHD.js} +21 -21
- package/dist/{chunk-F2JYJ2SP.js → chunk-2CHSOHDE.js} +2 -2
- package/dist/{chunk-YXKU6UJD.js → chunk-2IK2Z6PO.js} +2 -2
- package/dist/{chunk-3MHRL3OO.js → chunk-3GJ3CMYS.js} +2 -2
- package/dist/{chunk-4FWLCWNU.js → chunk-57LVGVIS.js} +2 -2
- package/dist/{chunk-PFHMNNW7.js → chunk-5QHQ56AK.js} +36 -6
- package/dist/chunk-5QHQ56AK.js.map +1 -0
- package/dist/{chunk-IM5SIGUN.cjs → chunk-5QMMROCA.cjs} +3 -3
- package/dist/chunk-5QMMROCA.cjs.map +1 -0
- package/dist/chunk-ARVHYL3V.cjs.map +1 -1
- package/dist/{chunk-RPAEXGWZ.js → chunk-C2YUJXHB.js} +2 -2
- package/dist/{chunk-QDQPAC4L.js → chunk-C5XJDCXW.js} +2 -2
- package/dist/{chunk-ZDMLZRS4.js → chunk-CCGGLBHD.js} +111 -34
- package/dist/chunk-CCGGLBHD.js.map +1 -0
- package/dist/chunk-DEVQZTE7.cjs.map +1 -1
- package/dist/{chunk-SFLHCRO6.js → chunk-EPR3TQS3.js} +2 -2
- package/dist/{chunk-7ZRUR4TZ.js → chunk-EPZVMBAQ.js} +2 -2
- package/dist/{chunk-CS76UPUC.js → chunk-FVYTDR6E.js} +29 -7
- package/dist/chunk-FVYTDR6E.js.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-7BQWFZJO.js → chunk-GYMAGQNQ.js} +6 -6
- package/dist/{chunk-XYVTCXAG.cjs → chunk-HJGKVI7D.cjs} +81 -51
- package/dist/chunk-HJGKVI7D.cjs.map +1 -0
- package/dist/{chunk-RJNHXCMP.cjs → chunk-HR72SA4M.cjs} +182 -106
- package/dist/chunk-HR72SA4M.cjs.map +1 -0
- package/dist/{chunk-LU7X6LLW.cjs → chunk-IHMDGE7Z.cjs} +3 -3
- package/dist/chunk-IHMDGE7Z.cjs.map +1 -0
- package/dist/{chunk-WVER4OWF.js → chunk-IXFRVO7E.js} +3 -3
- package/dist/chunk-J55UQC5H.cjs.map +1 -1
- package/dist/{chunk-QDPYTJ4Y.js → chunk-JBQ5R4VV.js} +2 -2
- package/dist/{chunk-MANE7HAZ.cjs → chunk-JZEMASGR.cjs} +2 -2
- package/dist/chunk-JZEMASGR.cjs.map +1 -0
- package/dist/{chunk-NQJL3664.js → chunk-K2AVB6ZW.js} +3 -3
- package/dist/{chunk-PQIIYKNL.js → chunk-KF6MJIPV.js} +11 -11
- package/dist/{chunk-WPIG3KUV.js → chunk-KQDO246G.js} +28 -6
- package/dist/chunk-KQDO246G.js.map +1 -0
- package/dist/{chunk-NL5OTD2E.js → chunk-KTWCSSNS.js} +10 -10
- package/dist/chunk-LAYKIZOX.cjs.map +1 -1
- package/dist/{chunk-Y5O4DS56.js → chunk-MZ7AGKAN.js} +2 -2
- package/dist/{chunk-LOJYJISM.js → chunk-NHDOSQZ6.js} +110 -34
- package/dist/chunk-NHDOSQZ6.js.map +1 -0
- package/dist/{chunk-M2ZRTYQ5.js → chunk-OPE2XDGY.js} +5 -5
- package/dist/{chunk-2XXTL4S4.js → chunk-QNXWOUWQ.js} +2 -2
- package/dist/{chunk-FRMJTW3C.js → chunk-S7TKYRJB.js} +2 -2
- package/dist/{chunk-346W5O2J.js → chunk-SGBD6MTI.js} +2 -2
- package/dist/{chunk-BWBR5GWQ.js → chunk-SV462GOK.js} +2 -2
- package/dist/{chunk-7AYP2XO6.js → chunk-TGKYTBQ2.js} +3 -3
- package/dist/{chunk-UKTRLJII.cjs → chunk-TJARBWAJ.cjs} +98 -98
- package/dist/chunk-TJARBWAJ.cjs.map +1 -0
- package/dist/chunk-TK3FDAEE.cjs.map +1 -1
- package/dist/{chunk-LE3733C2.cjs → chunk-TVMNTRPZ.cjs} +104 -82
- package/dist/chunk-TVMNTRPZ.cjs.map +1 -0
- package/dist/{chunk-GXED6LJX.js → chunk-TWFL7T4K.js} +2 -2
- package/dist/{chunk-FZMZUX7B.js → chunk-UHN5TULI.js} +37 -7
- package/dist/chunk-UHN5TULI.js.map +1 -0
- package/dist/{chunk-L23XOAKF.js → chunk-UI3SZQXC.js} +6 -6
- package/dist/{chunk-V3IMDOZE.cjs → chunk-WNOSEEBH.cjs} +6 -6
- package/dist/chunk-WNOSEEBH.cjs.map +1 -0
- package/dist/{chunk-PHVAJBHM.js → chunk-WYJWJ7X4.js} +2 -2
- package/dist/chunk-X7RBVVDC.cjs.map +1 -1
- package/dist/{chunk-IZWZ3RQC.js → chunk-XBWP6REN.js} +2 -2
- package/dist/{chunk-COH7WXBK.js → chunk-XPYC55DA.js} +5 -5
- package/dist/{chunk-ZVAX6E63.js → chunk-ZDTP5IJU.js} +2 -2
- package/dist/{chunk-V2RIY72D.js → chunk-ZOCDODX3.js} +2 -2
- package/dist/chunk-ZTN3T3GH.cjs.map +1 -1
- package/dist/{chunk-U5OV6D66.js → chunk-ZUFIMOGS.js} +15 -15
- package/dist/chunks-23JEOBIH.js +11 -0
- package/dist/cli.js +43 -43
- package/dist/detect-V75ERMYL.cjs.map +1 -1
- package/dist/{formula-PFSZZNPP.js → formula-3X2Y6F6V.js} +3 -3
- package/dist/{formula-UI2UR74M.cjs → formula-4WGDQBOM.cjs} +9 -9
- package/dist/formula-4WGDQBOM.cjs.map +1 -0
- package/dist/{formula-MMLDES2Z.js → formula-IBE4CZ5R.js} +4 -4
- package/dist/generator-JYJLWH7T.js +17 -0
- package/dist/generator-PGOJNK7D.js +10 -0
- package/dist/generator-ZRVKK7UG.cjs +11 -0
- package/dist/generator-ZRVKK7UG.cjs.map +1 -0
- package/dist/{hancom-XO52GNC3.js → hancom-CBYVMPCO.js} +2 -2
- package/dist/{hancom-3V3USCW5.js → hancom-UACA2WTF.js} +2 -2
- package/dist/{hancom-GV5TTF5H.cjs → hancom-YR2BB373.cjs} +5 -5
- package/dist/hancom-YR2BB373.cjs.map +1 -0
- package/dist/{image-ocr-R2ASFKHX.js → image-ocr-2CUGPHIK.js} +10 -10
- package/dist/{image-ocr-SU4RPHBF.js → image-ocr-JEHNWQVE.js} +7 -7
- package/dist/{image-ocr-2WKCFABH.cjs → image-ocr-RNAJ66EN.cjs} +27 -27
- package/dist/image-ocr-RNAJ66EN.cjs.map +1 -0
- package/dist/index.cjs +1105 -1105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/mcp.js +37 -37
- package/dist/mcp.js.map +1 -1
- package/dist/memo-V24MEWBZ.js +17 -0
- package/dist/{model-bundle-JMSH2F4A.js → model-bundle-HLPWOTCS.js} +5 -5
- package/dist/{models-D5SATVOZ.js → models-AMOW56WP.js} +5 -5
- package/dist/page-range-QHHFTL7X.cjs.map +1 -1
- package/dist/{parse-worker-v2-WIIZQFRX.js → parse-worker-v2-Z4BCWVRX.js} +22 -22
- package/dist/{parser-MFBTEGJA.cjs → parser-D2DQIUP3.cjs} +159 -159
- package/dist/parser-D2DQIUP3.cjs.map +1 -0
- package/dist/{parser-SBJKV5GS.js → parser-Y4GUP7PZ.js} +12 -12
- package/dist/{parser-KCY43TBS.js → parser-YMNUQBLB.js} +9 -9
- package/dist/{pdf-ocr-UU5PSZ7Z.js → pdf-ocr-3K266ENT.js} +9 -9
- package/dist/{pdf-ocr-I6GNQEFS.js → pdf-ocr-EPIM3YWE.js} +6 -6
- package/dist/pdf-ocr-OX7H7NOU.cjs +40 -0
- package/dist/pdf-ocr-OX7H7NOU.cjs.map +1 -0
- package/dist/{profile-io-HZK4ZZ2O.js → profile-io-AW4GEYDQ.js} +3 -3
- package/dist/{rasterize-VNP4ULXM.js → rasterize-75AWRNSO.js} +3 -3
- package/dist/{redact-doc-SPHSBCPN.js → redact-doc-3UUPTXFI.js} +21 -21
- package/dist/{render-CKTTIDU2.js → render-JGMRAI2P.js} +12 -12
- package/dist/{rewrite-fallback-H2KMJV6G.js → rewrite-fallback-UDQAKQN2.js} +13 -13
- package/dist/rewrite-fallback-UDQAKQN2.js.map +1 -0
- package/dist/seal-WFNKTHBW.js +16 -0
- package/dist/{setup-GJVOXJN7.js → setup-JTHBR676.js} +3 -3
- package/dist/{to-hwpx-5UIBNW3D.js → to-hwpx-GJP66LQS.js} +7 -7
- package/dist/to-hwpx-LKPXAHSQ.cjs +16 -0
- package/dist/to-hwpx-LKPXAHSQ.cjs.map +1 -0
- package/dist/{to-hwpx-JJHDCYER.js → to-hwpx-ZD7IGU7G.js} +4 -4
- package/dist/visual-666SNQ3Y.js +37 -0
- package/dist/{watch-YZZES36Q.js → watch-QL4YAMRV.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-CS76UPUC.js.map +0 -1
- package/dist/chunk-FZMZUX7B.js.map +0 -1
- package/dist/chunk-IM5SIGUN.cjs.map +0 -1
- package/dist/chunk-LE3733C2.cjs.map +0 -1
- package/dist/chunk-LOJYJISM.js.map +0 -1
- package/dist/chunk-LU7X6LLW.cjs.map +0 -1
- package/dist/chunk-MANE7HAZ.cjs.map +0 -1
- package/dist/chunk-PFHMNNW7.js.map +0 -1
- package/dist/chunk-RJNHXCMP.cjs.map +0 -1
- package/dist/chunk-UKTRLJII.cjs.map +0 -1
- package/dist/chunk-V3IMDOZE.cjs.map +0 -1
- package/dist/chunk-WPIG3KUV.js.map +0 -1
- package/dist/chunk-XYVTCXAG.cjs.map +0 -1
- package/dist/chunk-ZDMLZRS4.js.map +0 -1
- package/dist/chunks-WTYZ4KG2.js +0 -11
- package/dist/formula-UI2UR74M.cjs.map +0 -1
- package/dist/generator-C3SCP3ZG.js +0 -10
- package/dist/generator-CHBOCLYX.cjs +0 -11
- package/dist/generator-CHBOCLYX.cjs.map +0 -1
- package/dist/generator-RTSNDZJB.js +0 -17
- package/dist/hancom-GV5TTF5H.cjs.map +0 -1
- package/dist/image-ocr-2WKCFABH.cjs.map +0 -1
- package/dist/memo-U4RZJRU2.js +0 -17
- package/dist/parser-MFBTEGJA.cjs.map +0 -1
- package/dist/pdf-ocr-L2O4SQUK.cjs +0 -40
- package/dist/pdf-ocr-L2O4SQUK.cjs.map +0 -1
- package/dist/rewrite-fallback-H2KMJV6G.js.map +0 -1
- package/dist/seal-MSY5G3UR.js +0 -16
- package/dist/to-hwpx-6BQNMA6P.cjs +0 -16
- package/dist/to-hwpx-6BQNMA6P.cjs.map +0 -1
- package/dist/visual-Q6PIMKSA.js +0 -37
- /package/dist/{-7VE547IT.js.map → -5XLO3RHD.js.map} +0 -0
- /package/dist/{chunk-F2JYJ2SP.js.map → chunk-2CHSOHDE.js.map} +0 -0
- /package/dist/{chunk-YXKU6UJD.js.map → chunk-2IK2Z6PO.js.map} +0 -0
- /package/dist/{chunk-3MHRL3OO.js.map → chunk-3GJ3CMYS.js.map} +0 -0
- /package/dist/{chunk-4FWLCWNU.js.map → chunk-57LVGVIS.js.map} +0 -0
- /package/dist/{chunk-RPAEXGWZ.js.map → chunk-C2YUJXHB.js.map} +0 -0
- /package/dist/{chunk-QDQPAC4L.js.map → chunk-C5XJDCXW.js.map} +0 -0
- /package/dist/{chunk-SFLHCRO6.js.map → chunk-EPR3TQS3.js.map} +0 -0
- /package/dist/{chunk-7ZRUR4TZ.js.map → chunk-EPZVMBAQ.js.map} +0 -0
- /package/dist/{chunk-7BQWFZJO.js.map → chunk-GYMAGQNQ.js.map} +0 -0
- /package/dist/{chunk-WVER4OWF.js.map → chunk-IXFRVO7E.js.map} +0 -0
- /package/dist/{chunk-QDPYTJ4Y.js.map → chunk-JBQ5R4VV.js.map} +0 -0
- /package/dist/{chunk-NQJL3664.js.map → chunk-K2AVB6ZW.js.map} +0 -0
- /package/dist/{chunk-PQIIYKNL.js.map → chunk-KF6MJIPV.js.map} +0 -0
- /package/dist/{chunk-NL5OTD2E.js.map → chunk-KTWCSSNS.js.map} +0 -0
- /package/dist/{chunk-Y5O4DS56.js.map → chunk-MZ7AGKAN.js.map} +0 -0
- /package/dist/{chunk-M2ZRTYQ5.js.map → chunk-OPE2XDGY.js.map} +0 -0
- /package/dist/{chunk-2XXTL4S4.js.map → chunk-QNXWOUWQ.js.map} +0 -0
- /package/dist/{chunk-FRMJTW3C.js.map → chunk-S7TKYRJB.js.map} +0 -0
- /package/dist/{chunk-346W5O2J.js.map → chunk-SGBD6MTI.js.map} +0 -0
- /package/dist/{chunk-BWBR5GWQ.js.map → chunk-SV462GOK.js.map} +0 -0
- /package/dist/{chunk-7AYP2XO6.js.map → chunk-TGKYTBQ2.js.map} +0 -0
- /package/dist/{chunk-GXED6LJX.js.map → chunk-TWFL7T4K.js.map} +0 -0
- /package/dist/{chunk-L23XOAKF.js.map → chunk-UI3SZQXC.js.map} +0 -0
- /package/dist/{chunk-PHVAJBHM.js.map → chunk-WYJWJ7X4.js.map} +0 -0
- /package/dist/{chunk-IZWZ3RQC.js.map → chunk-XBWP6REN.js.map} +0 -0
- /package/dist/{chunk-COH7WXBK.js.map → chunk-XPYC55DA.js.map} +0 -0
- /package/dist/{chunk-ZVAX6E63.js.map → chunk-ZDTP5IJU.js.map} +0 -0
- /package/dist/{chunk-V2RIY72D.js.map → chunk-ZOCDODX3.js.map} +0 -0
- /package/dist/{chunk-U5OV6D66.js.map → chunk-ZUFIMOGS.js.map} +0 -0
- /package/dist/{chunks-WTYZ4KG2.js.map → chunks-23JEOBIH.js.map} +0 -0
- /package/dist/{formula-PFSZZNPP.js.map → formula-3X2Y6F6V.js.map} +0 -0
- /package/dist/{formula-MMLDES2Z.js.map → formula-IBE4CZ5R.js.map} +0 -0
- /package/dist/{generator-C3SCP3ZG.js.map → generator-JYJLWH7T.js.map} +0 -0
- /package/dist/{generator-RTSNDZJB.js.map → generator-PGOJNK7D.js.map} +0 -0
- /package/dist/{hancom-XO52GNC3.js.map → hancom-CBYVMPCO.js.map} +0 -0
- /package/dist/{hancom-3V3USCW5.js.map → hancom-UACA2WTF.js.map} +0 -0
- /package/dist/{image-ocr-R2ASFKHX.js.map → image-ocr-2CUGPHIK.js.map} +0 -0
- /package/dist/{image-ocr-SU4RPHBF.js.map → image-ocr-JEHNWQVE.js.map} +0 -0
- /package/dist/{memo-U4RZJRU2.js.map → memo-V24MEWBZ.js.map} +0 -0
- /package/dist/{model-bundle-JMSH2F4A.js.map → model-bundle-HLPWOTCS.js.map} +0 -0
- /package/dist/{models-D5SATVOZ.js.map → models-AMOW56WP.js.map} +0 -0
- /package/dist/{parse-worker-v2-WIIZQFRX.js.map → parse-worker-v2-Z4BCWVRX.js.map} +0 -0
- /package/dist/{parser-SBJKV5GS.js.map → parser-Y4GUP7PZ.js.map} +0 -0
- /package/dist/{parser-KCY43TBS.js.map → parser-YMNUQBLB.js.map} +0 -0
- /package/dist/{pdf-ocr-I6GNQEFS.js.map → pdf-ocr-3K266ENT.js.map} +0 -0
- /package/dist/{pdf-ocr-UU5PSZ7Z.js.map → pdf-ocr-EPIM3YWE.js.map} +0 -0
- /package/dist/{profile-io-HZK4ZZ2O.js.map → profile-io-AW4GEYDQ.js.map} +0 -0
- /package/dist/{rasterize-VNP4ULXM.js.map → rasterize-75AWRNSO.js.map} +0 -0
- /package/dist/{redact-doc-SPHSBCPN.js.map → redact-doc-3UUPTXFI.js.map} +0 -0
- /package/dist/{render-CKTTIDU2.js.map → render-JGMRAI2P.js.map} +0 -0
- /package/dist/{seal-MSY5G3UR.js.map → seal-WFNKTHBW.js.map} +0 -0
- /package/dist/{setup-GJVOXJN7.js.map → setup-JTHBR676.js.map} +0 -0
- /package/dist/{to-hwpx-5UIBNW3D.js.map → to-hwpx-GJP66LQS.js.map} +0 -0
- /package/dist/{to-hwpx-JJHDCYER.js.map → to-hwpx-ZD7IGU7G.js.map} +0 -0
- /package/dist/{visual-Q6PIMKSA.js.map → visual-666SNQ3Y.js.map} +0 -0
- /package/dist/{watch-YZZES36Q.js.map → watch-QL4YAMRV.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/private/tmp/kd-pub/dist/chunk-TK3FDAEE.cjs","../src/ocr/runtime-env.ts"],"names":[],"mappings":"AAAA;ACCO,SAAS,mBAAA,CAAA,EAA4B;AAC1C,EAAA,GAAA,CAAI,OAAO,QAAA,IAAY,YAAA,GAAe,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,GAAA,CAAI,sBAAA,EAAwB,GAAA;AACzF;ADCA;AACA;AACE;AACF,kDAAC","file":"/private/tmp/kd-pub/dist/chunk-TK3FDAEE.cjs","sourcesContent":[null,"/** ORT 1.29 POSIX telemetry must be disabled before native environment creation. */\nexport function disableOrtTelemetry(): void {\n if (typeof process !== \"undefined\" && process.env) process.env.ORT_DISABLE_TELEMETRY = \"1\"\n}\n"]}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkHJGKVI7Dcjs = require('./chunk-HJGKVI7D.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkZTN3T3GHcjs = require('./chunk-ZTN3T3GH.cjs');
|
|
@@ -44,7 +44,7 @@ var _chunkTK3FDAEEcjs = require('./chunk-TK3FDAEE.cjs');
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunkJZEMASGRcjs = require('./chunk-JZEMASGR.cjs');
|
|
48
48
|
|
|
49
49
|
// src/ocr/ocr-stacked-rows.ts
|
|
50
50
|
var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—·∼~]$|^\([-+−△▲▽▼]?[\d.,]+\)$/;
|
|
@@ -514,8 +514,8 @@ var INKLESS_DELTA = 32;
|
|
|
514
514
|
function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
515
515
|
const chars = [...text];
|
|
516
516
|
if (chars.length !== steps.length) return text;
|
|
517
|
-
const gray =
|
|
518
|
-
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink:
|
|
517
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
518
|
+
const c = { chars, cx: (i) => (steps[i] + 0.5) * stepPx, gray, w: box.w, h: box.h, ink: _chunkHJGKVI7Dcjs.inkStats.call(void 0, gray) };
|
|
519
519
|
if (/[[\]]/.test(text)) brackets(c);
|
|
520
520
|
if (text.includes("'")) cornerQuotes(c);
|
|
521
521
|
if (/['"]/.test(text)) quotes(c);
|
|
@@ -533,7 +533,7 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
|
533
533
|
function trimInklessEnds(rgba, pageW, box, text, steps, stepPx) {
|
|
534
534
|
const chars = [...text], { w, h } = box;
|
|
535
535
|
if (chars.length !== steps.length || steps.some((s) => (s + 0.5) * stepPx > w + stepPx)) return { text, steps };
|
|
536
|
-
const gray =
|
|
536
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
537
537
|
const hist = new Uint32Array(256);
|
|
538
538
|
for (const v of gray) hist[v]++;
|
|
539
539
|
let bg = 0;
|
|
@@ -564,8 +564,8 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
|
|
|
564
564
|
continue;
|
|
565
565
|
}
|
|
566
566
|
if (open > 0) {
|
|
567
|
-
const f =
|
|
568
|
-
if (f &&
|
|
567
|
+
const f = _chunkHJGKVI7Dcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
568
|
+
if (f && _chunkHJGKVI7Dcjs.bracketShape.call(void 0, f, true) === "\u300D") {
|
|
569
569
|
chars[i] = "\u300D";
|
|
570
570
|
open--;
|
|
571
571
|
}
|
|
@@ -575,12 +575,12 @@ function cornerCommas({ chars, cx, gray, w, h, ink }) {
|
|
|
575
575
|
function cornerQuotes({ chars, cx, gray, w, h, ink }) {
|
|
576
576
|
for (let i = 0; i < chars.length; i++) {
|
|
577
577
|
if (chars[i] !== "'" || !/^[가-힣]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
578
|
-
const f =
|
|
579
|
-
if (!f || f.ch < f.charH * 0.45 ||
|
|
578
|
+
const f = _chunkHJGKVI7Dcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
579
|
+
if (!f || f.ch < f.charH * 0.45 || _chunkHJGKVI7Dcjs.bracketShape.call(void 0, f, false) !== "\u300C") continue;
|
|
580
580
|
const rest = chars.slice(i + 1), end = rest.findIndex((c) => c === "'" || c === "\u300D" || c === ",");
|
|
581
581
|
const pair = end >= 0 && rest[end] !== "'" && (rest[end] === "\u300D" || (() => {
|
|
582
|
-
const g =
|
|
583
|
-
return !!g &&
|
|
582
|
+
const g = _chunkHJGKVI7Dcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
|
|
583
|
+
return !!g && _chunkHJGKVI7Dcjs.bracketShape.call(void 0, g, true) === "\u300D";
|
|
584
584
|
})());
|
|
585
585
|
if (pair) chars[i] = "\u300C";
|
|
586
586
|
}
|
|
@@ -588,8 +588,8 @@ function cornerQuotes({ chars, cx, gray, w, h, ink }) {
|
|
|
588
588
|
function brackets({ chars, cx, gray, w, h, ink }) {
|
|
589
589
|
const shape = chars.map((c, i) => {
|
|
590
590
|
if (c !== "[" && c !== "]") return null;
|
|
591
|
-
const f =
|
|
592
|
-
return f &&
|
|
591
|
+
const f = _chunkHJGKVI7Dcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
592
|
+
return f && _chunkHJGKVI7Dcjs.bracketShape.call(void 0, f, c === "]");
|
|
593
593
|
});
|
|
594
594
|
for (let i = 0; i < chars.length; i++) {
|
|
595
595
|
if (chars[i] !== "[") continue;
|
|
@@ -621,7 +621,7 @@ function quotes({ chars, cx, gray, w, h, ink }) {
|
|
|
621
621
|
continue;
|
|
622
622
|
}
|
|
623
623
|
if (!year(i) && !single[kind]) continue;
|
|
624
|
-
const r =
|
|
624
|
+
const r = _chunkHJGKVI7Dcjs.quoteHead.call(void 0, gray, w, h, ink, cx(i));
|
|
625
625
|
if (r !== null && r >= 0.47) {
|
|
626
626
|
chars[i] = kind === "'" ? "\u2018" : "\u201C";
|
|
627
627
|
open[kind] = true;
|
|
@@ -632,7 +632,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
632
632
|
const head = chars.findIndex((c) => c.trim()), letters = chars.some((c) => /[가-힣A-Za-z]/.test(c));
|
|
633
633
|
for (let i = 0; i < chars.length; i++) {
|
|
634
634
|
if (!/^[-\u2013\u2014]$/.test(chars[i])) continue;
|
|
635
|
-
const r =
|
|
635
|
+
const r = _chunkHJGKVI7Dcjs.dashRatio.call(void 0, gray, w, h, ink, cx(i));
|
|
636
636
|
if (r === null) continue;
|
|
637
637
|
if (r < 0.65) chars[i] = "-";
|
|
638
638
|
else if (r > 0.75 && i === head && letters) chars[i] = "\u2014";
|
|
@@ -641,7 +641,7 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
641
641
|
function circled({ chars, cx, gray, w, h, ink }) {
|
|
642
642
|
const at = chars.flatMap((c, i) => /^[1-9]$/.test(c) && !/\d/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) && !/\d/.test(_nullishCoalesce(chars[i + 1], () => ( ""))) ? [i] : []);
|
|
643
643
|
if (!at.length) return;
|
|
644
|
-
const hit =
|
|
644
|
+
const hit = _chunkHJGKVI7Dcjs.circledAt.call(void 0, gray, w, h, ink, at.map(cx));
|
|
645
645
|
at.forEach((i, k) => {
|
|
646
646
|
if (hit[k]) chars[i] = String.fromCharCode(9311 + Number(chars[i]));
|
|
647
647
|
});
|
|
@@ -651,16 +651,16 @@ function stars({ chars, cx, gray, w, h, ink }) {
|
|
|
651
651
|
if (chars[i] !== "*" || chars[i - 1] === "*") continue;
|
|
652
652
|
let e = i;
|
|
653
653
|
while (chars[e + 1] === "*") e++;
|
|
654
|
-
const n =
|
|
654
|
+
const n = _chunkHJGKVI7Dcjs.starRun.call(void 0, gray, w, h, ink, cx(i));
|
|
655
655
|
if (n > e - i + 1 && n <= 4) chars[e] += "*".repeat(n - (e - i + 1));
|
|
656
656
|
i = e;
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
function discs({ chars, cx, gray, w, h, ink }) {
|
|
660
|
-
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) &&
|
|
660
|
+
for (let i = 0; i < chars.length; i++) if (/^[\u00b7\u2022]$/.test(chars[i]) && _chunkHJGKVI7Dcjs.discAt.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u25CF";
|
|
661
661
|
}
|
|
662
662
|
function gaps({ chars, cx, gray, w, h, ink }) {
|
|
663
|
-
const { glyphs, bandH } =
|
|
663
|
+
const { glyphs, bandH } = _chunkHJGKVI7Dcjs.gapGlyphs.call(void 0, gray, w, h, ink);
|
|
664
664
|
if (!glyphs.length) return;
|
|
665
665
|
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
666
666
|
if (!live.length) return;
|
|
@@ -731,18 +731,18 @@ function ring({ chars, cx, gray, w, h, ink }) {
|
|
|
731
731
|
const rest = chars.slice(k + 1).join("").trimStart();
|
|
732
732
|
const live = chars.map((c, i) => i).filter((i) => chars[i].trim());
|
|
733
733
|
if (live.length <= 3 && live.every((i) => /^[Oo]$/.test(chars[i]))) {
|
|
734
|
-
if (_optionalChain([
|
|
735
|
-
if (!live.every((i) =>
|
|
734
|
+
if (_optionalChain([_chunkHJGKVI7Dcjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _7 => _7.mark]) === "\u25CE") return false;
|
|
735
|
+
if (!live.every((i) => _chunkHJGKVI7Dcjs.ringBullet.call(void 0, gray, w, h, ink, cx(i)) === "\u25CB")) return false;
|
|
736
736
|
for (const i of live) chars[i] = "\u25CB";
|
|
737
737
|
return true;
|
|
738
738
|
}
|
|
739
739
|
if (/^[A-Z]{2,}/.test(rest) && /^[Oo0]$/.test(chars[k])) {
|
|
740
|
-
if (
|
|
740
|
+
if (_chunkHJGKVI7Dcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k)) !== "\u25CB") return false;
|
|
741
741
|
chars[k] = chars[k + 1] === " " ? "\u25CB" : "\u25CB ";
|
|
742
742
|
return true;
|
|
743
743
|
}
|
|
744
744
|
if (!/^[(\[「【<]?\d*[가-힣]/.test(rest)) return false;
|
|
745
|
-
const r =
|
|
745
|
+
const r = _chunkHJGKVI7Dcjs.ringBullet.call(void 0, gray, w, h, ink, cx(k));
|
|
746
746
|
if (/^[Cc]$/.test(chars[k]) && r !== "\u25CB") return false;
|
|
747
747
|
if (r) chars[k] = r;
|
|
748
748
|
return r !== null;
|
|
@@ -759,7 +759,7 @@ function parallels({ chars, cx, gray, w, h, ink }) {
|
|
|
759
759
|
let p = s - 1, q = e + 1;
|
|
760
760
|
while (p >= 0 && !chars[p].trim()) p--;
|
|
761
761
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
762
|
-
if (
|
|
762
|
+
if (_chunkHJGKVI7Dcjs.slantedPair.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity)) {
|
|
763
763
|
chars[s] = "\u2225";
|
|
764
764
|
for (let k = s + 1; k <= e; k++) chars[k] = "";
|
|
765
765
|
}
|
|
@@ -771,7 +771,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
771
771
|
const ROMAN = /^[IⅠ-Ⅲ]$/, LATIN = /[A-Za-z]$/;
|
|
772
772
|
for (let i = 0; i < chars.length; i++) {
|
|
773
773
|
if (chars[i] !== "1" || /[\dA-Za-z]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || /^[\dA-Za-z,]/.test(_nullishCoalesce(chars[i + 1], () => ( "")))) continue;
|
|
774
|
-
if (
|
|
774
|
+
if (_chunkHJGKVI7Dcjs.serifOne.call(void 0, gray, w, h, ink, cx(i))) chars[i] = "\u2160";
|
|
775
775
|
}
|
|
776
776
|
for (let i = 0; i < chars.length; i++) {
|
|
777
777
|
const hangul = /^[파피]$/.test(chars[i]);
|
|
@@ -781,13 +781,13 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
781
781
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
782
782
|
const glued = hangul ? chars[p] === "(" && chars[q] === "-" : /[가-힣]$/.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || (_nullishCoalesce(chars[i + 1], () => ( ""))) === "." || chars[p] === "-" && chars[q] === "-";
|
|
783
783
|
if (!glued) continue;
|
|
784
|
-
const n =
|
|
784
|
+
const n = _chunkHJGKVI7Dcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
|
|
785
785
|
if (n) chars[i] = String.fromCharCode(8543 + n);
|
|
786
786
|
}
|
|
787
787
|
const inRoman = (i) => ROMAN.test(chars[i]) || chars[i] === "1" && (ROMAN.test(_nullishCoalesce(chars[i - 1], () => ( ""))) || ROMAN.test(_nullishCoalesce(chars[i + 1], () => ( ""))));
|
|
788
788
|
const k = chars.findIndex((c) => c.trim());
|
|
789
789
|
if (chars[k] === "." && chars.slice(k + 1).some((c) => /[가-힣A-Za-z0-9]/.test(c))) {
|
|
790
|
-
const n =
|
|
790
|
+
const n = _chunkHJGKVI7Dcjs.romanStems.call(void 0, gray, w, h, ink, -Infinity, cx(k));
|
|
791
791
|
if (n) chars[k] = String.fromCharCode(8543 + n) + chars[k];
|
|
792
792
|
}
|
|
793
793
|
for (let s = 0; s < chars.length; ) {
|
|
@@ -805,7 +805,7 @@ function roman({ chars, cx, gray, w, h, ink }) {
|
|
|
805
805
|
let p = s - 1, q = e;
|
|
806
806
|
while (p >= 0 && !chars[p].trim()) p--;
|
|
807
807
|
while (q < chars.length && !chars[q].trim()) q++;
|
|
808
|
-
const n =
|
|
808
|
+
const n = _chunkHJGKVI7Dcjs.romanStems.call(void 0, gray, w, h, ink, p >= 0 ? cx(p) : -Infinity, q < chars.length ? cx(q) : Infinity, /[가-힣]$/.test(_nullishCoalesce(chars[p], () => ( ""))));
|
|
809
809
|
const canon = n ? [["\u2160", "I"], ["\u2161", "II"], ["\u2162", "III"]][n - 1] : null;
|
|
810
810
|
if (canon && !canon.includes(tok)) {
|
|
811
811
|
chars[s] = canon[0];
|
|
@@ -967,10 +967,10 @@ function bandBoxes(b, bands, pageH) {
|
|
|
967
967
|
}
|
|
968
968
|
return out;
|
|
969
969
|
}
|
|
970
|
-
function lineCrop(rgba, pageW, box, rot, keep) {
|
|
970
|
+
function lineCrop(rgba, pageW, box, rot, keep, stretch = 1) {
|
|
971
971
|
const srcW = rot === 0 ? box.w : box.h;
|
|
972
972
|
const srcH = rot === 0 ? box.h : box.w;
|
|
973
|
-
const rw = Math.min(REC_MAX_WIDTH, Math.max(16, Math.round(srcW * REC_HEIGHT / srcH)));
|
|
973
|
+
const rw = Math.min(REC_MAX_WIDTH, Math.max(16, Math.round(srcW * REC_HEIGHT * stretch / srcH)));
|
|
974
974
|
const rgb = new Uint8Array(rw * REC_HEIGHT * 3);
|
|
975
975
|
const at = (u, v) => {
|
|
976
976
|
let px, py;
|
|
@@ -1062,6 +1062,14 @@ var DEFAULT_OCR_TUNING = Object.freeze({
|
|
|
1062
1062
|
orientPage: true
|
|
1063
1063
|
});
|
|
1064
1064
|
var DET_MIN_SIZE = 3;
|
|
1065
|
+
var NUMBER_STRETCH = [1.6, 2.2];
|
|
1066
|
+
function badThousands(text) {
|
|
1067
|
+
for (const m of text.matchAll(/(?<![\d.,])\d+(?:,\d*)*,\d+(?![\d,])/g)) {
|
|
1068
|
+
const [head, ...rest] = m[0].split(",");
|
|
1069
|
+
if (head.length > 3 || rest.some((g) => g.length !== 3)) return true;
|
|
1070
|
+
}
|
|
1071
|
+
return false;
|
|
1072
|
+
}
|
|
1065
1073
|
var DET_MAX_BOXES = 3e3;
|
|
1066
1074
|
var REC_MIN_WIDTH = 320;
|
|
1067
1075
|
var REC_BATCH_MAX_PIXELS = 48 * 16e3;
|
|
@@ -1186,8 +1194,8 @@ function joinGapLeaders(rgba, width, items) {
|
|
|
1186
1194
|
if (g1 - g0 < h * 3) continue;
|
|
1187
1195
|
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));
|
|
1188
1196
|
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 };
|
|
1189
|
-
const gray =
|
|
1190
|
-
const runs =
|
|
1197
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, box);
|
|
1198
|
+
const runs = _chunkHJGKVI7Dcjs.leaderRuns.call(void 0, gray, box.w, box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, gray), LEADER_MIN_DOTS);
|
|
1191
1199
|
const cover = runs.reduce((k, [a, b]) => k + Math.max(0, Math.min(b, g1 - box.x) - Math.max(a, g0 - box.x)), 0);
|
|
1192
1200
|
if (cover < (g1 - g0) * 0.6) continue;
|
|
1193
1201
|
for (const o of items) if (junk(o) && sameLine(o, num) && o.x >= g0 - 2 && o.x + o.w <= g1 + 2) gone.add(o);
|
|
@@ -1454,7 +1462,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1454
1462
|
this.ort = parts.ort;
|
|
1455
1463
|
this.sharp = parts.sharp;
|
|
1456
1464
|
}
|
|
1457
|
-
static async create(models =
|
|
1465
|
+
static async create(models = _chunkHJGKVI7Dcjs.DEFAULT_OCR_MODELS) {
|
|
1458
1466
|
_chunkTK3FDAEEcjs.disableOrtTelemetry.call(void 0, );
|
|
1459
1467
|
const [ortMod, sharpModRaw] = await Promise.all([
|
|
1460
1468
|
tryImport("onnxruntime-node", () => Promise.resolve().then(() => _interopRequireWildcard(require("onnxruntime-node")))),
|
|
@@ -1474,16 +1482,16 @@ var OcrEngine = class _OcrEngine {
|
|
|
1474
1482
|
const local = (s) => "spec" in s ? Promise.resolve(null) : verifiedBytes(s);
|
|
1475
1483
|
const [detBytes, recBytes, dictBytes] = await Promise.all([local(models.det), local(models.rec), local(models.dict)]);
|
|
1476
1484
|
const session = (s, bytes) => bytes ? ortMod.InferenceSession.create(bytes, sessionOpts).catch(() => {
|
|
1477
|
-
throw new (0,
|
|
1478
|
-
}) : ortMod.InferenceSession.create(
|
|
1485
|
+
throw new (0, _chunkJZEMASGRcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkHJGKVI7Dcjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
|
|
1486
|
+
}) : ortMod.InferenceSession.create(_chunkHJGKVI7Dcjs.ocrSourcePath.call(void 0, s), sessionOpts);
|
|
1479
1487
|
const [det, rec, dictYml] = await Promise.all([
|
|
1480
1488
|
session(models.det, detBytes),
|
|
1481
1489
|
session(models.rec, recBytes),
|
|
1482
|
-
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0,
|
|
1490
|
+
dictBytes ? new TextDecoder().decode(dictBytes) : _promises.readFile.call(void 0, _chunkHJGKVI7Dcjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
|
|
1483
1491
|
]);
|
|
1484
|
-
const dict =
|
|
1492
|
+
const dict = _chunkHJGKVI7Dcjs.parseCharacterDict.call(void 0, dictYml);
|
|
1485
1493
|
if (dict.length === 0) {
|
|
1486
|
-
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,
|
|
1494
|
+
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, _chunkJZEMASGRcjs.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`);
|
|
1487
1495
|
}
|
|
1488
1496
|
return new _OcrEngine({ det, rec, dict, ort: ortMod, sharp: sharpMod });
|
|
1489
1497
|
}
|
|
@@ -1515,10 +1523,10 @@ var OcrEngine = class _OcrEngine {
|
|
|
1515
1523
|
if (it.x - x < it.h * 0.8) return;
|
|
1516
1524
|
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;
|
|
1517
1525
|
const box = { x, y: it.y, w: it.x + it.w - x, h: it.h };
|
|
1518
|
-
const g =
|
|
1519
|
-
const b =
|
|
1526
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, box);
|
|
1527
|
+
const b = _chunkHJGKVI7Dcjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g), it.x - x, 1.05);
|
|
1520
1528
|
if (_optionalChain([b, 'optionalAccess', _32 => _32.mark]) !== "\u25A1" || b.covers) return;
|
|
1521
|
-
const ink =
|
|
1529
|
+
const ink = _chunkHJGKVI7Dcjs.inkStats.call(void 0, g), on = (v) => ink.darkInk ? v <= ink.threshold : v > ink.threshold;
|
|
1522
1530
|
let left = 0;
|
|
1523
1531
|
while (left < it.x - x && !Array.from({ length: box.h }, (_, y) => g[y * box.w + left]).some(on)) left++;
|
|
1524
1532
|
it.text = "\u25A1 " + it.text;
|
|
@@ -1550,12 +1558,12 @@ var OcrEngine = class _OcrEngine {
|
|
|
1550
1558
|
const joins = [];
|
|
1551
1559
|
let group = 0;
|
|
1552
1560
|
for (const b of boxes) {
|
|
1553
|
-
const gray =
|
|
1554
|
-
const ink =
|
|
1561
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, b);
|
|
1562
|
+
const ink = _chunkHJGKVI7Dcjs.inkStats.call(void 0, gray);
|
|
1555
1563
|
if (tuning.minInkContrast > 0 && ink.contrast < tuning.minInkContrast) continue;
|
|
1556
1564
|
if (tuning.minInkContrast > 0 && ink.inkRatio < MIN_INK_RATIO) continue;
|
|
1557
1565
|
if (tuning.splitTall && b.h >= b.w * TALL_RATIO) {
|
|
1558
|
-
const bands =
|
|
1566
|
+
const bands = _chunkHJGKVI7Dcjs.splitRowBands.call(void 0, gray, b.w, b.h, ink, 0.45);
|
|
1559
1567
|
if (bands.length >= 2) {
|
|
1560
1568
|
for (const sub of bandBoxes(b, bands, height)) jobs.push({ box: sub, rot: 0, group: group++ });
|
|
1561
1569
|
continue;
|
|
@@ -1566,9 +1574,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
1566
1574
|
continue;
|
|
1567
1575
|
}
|
|
1568
1576
|
}
|
|
1569
|
-
const trim = tuning.trimEdges ?
|
|
1577
|
+
const trim = tuning.trimEdges ? _chunkHJGKVI7Dcjs.edgeTrim.call(void 0, gray, b.w, b.h, ink) : null;
|
|
1570
1578
|
const keep = trim ? { ...trim, bg: median(gray) } : void 0;
|
|
1571
|
-
const leaders = tuning.splitLeaders ?
|
|
1579
|
+
const leaders = tuning.splitLeaders ? _chunkHJGKVI7Dcjs.leaderRuns.call(void 0, gray, b.w, b.h, ink, LEADER_MIN_DOTS) : [];
|
|
1572
1580
|
if (leaders.length) {
|
|
1573
1581
|
const join = joins.length;
|
|
1574
1582
|
joins.push({ box: b, parts: [], trailDots: false });
|
|
@@ -1577,7 +1585,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1577
1585
|
const bare = { x: b.x + x0, y: b.y, w: a - x0, h: b.h };
|
|
1578
1586
|
const end = c > a ? Math.min(c, a + Math.round(b.h * LEADER_CONTEXT)) : a;
|
|
1579
1587
|
x0 = c;
|
|
1580
|
-
if (bare.w >= DET_MIN_SIZE &&
|
|
1588
|
+
if (bare.w >= DET_MIN_SIZE && _chunkHJGKVI7Dcjs.inkStats.call(void 0, _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, bare)).contrast >= Math.max(1, tuning.minInkContrast)) {
|
|
1581
1589
|
jobs.push({ box: { ...bare, w: end - (bare.x - b.x) }, rot: 0, group: group++, join, dotsBefore: dots, trimDots: end > a });
|
|
1582
1590
|
dots = false;
|
|
1583
1591
|
}
|
|
@@ -1606,6 +1614,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1606
1614
|
if (r.text.replace(/\s/g, "") === "\xB7" + b && /^[가-힣]/.test(b)) best.set(job.group, { ...cur, text: "\xB7" + cur.text, steps: [r.steps[0], ...cur.steps] });
|
|
1607
1615
|
});
|
|
1608
1616
|
let items = [];
|
|
1617
|
+
const boxOf = /* @__PURE__ */ new Map();
|
|
1609
1618
|
const retry = [];
|
|
1610
1619
|
for (const r of best.values()) {
|
|
1611
1620
|
const { job, confidence, stepPx } = r;
|
|
@@ -1615,15 +1624,15 @@ var OcrEngine = class _OcrEngine {
|
|
|
1615
1624
|
let text = tuning.postprocess ? restoreSymbols(raw.trim(), note.ringLead) : raw;
|
|
1616
1625
|
if (!text.trim()) continue;
|
|
1617
1626
|
if (tuning.postprocess && job.rot === 0 && text !== "/" && /^[(:;/)]+$/.test(text) && text.includes("/")) {
|
|
1618
|
-
const g =
|
|
1619
|
-
if (
|
|
1627
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1628
|
+
if (_chunkHJGKVI7Dcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g)) === 1) text = "/";
|
|
1620
1629
|
}
|
|
1621
1630
|
let ringByShape = false;
|
|
1622
1631
|
if (tuning.postprocess && job.rot === 0 && !/^[◎●▪□■▣❐❏○ㅇ◆◇◈]/.test(text)) {
|
|
1623
1632
|
const chars = [...read], k = chars.findIndex((c) => c.trim());
|
|
1624
1633
|
if (k >= 0 && steps.length === chars.length) {
|
|
1625
|
-
const g =
|
|
1626
|
-
const b =
|
|
1634
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1635
|
+
const b = _chunkHJGKVI7Dcjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx);
|
|
1627
1636
|
const body = (_nullishCoalesce(text.match(/[가-힣]/g), () => ( []))).length >= 4;
|
|
1628
1637
|
const miss = /^[Oo0•·ㆍ∙‧○]/.test(text);
|
|
1629
1638
|
if (_optionalChain([b, 'optionalAccess', _35 => _35.mark]) === "\u25CE" && b.covers && /^[Oo0○©]/.test(text)) {
|
|
@@ -1638,17 +1647,17 @@ var OcrEngine = class _OcrEngine {
|
|
|
1638
1647
|
} else if (_optionalChain([b, 'optionalAccess', _42 => _42.mark]) === "\u2750" || _optionalChain([b, 'optionalAccess', _43 => _43.mark]) === "\u274F") {
|
|
1639
1648
|
if (b.covers ? /^[ㅁ口]/.test(text) : body) text = b.covers ? b.mark + text.slice(1) : b.mark + " " + text;
|
|
1640
1649
|
} else if (b && b.mark !== "\u25CE" && body) text = b.covers ? miss ? b.mark + " " + text.slice(1).trimStart() : text : b.mark + " " + text;
|
|
1641
|
-
else if (!b && body && /^[가-힣]/.test(chars[k]) &&
|
|
1650
|
+
else if (!b && body && /^[가-힣]/.test(chars[k]) && _chunkHJGKVI7Dcjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g), (steps[k] + 0.5) * stepPx)) text = "\u25CB " + text;
|
|
1642
1651
|
}
|
|
1643
1652
|
}
|
|
1644
1653
|
if (tuning.postprocess && /^\d/.test(text) && job.rot === 0) {
|
|
1645
|
-
const g =
|
|
1646
|
-
const tri =
|
|
1654
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1655
|
+
const tri = _chunkHJGKVI7Dcjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g));
|
|
1647
1656
|
if (tri) text = tri + text;
|
|
1648
1657
|
}
|
|
1649
1658
|
if (tuning.postprocess && text === "\u2192" && job.rot === 0 && job.join === void 0) {
|
|
1650
|
-
const g =
|
|
1651
|
-
text = _nullishCoalesce(
|
|
1659
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
1660
|
+
text = _nullishCoalesce(_chunkHJGKVI7Dcjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g)), () => ( text));
|
|
1652
1661
|
}
|
|
1653
1662
|
if (job.footer) {
|
|
1654
1663
|
if (!/^[-\u2013\u2014]?\s*(?:\d{1,4}|[ivxIVXⅰ-ⅹⅠ-Ⅹ]{1,4})\s*[-\u2013\u2014]?$/.test(text.trim())) continue;
|
|
@@ -1669,14 +1678,27 @@ var OcrEngine = class _OcrEngine {
|
|
|
1669
1678
|
continue;
|
|
1670
1679
|
}
|
|
1671
1680
|
const item = { text, ...this.itemBox(rgba, width, job.box, tuning), confidence };
|
|
1672
|
-
if (job.rot === 0)
|
|
1681
|
+
if (job.rot === 0) _chunkHJGKVI7Dcjs.rememberOcrTextGaps.call(void 0, item, _chunkHJGKVI7Dcjs.findOcrTextGaps.call(void 0, rgba, width, job.box, read, text, steps, stepPx));
|
|
1682
|
+
if (job.rot === 0 && job.keep === void 0) boxOf.set(item, job.box);
|
|
1673
1683
|
items.push(item);
|
|
1674
1684
|
}
|
|
1685
|
+
for (const stretch of tuning.postprocess ? NUMBER_STRETCH : []) {
|
|
1686
|
+
const fix = items.filter((it) => boxOf.has(it) && /^[-−(△▲]?\d[\d,]*\)?$/.test(it.text.trim()) && badThousands(it.text));
|
|
1687
|
+
if (!fix.length) break;
|
|
1688
|
+
const res = await this.recognizeJobs(rgba, width, fix.map((it, k) => ({ box: boxOf.get(it), rot: 0, group: k, stretch })), tuning.recBatch);
|
|
1689
|
+
const skeleton = (t) => t.replace(/[\d,\s]/g, "");
|
|
1690
|
+
fix.forEach((it, k) => {
|
|
1691
|
+
const r = res[k];
|
|
1692
|
+
if (!r || /\s/.test(r.text.trim()) || badThousands(r.text) || r.confidence < it.confidence - 0.05 || skeleton(r.text) !== skeleton(it.text)) return;
|
|
1693
|
+
it.text = restoreSymbols(r.text.trim());
|
|
1694
|
+
_chunkHJGKVI7Dcjs.rememberOcrTextGaps.call(void 0, it, _chunkHJGKVI7Dcjs.findOcrTextGaps.call(void 0, rgba, width, boxOf.get(it), r.text, it.text, r.steps, r.stepPx));
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1675
1697
|
if (retry.length) {
|
|
1676
1698
|
const subs = [];
|
|
1677
1699
|
for (const b of retry) {
|
|
1678
|
-
const gray =
|
|
1679
|
-
const cut = midBlankRow(gray, b.w, b.h,
|
|
1700
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, b);
|
|
1701
|
+
const cut = midBlankRow(gray, b.w, b.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, gray));
|
|
1680
1702
|
if (cut && b.w >= 3 * Math.max(cut[0], b.h - cut[1])) subs.push({ ...b, h: cut[0] }, { ...b, y: b.y + cut[1], h: b.h - cut[1] });
|
|
1681
1703
|
}
|
|
1682
1704
|
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));
|
|
@@ -1739,8 +1761,8 @@ var OcrEngine = class _OcrEngine {
|
|
|
1739
1761
|
/** 결과 좌표 — det 박스 그대로 또는 박스 안 잉크 외곽 (tightBoxes) */
|
|
1740
1762
|
itemBox(rgba, width, b, tuning) {
|
|
1741
1763
|
if (!tuning.tightBoxes) return b;
|
|
1742
|
-
const gray =
|
|
1743
|
-
const t =
|
|
1764
|
+
const gray = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, width, b);
|
|
1765
|
+
const t = _chunkHJGKVI7Dcjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, gray));
|
|
1744
1766
|
return { x: b.x + t.x0, y: b.y + t.y0, w: t.x1 - t.x0, h: t.y1 - t.y0 };
|
|
1745
1767
|
}
|
|
1746
1768
|
// ─── det ─────────────────────────────────────────────
|
|
@@ -1783,7 +1805,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1783
1805
|
// ─── rec ─────────────────────────────────────────────
|
|
1784
1806
|
/** 라인 작업들을 폭 비율 순으로 배치 인식 — 결과는 jobs 순서 */
|
|
1785
1807
|
async recognizeJobs(rgba, pageW, jobs, batchSize) {
|
|
1786
|
-
const crops = jobs.map((j) => lineCrop(rgba, pageW, j.box, j.rot, j.keep));
|
|
1808
|
+
const crops = jobs.map((j) => lineCrop(rgba, pageW, j.box, j.rot, j.keep, j.stretch));
|
|
1787
1809
|
const order = crops.map((_, i) => i).sort((a, b) => crops[a].w - crops[b].w);
|
|
1788
1810
|
const results = new Array(jobs.length).fill(null);
|
|
1789
1811
|
const plane = REC_HEIGHT;
|
|
@@ -1813,7 +1835,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
1813
1835
|
const out = await this.rec.run({ [this.rec.inputNames[0]]: tensor });
|
|
1814
1836
|
const logits = out[this.rec.outputNames[0]];
|
|
1815
1837
|
const [, T, C] = logits.dims;
|
|
1816
|
-
if (C !== this.dict.length + 2) throw new (0,
|
|
1838
|
+
if (C !== this.dict.length + 2) throw new (0, _chunkJZEMASGRcjs.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`);
|
|
1817
1839
|
const data = logits.data;
|
|
1818
1840
|
idx.forEach((ci, k) => {
|
|
1819
1841
|
const r = ctcDecode(data.subarray(k * T * C, (k + 1) * T * C), T, C, this.dict);
|
|
@@ -1823,9 +1845,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
1823
1845
|
const chars = r ? [...r.text] : [];
|
|
1824
1846
|
if (r && job.rot === 0 && chars.length === r.steps.length && r.steps.some((t) => t > last) && !r.text.includes("(cid:")) {
|
|
1825
1847
|
const tallCh = (c) => !/[\s.,:;\u00b7\u2026'"\u2018-\u201d`\-_~]/.test(c);
|
|
1826
|
-
const g =
|
|
1848
|
+
const g = _chunkHJGKVI7Dcjs.grayCrop.call(void 0, rgba, pageW, job.box);
|
|
1827
1849
|
const inside = chars.filter((c, i) => r.steps[i] <= last && tallCh(c)).length;
|
|
1828
|
-
let budget = inside <= 2 ?
|
|
1850
|
+
let budget = inside <= 2 ? _chunkHJGKVI7Dcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkHJGKVI7Dcjs.inkStats.call(void 0, g)) - inside : Infinity;
|
|
1829
1851
|
const keep = chars.map((c, i) => r.steps[i] <= last || !tallCh(c) || budget-- > 0);
|
|
1830
1852
|
if (!keep.every(Boolean)) kept = { ...r, text: chars.filter((_, i) => keep[i]).join(""), steps: r.steps.filter((_, i) => keep[i]) };
|
|
1831
1853
|
}
|
|
@@ -1936,13 +1958,13 @@ async function tryImport(name, loader) {
|
|
|
1936
1958
|
return await loader();
|
|
1937
1959
|
} catch (e) {
|
|
1938
1960
|
throw new Error(
|
|
1939
|
-
`\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.${
|
|
1961
|
+
`\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.${_chunkJZEMASGRcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
1940
1962
|
);
|
|
1941
1963
|
}
|
|
1942
1964
|
}
|
|
1943
1965
|
async function verifiedBytes(s) {
|
|
1944
1966
|
const name = _path.basename.call(void 0, s.file.path);
|
|
1945
|
-
const fail = (why2) => new (0,
|
|
1967
|
+
const fail = (why2) => new (0, _chunkJZEMASGRcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
|
|
1946
1968
|
const why = (e) => {
|
|
1947
1969
|
const code = e.code;
|
|
1948
1970
|
return code === "ENOENT" ? "\uD30C\uC77C\uC774 \uC5C6\uC74C" : code === "EACCES" || code === "EPERM" ? "\uAD8C\uD55C \uC5C6\uC74C" : "\uC77D\uAE30 \uC2E4\uD328";
|
|
@@ -1963,13 +1985,13 @@ async function verifiedBytes(s) {
|
|
|
1963
1985
|
}
|
|
1964
1986
|
const actual = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex");
|
|
1965
1987
|
if (actual !== s.file.sha256) {
|
|
1966
|
-
throw new (0,
|
|
1988
|
+
throw new (0, _chunkJZEMASGRcjs.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)`);
|
|
1967
1989
|
}
|
|
1968
1990
|
return bytes;
|
|
1969
1991
|
}
|
|
1970
1992
|
var engines = /* @__PURE__ */ new Map();
|
|
1971
|
-
function getOcrEngine(models =
|
|
1972
|
-
const key =
|
|
1993
|
+
function getOcrEngine(models = _chunkHJGKVI7Dcjs.DEFAULT_OCR_MODELS) {
|
|
1994
|
+
const key = _chunkHJGKVI7Dcjs.ocrSelectionKey.call(void 0, models);
|
|
1973
1995
|
let p = engines.get(key);
|
|
1974
1996
|
if (!p) {
|
|
1975
1997
|
p = OcrEngine.create(models).catch((err) => {
|
|
@@ -2086,15 +2108,15 @@ function rotateRgba(rgba, width, height, deg) {
|
|
|
2086
2108
|
var OCR_RENDER_SCALE = 3;
|
|
2087
2109
|
var MAX_OCR_PIXELS = 24e6;
|
|
2088
2110
|
var PAGE_TIMEOUT_MS = 12e4;
|
|
2089
|
-
var DEFAULT_BUILTIN_OCR = Object.freeze({ models:
|
|
2111
|
+
var DEFAULT_BUILTIN_OCR = Object.freeze({ models: _chunkHJGKVI7Dcjs.DEFAULT_OCR_MODELS, tuning: DEFAULT_OCR_TUNING });
|
|
2090
2112
|
function builtinOcrConfig(o) {
|
|
2091
2113
|
if (!o || o.ocrDet === void 0 && o.ocrDetLongSide === void 0 && o.ocrRec === void 0 && o.ocrRecDict === void 0 && !o.ocrLines) return DEFAULT_BUILTIN_OCR;
|
|
2092
2114
|
const bad = _chunkZTN3T3GHcjs.validateOcrOptions.call(void 0, o);
|
|
2093
|
-
if (bad) throw new (0,
|
|
2094
|
-
const models =
|
|
2115
|
+
if (bad) throw new (0, _chunkJZEMASGRcjs.KordocError)(bad);
|
|
2116
|
+
const models = _chunkHJGKVI7Dcjs.resolveOcrModels.call(void 0, o);
|
|
2095
2117
|
return {
|
|
2096
2118
|
models,
|
|
2097
|
-
...o.ocrRec === "auto" ? { handwriting:
|
|
2119
|
+
...o.ocrRec === "auto" ? { handwriting: _chunkHJGKVI7Dcjs.handwritingFallbackModels.call(void 0, models) } : {},
|
|
2098
2120
|
tuning: o.ocrDetLongSide === void 0 ? DEFAULT_OCR_TUNING : { ...DEFAULT_OCR_TUNING, detLongSide: o.ocrDetLongSide },
|
|
2099
2121
|
lines: o.ocrLines === "all" ? "all" : o.ocrLines ? "kept" : void 0
|
|
2100
2122
|
};
|
|
@@ -2141,8 +2163,8 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
2141
2163
|
"@hyzyla/pdfium",
|
|
2142
2164
|
() => Promise.resolve().then(() => _interopRequireWildcard(require("@hyzyla/pdfium")))
|
|
2143
2165
|
);
|
|
2144
|
-
if (mode === "builtin") await
|
|
2145
|
-
if (mode === "builtin" && config.handwriting) await
|
|
2166
|
+
if (mode === "builtin") await _chunkHJGKVI7Dcjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
|
|
2167
|
+
if (mode === "builtin" && config.handwriting) await _chunkHJGKVI7Dcjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
|
|
2146
2168
|
const engine = mode === "builtin" ? await getOcrEngine(config.models) : null;
|
|
2147
2169
|
const pdfium = await pdfiumMod.PDFiumLibrary.init();
|
|
2148
2170
|
const doc = await pdfium.loadDocument(new Uint8Array(buffer));
|
|
@@ -2253,7 +2275,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
2253
2275
|
const x1 = r.x1 * scale - 2, x2 = r.x2 * scale + 2, y1 = (pdfH - r.y2) * scale - 2, y2 = (pdfH - r.y1) * scale + 2;
|
|
2254
2276
|
const columnRules = _nullishCoalesce(_optionalChain([ruling, 'optionalAccess', _67 => _67.verticals, 'access', _68 => _68.filter, 'call', _69 => _69((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', _70 => _70.length]), () => ( 0));
|
|
2255
2277
|
if (columnRules < 2) {
|
|
2256
|
-
for (const b of blocks) if (b.type === "table")
|
|
2278
|
+
for (const b of blocks) if (b.type === "table") _chunkHJGKVI7Dcjs.UNRULED_REGION_TABLES.add(b);
|
|
2257
2279
|
}
|
|
2258
2280
|
return blocks;
|
|
2259
2281
|
});
|
|
@@ -2312,7 +2334,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
2312
2334
|
const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
|
|
2313
2335
|
out.push(items.map((it) => {
|
|
2314
2336
|
const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
|
|
2315
|
-
|
|
2337
|
+
_chunkHJGKVI7Dcjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
|
|
2316
2338
|
return placed;
|
|
2317
2339
|
}));
|
|
2318
2340
|
}
|
|
@@ -2400,10 +2422,10 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
2400
2422
|
isHidden: false,
|
|
2401
2423
|
...xs[i].space ? { hasSpaceBefore: true } : {}
|
|
2402
2424
|
};
|
|
2403
|
-
|
|
2425
|
+
_chunkHJGKVI7Dcjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
|
|
2404
2426
|
return normalized;
|
|
2405
2427
|
}).filter((it) => it.text);
|
|
2406
|
-
const blocks = unframeOcrLayoutTables(splitStackedOcrRows(
|
|
2428
|
+
const blocks = unframeOcrLayoutTables(splitStackedOcrRows(_chunkHJGKVI7Dcjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables)), pdfH);
|
|
2407
2429
|
if (!figureRegion) markOcrHeadings(blocks);
|
|
2408
2430
|
return blocks;
|
|
2409
2431
|
}
|
|
@@ -2452,7 +2474,7 @@ async function tryImport2(name, loader) {
|
|
|
2452
2474
|
return await loader();
|
|
2453
2475
|
} catch (e) {
|
|
2454
2476
|
throw new Error(
|
|
2455
|
-
`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.${
|
|
2477
|
+
`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.${_chunkJZEMASGRcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
2456
2478
|
);
|
|
2457
2479
|
}
|
|
2458
2480
|
}
|
|
@@ -2503,4 +2525,4 @@ function bgraToRgba(bgra) {
|
|
|
2503
2525
|
|
|
2504
2526
|
|
|
2505
2527
|
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.groupOcrLines = groupOcrLines; exports.ocrItemsToBlocks = ocrItemsToBlocks; exports.markOcrHeadings = markOcrHeadings;
|
|
2506
|
-
//# sourceMappingURL=chunk-
|
|
2528
|
+
//# sourceMappingURL=chunk-TVMNTRPZ.cjs.map
|