kordoc 4.24.67 → 4.24.68
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 +3 -3
- package/dist/{-7TPBQODI.js → -C3Z3THPW.js} +21 -21
- package/dist/{chunk-73EKNKTF.js → chunk-25JUTBAL.js} +2 -2
- package/dist/{chunk-OMFCOSBY.js → chunk-2H3SMB3B.js} +2 -2
- package/dist/{chunk-K23AEIDZ.js → chunk-2XQVIGK7.js} +15 -15
- package/dist/{chunk-WGUANGGA.js → chunk-3SM5XU37.js} +11 -11
- package/dist/{chunk-OILA3YTC.js → chunk-4MK5F5XM.js} +2 -2
- package/dist/{chunk-7ULJRLAV.js → chunk-4WT36WX7.js} +6 -5
- package/dist/chunk-4WT36WX7.js.map +1 -0
- package/dist/{chunk-DHYKBCDL.js → chunk-7C43TGTB.js} +2 -2
- package/dist/{chunk-5Z2TRKU7.js → chunk-7KTAGV4D.js} +2 -2
- package/dist/{chunk-NOWCGRKY.js → chunk-7NWCE2VY.js} +2 -2
- package/dist/{chunk-4YLZR2X6.js → chunk-7OPTJUY6.js} +2 -2
- package/dist/{chunk-XV554HLH.js → chunk-A6SE2NST.js} +5 -5
- package/dist/{chunk-HHKGOBE2.js → chunk-AHTJBP7A.js} +5 -5
- package/dist/{chunk-L5GKQX4P.js → chunk-B4NHFT7B.js} +37 -12
- package/dist/chunk-B4NHFT7B.js.map +1 -0
- package/dist/{chunk-T7RMYBYP.js → chunk-BOT37FKF.js} +6 -6
- package/dist/{chunk-MT5WGKV7.cjs → chunk-D2ZQFQTZ.cjs} +58 -58
- package/dist/{chunk-MT5WGKV7.cjs.map → chunk-D2ZQFQTZ.cjs.map} +1 -1
- package/dist/{chunk-B4ILQPEH.js → chunk-DGCOC4B3.js} +2 -2
- package/dist/{chunk-OFWBSK6D.cjs → chunk-DINY7T2A.cjs} +90 -89
- package/dist/chunk-DINY7T2A.cjs.map +1 -0
- package/dist/{chunk-QZTECR6E.js → chunk-DP32H7VA.js} +2 -2
- package/dist/{chunk-GJMIO344.js → chunk-DXJVO26T.js} +2 -2
- package/dist/{chunk-WECXPIBP.js → chunk-ESYTMTTQ.js} +2 -2
- package/dist/{chunk-7TYITQPR.js → chunk-F77HKRWG.js} +2 -2
- package/dist/{chunk-Q2O6KEL3.js → chunk-FHXGNKTC.js} +2 -2
- package/dist/{chunk-FABG65BG.cjs → chunk-G3QRGL6T.cjs} +2 -2
- package/dist/{chunk-FABG65BG.cjs.map → chunk-G3QRGL6T.cjs.map} +1 -1
- package/dist/{chunk-4RRWKO2T.js → chunk-GBGOQMZZ.js} +3 -3
- package/dist/{chunk-FIR4AEWA.cjs → chunk-JBGCNNZA.cjs} +104 -104
- package/dist/{chunk-FIR4AEWA.cjs.map → chunk-JBGCNNZA.cjs.map} +1 -1
- package/dist/{chunk-E7QOWHAY.cjs → chunk-JML6QG4W.cjs} +58 -33
- package/dist/chunk-JML6QG4W.cjs.map +1 -0
- package/dist/{chunk-DUPB5XGN.js → chunk-KNF6YYYU.js} +7 -7
- package/dist/{chunk-SOAIESRF.js → chunk-PDHSRAP3.js} +5 -5
- package/dist/{chunk-FARHGCF2.js → chunk-POBE552D.js} +2 -2
- package/dist/{chunk-3Q7VWFSC.js → chunk-PSXEZILY.js} +2 -2
- package/dist/{chunk-LLQAB3SS.js → chunk-Q5AZNK6C.js} +6 -6
- package/dist/{chunk-3AEPELHI.js → chunk-RA7VOKUV.js} +10 -10
- package/dist/{chunk-TYE5W7RJ.js → chunk-RHSDQW7H.js} +2 -2
- package/dist/{chunk-NMRQGQML.js → chunk-TCBLXD5Z.js} +5 -4
- package/dist/chunk-TCBLXD5Z.js.map +1 -0
- package/dist/{chunk-HFER3UG6.js → chunk-TIY2QIIQ.js} +36 -11
- package/dist/chunk-TIY2QIIQ.js.map +1 -0
- package/dist/{chunk-MKDM6JB4.js → chunk-TULFOJIC.js} +2 -2
- package/dist/{chunk-HY3O6EDL.cjs → chunk-UNIU4XVK.cjs} +3 -3
- package/dist/{chunk-HY3O6EDL.cjs.map → chunk-UNIU4XVK.cjs.map} +1 -1
- package/dist/{chunk-SBJ4MJDD.js → chunk-UY5H3KON.js} +2 -2
- package/dist/{chunk-ZT2YHDRX.js → chunk-VKWYRBL6.js} +3 -3
- package/dist/{chunk-UXWQYWSJ.cjs → chunk-VX2GENK3.cjs} +3 -3
- package/dist/{chunk-UXWQYWSJ.cjs.map → chunk-VX2GENK3.cjs.map} +1 -1
- package/dist/{chunk-6RA4KZHK.cjs → chunk-XOLLE5G3.cjs} +8 -8
- package/dist/{chunk-6RA4KZHK.cjs.map → chunk-XOLLE5G3.cjs.map} +1 -1
- package/dist/{chunk-FYAFEINW.js → chunk-Y4YFLUC6.js} +2 -2
- package/dist/{chunk-JS6P3636.js → chunk-ZKZ2UTYE.js} +3 -3
- package/dist/chunks-4U3V27R4.js +11 -0
- package/dist/cli.js +45 -45
- package/dist/{formula-7ZWQ6LS2.js → formula-6QJJJHSW.js} +3 -3
- package/dist/{formula-OKSR2NJY.js → formula-FCSNTVTN.js} +4 -4
- package/dist/{formula-2IC5OKZ6.cjs → formula-YDHML7KV.cjs} +9 -9
- package/dist/{formula-2IC5OKZ6.cjs.map → formula-YDHML7KV.cjs.map} +1 -1
- package/dist/generator-A4BSUBIF.cjs +12 -0
- package/dist/{generator-6YIOSSFN.cjs.map → generator-A4BSUBIF.cjs.map} +1 -1
- package/dist/generator-AQQJF5AX.js +11 -0
- package/dist/generator-NDAH7PF2.js +18 -0
- package/dist/{hancom-RM65BNHD.cjs → hancom-5OM37MHT.cjs} +5 -5
- package/dist/{hancom-RM65BNHD.cjs.map → hancom-5OM37MHT.cjs.map} +1 -1
- package/dist/{hancom-PBWLHPG6.js → hancom-6JKBAIRT.js} +2 -2
- package/dist/{hancom-42PJQLYF.js → hancom-X3KIP53O.js} +2 -2
- package/dist/{image-ocr-B32JZFLP.js → image-ocr-KZRXKJMH.js} +7 -7
- package/dist/{image-ocr-S4U3UXRJ.js → image-ocr-WMPZGPVU.js} +10 -10
- package/dist/{image-ocr-IIPN7IH6.cjs → image-ocr-XVO6VQ4T.cjs} +28 -28
- package/dist/{image-ocr-IIPN7IH6.cjs.map → image-ocr-XVO6VQ4T.cjs.map} +1 -1
- package/dist/index.cjs +1115 -1115
- package/dist/index.js +9 -9
- package/dist/mcp.js +36 -36
- package/dist/memo-N2VIHKQV.js +17 -0
- package/dist/{model-bundle-MJJ73AEH.js → model-bundle-PTUSKXM7.js} +5 -5
- package/dist/{models-G4JXJ2ON.js → models-VMDK2FPC.js} +5 -5
- package/dist/{parse-worker-v2-TLTNAXAZ.js → parse-worker-v2-X7R7JGJE.js} +22 -22
- package/dist/{parser-YQA3F7IL.js → parser-7MJGTPTB.js} +12 -12
- package/dist/{parser-OXRSENMG.cjs → parser-7O2CD2FX.cjs} +166 -166
- package/dist/{parser-OXRSENMG.cjs.map → parser-7O2CD2FX.cjs.map} +1 -1
- package/dist/{parser-TWCVEECS.js → parser-WEB75HUE.js} +9 -9
- package/dist/{pdf-ocr-2BQ4ME6Y.js → pdf-ocr-CBWYKT43.js} +6 -6
- package/dist/{pdf-ocr-BA5LM535.js → pdf-ocr-GLQACPYG.js} +9 -9
- package/dist/pdf-ocr-IT45EFQV.cjs +43 -0
- package/dist/{pdf-ocr-GKN76Y2W.cjs.map → pdf-ocr-IT45EFQV.cjs.map} +1 -1
- package/dist/{profile-io-PBYC4MTQ.js → profile-io-M3CK3YS6.js} +3 -3
- package/dist/{rasterize-B3H32G23.js → rasterize-7JCIQHNF.js} +3 -3
- package/dist/{redact-doc-QY7DXOQE.js → redact-doc-WJ37S2DZ.js} +21 -21
- package/dist/{render-SRJ6ZIYE.js → render-XVFZPD2F.js} +12 -12
- package/dist/{rewrite-fallback-WVGGZ2QV.js → rewrite-fallback-R5TUFZC5.js} +13 -13
- package/dist/seal-VPCFF62R.js +16 -0
- package/dist/{setup-EHHJHPIQ.js → setup-OUMNLAPE.js} +3 -3
- package/dist/{to-hwpx-ESTHBOHH.js → to-hwpx-CEOJHYBE.js} +7 -7
- package/dist/to-hwpx-DLYI3ONA.cjs +16 -0
- package/dist/{to-hwpx-Y53M4SSD.cjs.map → to-hwpx-DLYI3ONA.cjs.map} +1 -1
- package/dist/{to-hwpx-BYNLZ2U3.js → to-hwpx-XGQCKSR2.js} +4 -4
- package/dist/visual-E3LJV7RT.js +38 -0
- package/dist/{watch-KJMMJVZ4.js → watch-U4BIQDKB.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-7ULJRLAV.js.map +0 -1
- package/dist/chunk-E7QOWHAY.cjs.map +0 -1
- package/dist/chunk-HFER3UG6.js.map +0 -1
- package/dist/chunk-L5GKQX4P.js.map +0 -1
- package/dist/chunk-NMRQGQML.js.map +0 -1
- package/dist/chunk-OFWBSK6D.cjs.map +0 -1
- package/dist/chunks-XSXJ7WHX.js +0 -11
- package/dist/generator-6YIOSSFN.cjs +0 -12
- package/dist/generator-GYR4PZAJ.js +0 -18
- package/dist/generator-HAJKBJRD.js +0 -11
- package/dist/memo-ZQOVJ7UJ.js +0 -17
- package/dist/pdf-ocr-GKN76Y2W.cjs +0 -43
- package/dist/seal-J7SSWMVR.js +0 -16
- package/dist/to-hwpx-Y53M4SSD.cjs +0 -16
- package/dist/visual-DVJGGPVU.js +0 -38
- /package/dist/{-7TPBQODI.js.map → -C3Z3THPW.js.map} +0 -0
- /package/dist/{chunk-73EKNKTF.js.map → chunk-25JUTBAL.js.map} +0 -0
- /package/dist/{chunk-OMFCOSBY.js.map → chunk-2H3SMB3B.js.map} +0 -0
- /package/dist/{chunk-K23AEIDZ.js.map → chunk-2XQVIGK7.js.map} +0 -0
- /package/dist/{chunk-WGUANGGA.js.map → chunk-3SM5XU37.js.map} +0 -0
- /package/dist/{chunk-OILA3YTC.js.map → chunk-4MK5F5XM.js.map} +0 -0
- /package/dist/{chunk-DHYKBCDL.js.map → chunk-7C43TGTB.js.map} +0 -0
- /package/dist/{chunk-5Z2TRKU7.js.map → chunk-7KTAGV4D.js.map} +0 -0
- /package/dist/{chunk-NOWCGRKY.js.map → chunk-7NWCE2VY.js.map} +0 -0
- /package/dist/{chunk-4YLZR2X6.js.map → chunk-7OPTJUY6.js.map} +0 -0
- /package/dist/{chunk-XV554HLH.js.map → chunk-A6SE2NST.js.map} +0 -0
- /package/dist/{chunk-HHKGOBE2.js.map → chunk-AHTJBP7A.js.map} +0 -0
- /package/dist/{chunk-T7RMYBYP.js.map → chunk-BOT37FKF.js.map} +0 -0
- /package/dist/{chunk-B4ILQPEH.js.map → chunk-DGCOC4B3.js.map} +0 -0
- /package/dist/{chunk-QZTECR6E.js.map → chunk-DP32H7VA.js.map} +0 -0
- /package/dist/{chunk-GJMIO344.js.map → chunk-DXJVO26T.js.map} +0 -0
- /package/dist/{chunk-WECXPIBP.js.map → chunk-ESYTMTTQ.js.map} +0 -0
- /package/dist/{chunk-7TYITQPR.js.map → chunk-F77HKRWG.js.map} +0 -0
- /package/dist/{chunk-Q2O6KEL3.js.map → chunk-FHXGNKTC.js.map} +0 -0
- /package/dist/{chunk-4RRWKO2T.js.map → chunk-GBGOQMZZ.js.map} +0 -0
- /package/dist/{chunk-DUPB5XGN.js.map → chunk-KNF6YYYU.js.map} +0 -0
- /package/dist/{chunk-SOAIESRF.js.map → chunk-PDHSRAP3.js.map} +0 -0
- /package/dist/{chunk-FARHGCF2.js.map → chunk-POBE552D.js.map} +0 -0
- /package/dist/{chunk-3Q7VWFSC.js.map → chunk-PSXEZILY.js.map} +0 -0
- /package/dist/{chunk-LLQAB3SS.js.map → chunk-Q5AZNK6C.js.map} +0 -0
- /package/dist/{chunk-3AEPELHI.js.map → chunk-RA7VOKUV.js.map} +0 -0
- /package/dist/{chunk-TYE5W7RJ.js.map → chunk-RHSDQW7H.js.map} +0 -0
- /package/dist/{chunk-MKDM6JB4.js.map → chunk-TULFOJIC.js.map} +0 -0
- /package/dist/{chunk-SBJ4MJDD.js.map → chunk-UY5H3KON.js.map} +0 -0
- /package/dist/{chunk-ZT2YHDRX.js.map → chunk-VKWYRBL6.js.map} +0 -0
- /package/dist/{chunk-FYAFEINW.js.map → chunk-Y4YFLUC6.js.map} +0 -0
- /package/dist/{chunk-JS6P3636.js.map → chunk-ZKZ2UTYE.js.map} +0 -0
- /package/dist/{chunks-XSXJ7WHX.js.map → chunks-4U3V27R4.js.map} +0 -0
- /package/dist/{formula-7ZWQ6LS2.js.map → formula-6QJJJHSW.js.map} +0 -0
- /package/dist/{formula-OKSR2NJY.js.map → formula-FCSNTVTN.js.map} +0 -0
- /package/dist/{generator-GYR4PZAJ.js.map → generator-AQQJF5AX.js.map} +0 -0
- /package/dist/{generator-HAJKBJRD.js.map → generator-NDAH7PF2.js.map} +0 -0
- /package/dist/{hancom-PBWLHPG6.js.map → hancom-6JKBAIRT.js.map} +0 -0
- /package/dist/{hancom-42PJQLYF.js.map → hancom-X3KIP53O.js.map} +0 -0
- /package/dist/{image-ocr-B32JZFLP.js.map → image-ocr-KZRXKJMH.js.map} +0 -0
- /package/dist/{image-ocr-S4U3UXRJ.js.map → image-ocr-WMPZGPVU.js.map} +0 -0
- /package/dist/{memo-ZQOVJ7UJ.js.map → memo-N2VIHKQV.js.map} +0 -0
- /package/dist/{model-bundle-MJJ73AEH.js.map → model-bundle-PTUSKXM7.js.map} +0 -0
- /package/dist/{models-G4JXJ2ON.js.map → models-VMDK2FPC.js.map} +0 -0
- /package/dist/{parse-worker-v2-TLTNAXAZ.js.map → parse-worker-v2-X7R7JGJE.js.map} +0 -0
- /package/dist/{parser-YQA3F7IL.js.map → parser-7MJGTPTB.js.map} +0 -0
- /package/dist/{parser-TWCVEECS.js.map → parser-WEB75HUE.js.map} +0 -0
- /package/dist/{pdf-ocr-2BQ4ME6Y.js.map → pdf-ocr-CBWYKT43.js.map} +0 -0
- /package/dist/{pdf-ocr-BA5LM535.js.map → pdf-ocr-GLQACPYG.js.map} +0 -0
- /package/dist/{profile-io-PBYC4MTQ.js.map → profile-io-M3CK3YS6.js.map} +0 -0
- /package/dist/{rasterize-B3H32G23.js.map → rasterize-7JCIQHNF.js.map} +0 -0
- /package/dist/{redact-doc-QY7DXOQE.js.map → redact-doc-WJ37S2DZ.js.map} +0 -0
- /package/dist/{render-SRJ6ZIYE.js.map → render-XVFZPD2F.js.map} +0 -0
- /package/dist/{rewrite-fallback-WVGGZ2QV.js.map → rewrite-fallback-R5TUFZC5.js.map} +0 -0
- /package/dist/{seal-J7SSWMVR.js.map → seal-VPCFF62R.js.map} +0 -0
- /package/dist/{setup-EHHJHPIQ.js.map → setup-OUMNLAPE.js.map} +0 -0
- /package/dist/{to-hwpx-BYNLZ2U3.js.map → to-hwpx-CEOJHYBE.js.map} +0 -0
- /package/dist/{to-hwpx-ESTHBOHH.js.map → to-hwpx-XGQCKSR2.js.map} +0 -0
- /package/dist/{visual-DVJGGPVU.js.map → visual-E3LJV7RT.js.map} +0 -0
- /package/dist/{watch-KJMMJVZ4.js.map → watch-U4BIQDKB.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
escapeHtml,
|
|
8
8
|
isGfmUrl,
|
|
9
9
|
sanitizeHref
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RHSDQW7H.js";
|
|
11
11
|
|
|
12
12
|
// src/table/builder.ts
|
|
13
13
|
var MAX_COLS = 200;
|
|
@@ -701,4 +701,4 @@ export {
|
|
|
701
701
|
hasInlineCellBlocks,
|
|
702
702
|
cellToMarkdown
|
|
703
703
|
};
|
|
704
|
-
//# sourceMappingURL=chunk-
|
|
704
|
+
//# sourceMappingURL=chunk-DGCOC4B3.js.map
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkJML6QG4Wcjs = require('./chunk-JML6QG4W.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 _chunkG3QRGL6Tcjs = require('./chunk-G3QRGL6T.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, pageW, box);
|
|
853
|
+
const rings = _chunkJML6QG4Wcjs.ringBoxes.call(void 0, gray, box.w, box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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: _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
956
|
+
if (f && _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
967
|
+
if (!f || f.ch < f.charH * 0.45 || _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i + 1 + end));
|
|
971
|
+
return !!g && _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.bracketFeatures.call(void 0, gray, w, h, ink, cx(i));
|
|
980
|
+
return f && _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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]) && _chunkJML6QG4Wcjs.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 } = _chunkJML6QG4Wcjs.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([_chunkJML6QG4Wcjs.leadingBullet.call(void 0, gray, w, h, ink, cx(live[0])), 'optionalAccess', _11 => _11.mark]) === "\u25CE") return false;
|
|
1127
|
+
if (!live.every((i) => _chunkJML6QG4Wcjs.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 (_chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 (_chunkJML6QG4Wcjs.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 (_chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, box);
|
|
1630
|
+
const runs = _chunkJML6QG4Wcjs.leaderRuns.call(void 0, gray, box.w, box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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, _chunkG3QRGL6Tcjs.KordocError)(`OCR \uBAA8\uB378\uC744 \uC5F4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${_path.basename.call(void 0, _chunkJML6QG4Wcjs.ocrSourcePath.call(void 0, s))} \u2014 ONNX \uBAA8\uB378\uC774 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB410\uC2B5\uB2C8\uB2E4`);
|
|
1934
|
+
}) : ortMod.InferenceSession.create(_chunkJML6QG4Wcjs.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, _chunkJML6QG4Wcjs.ocrSourcePath.call(void 0, models.dict), "utf-8")
|
|
1939
1939
|
]);
|
|
1940
|
-
const dict =
|
|
1940
|
+
const dict = _chunkJML6QG4Wcjs.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, _chunkG3QRGL6Tcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, box);
|
|
1975
|
+
const b = _chunkJML6QG4Wcjs.leadingBullet.call(void 0, g, box.w, box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, b);
|
|
2010
|
+
const ink = _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.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 ? _chunkJML6QG4Wcjs.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 ? _chunkJML6QG4Wcjs.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 && _chunkJML6QG4Wcjs.inkStats.call(void 0, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2099
|
+
if (_chunkJML6QG4Wcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2106
|
+
const b = _chunkJML6QG4Wcjs.leadingBullet.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.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]) && _chunkJML6QG4Wcjs.leadingRing.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2126
|
+
const tri = _chunkJML6QG4Wcjs.leadingTriangle.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, job.box);
|
|
2131
|
+
text = _nullishCoalesce(_chunkJML6QG4Wcjs.arrowGlyph.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.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) _chunkJML6QG4Wcjs.rememberOcrTextGaps.call(void 0, item, _chunkJML6QG4Wcjs.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
|
+
_chunkJML6QG4Wcjs.rememberOcrTextGaps.call(void 0, it, _chunkJML6QG4Wcjs.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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, b);
|
|
2198
|
+
const cut = _nullishCoalesce(midBlankRow(gray, b.w, b.h, _chunkJML6QG4Wcjs.inkStats.call(void 0, gray)), () => ( valleyRow(gray, b.w, b.h, _chunkJML6QG4Wcjs.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,14 +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 = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, b);
|
|
2220
|
+
const ink = _chunkJML6QG4Wcjs.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
|
+
if (cut && b.w >= (inCell ? 2 : 3) * Math.max(cut[0], b.h - cut[1])) {
|
|
2223
2224
|
subs.push({ ...b, h: cut[0] }, { ...b, y: b.y + cut[1], h: b.h - cut[1] });
|
|
2224
2225
|
continue;
|
|
2225
2226
|
}
|
|
2226
|
-
const bands =
|
|
2227
|
+
const bands = _chunkJML6QG4Wcjs.stackedGlyphBands.call(void 0, gray, b.w, b.h, ink);
|
|
2227
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)) });
|
|
2228
2229
|
}
|
|
2229
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));
|
|
@@ -2302,8 +2303,8 @@ var OcrEngine = class _OcrEngine {
|
|
|
2302
2303
|
/** 결과 좌표 — det 박스 그대로 또는 박스 안 잉크 외곽 (tightBoxes) */
|
|
2303
2304
|
itemBox(rgba, width, b, tuning) {
|
|
2304
2305
|
if (!tuning.tightBoxes) return b;
|
|
2305
|
-
const gray =
|
|
2306
|
-
const t =
|
|
2306
|
+
const gray = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, width, b);
|
|
2307
|
+
const t = _chunkJML6QG4Wcjs.inkBounds.call(void 0, gray, b.w, b.h, _chunkJML6QG4Wcjs.inkStats.call(void 0, gray));
|
|
2307
2308
|
return { x: b.x + t.x0, y: b.y + t.y0, w: t.x1 - t.x0, h: t.y1 - t.y0 };
|
|
2308
2309
|
}
|
|
2309
2310
|
// ─── det ─────────────────────────────────────────────
|
|
@@ -2374,7 +2375,7 @@ var OcrEngine = class _OcrEngine {
|
|
|
2374
2375
|
const out = await this.rec.run({ [this.rec.inputNames[0]]: tensor });
|
|
2375
2376
|
const logits = out[this.rec.outputNames[0]];
|
|
2376
2377
|
const [, T, C] = logits.dims;
|
|
2377
|
-
if (C !== this.dict.length + 2) throw new (0,
|
|
2378
|
+
if (C !== this.dict.length + 2) throw new (0, _chunkG3QRGL6Tcjs.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`);
|
|
2378
2379
|
const data = logits.data;
|
|
2379
2380
|
idx.forEach((ci, k) => {
|
|
2380
2381
|
const r = ctcDecode(data.subarray(k * T * C, (k + 1) * T * C), T, C, this.dict);
|
|
@@ -2384,9 +2385,9 @@ var OcrEngine = class _OcrEngine {
|
|
|
2384
2385
|
const chars = r ? [...r.text] : [];
|
|
2385
2386
|
if (r && job.rot === 0 && chars.length === r.steps.length && r.steps.some((t) => t > last) && !r.text.includes("(cid:")) {
|
|
2386
2387
|
const tallCh = (c) => !/[\s.,:;\u00b7\u2026'"\u2018-\u201d`\-_~]/.test(c);
|
|
2387
|
-
const g =
|
|
2388
|
+
const g = _chunkJML6QG4Wcjs.grayCrop.call(void 0, rgba, pageW, job.box);
|
|
2388
2389
|
const inside = chars.filter((c, i) => r.steps[i] <= last && tallCh(c)).length;
|
|
2389
|
-
let budget = inside <= 2 ?
|
|
2390
|
+
let budget = inside <= 2 ? _chunkJML6QG4Wcjs.tallInkCount.call(void 0, g, job.box.w, job.box.h, _chunkJML6QG4Wcjs.inkStats.call(void 0, g)) - inside : Infinity;
|
|
2390
2391
|
const keep = chars.map((c, i) => r.steps[i] <= last || !tallCh(c) || budget-- > 0);
|
|
2391
2392
|
if (!keep.every(Boolean)) kept = { ...r, text: chars.filter((_, i) => keep[i]).join(""), steps: r.steps.filter((_, i) => keep[i]) };
|
|
2392
2393
|
}
|
|
@@ -2497,13 +2498,13 @@ async function tryImport(name, loader) {
|
|
|
2497
2498
|
return await loader();
|
|
2498
2499
|
} catch (e) {
|
|
2499
2500
|
throw new Error(
|
|
2500
|
-
`\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.${_chunkG3QRGL6Tcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
2501
2502
|
);
|
|
2502
2503
|
}
|
|
2503
2504
|
}
|
|
2504
2505
|
async function verifiedBytes(s) {
|
|
2505
2506
|
const name = _path.basename.call(void 0, s.file.path);
|
|
2506
|
-
const fail = (why2) => new (0,
|
|
2507
|
+
const fail = (why2) => new (0, _chunkG3QRGL6Tcjs.KordocError)(`OCR \uBAA8\uB378 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${name} (${why2})`);
|
|
2507
2508
|
const why = (e) => {
|
|
2508
2509
|
const code = e.code;
|
|
2509
2510
|
return code === "ENOENT" ? "\uD30C\uC77C\uC774 \uC5C6\uC74C" : code === "EACCES" || code === "EPERM" ? "\uAD8C\uD55C \uC5C6\uC74C" : "\uC77D\uAE30 \uC2E4\uD328";
|
|
@@ -2524,13 +2525,13 @@ async function verifiedBytes(s) {
|
|
|
2524
2525
|
}
|
|
2525
2526
|
const actual = _crypto.createHash.call(void 0, "sha256").update(bytes).digest("hex");
|
|
2526
2527
|
if (actual !== s.file.sha256) {
|
|
2527
|
-
throw new (0,
|
|
2528
|
+
throw new (0, _chunkG3QRGL6Tcjs.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)`);
|
|
2528
2529
|
}
|
|
2529
2530
|
return bytes;
|
|
2530
2531
|
}
|
|
2531
2532
|
var engines = /* @__PURE__ */ new Map();
|
|
2532
|
-
function getOcrEngine(models =
|
|
2533
|
-
const key =
|
|
2533
|
+
function getOcrEngine(models = _chunkJML6QG4Wcjs.DEFAULT_OCR_MODELS) {
|
|
2534
|
+
const key = _chunkJML6QG4Wcjs.ocrSelectionKey.call(void 0, models);
|
|
2534
2535
|
let p = engines.get(key);
|
|
2535
2536
|
if (!p) {
|
|
2536
2537
|
p = OcrEngine.create(models).catch((err) => {
|
|
@@ -3006,20 +3007,20 @@ var REDETECT = { minDropped: 15, minShare: 0.15, scale: 5 / 3 };
|
|
|
3006
3007
|
var AUTO_REC = { pageConf: 0.9, gain: 0.06 };
|
|
3007
3008
|
var DEFAULT_AUTO_REC = { pageConf: 0.9, gain: 0.08, altConf: 0.95, sureGain: 0.1, minDiff: 0.08, minChars: 80, lazy: true };
|
|
3008
3009
|
var DEFAULT_BUILTIN_OCR = Object.freeze({
|
|
3009
|
-
models:
|
|
3010
|
+
models: _chunkJML6QG4Wcjs.DEFAULT_OCR_MODELS,
|
|
3010
3011
|
tuning: DEFAULT_OCR_TUNING,
|
|
3011
|
-
handwriting:
|
|
3012
|
+
handwriting: _chunkJML6QG4Wcjs.handwritingFallbackModels.call(void 0, _chunkJML6QG4Wcjs.DEFAULT_OCR_MODELS),
|
|
3012
3013
|
autoRec: DEFAULT_AUTO_REC
|
|
3013
3014
|
});
|
|
3014
3015
|
var DEFAULT_BUILTIN_OCR_FETCH = Object.freeze({ ...DEFAULT_BUILTIN_OCR, autoRec: { ...DEFAULT_AUTO_REC, fetch: true } });
|
|
3015
3016
|
function builtinOcrConfig(o) {
|
|
3016
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;
|
|
3017
3018
|
const bad = _chunkMMK32GPDcjs.validateOcrOptions.call(void 0, o);
|
|
3018
|
-
if (bad) throw new (0,
|
|
3019
|
-
const models =
|
|
3019
|
+
if (bad) throw new (0, _chunkG3QRGL6Tcjs.KordocError)(bad);
|
|
3020
|
+
const models = _chunkJML6QG4Wcjs.resolveOcrModels.call(void 0, o);
|
|
3020
3021
|
return {
|
|
3021
3022
|
models,
|
|
3022
|
-
...o.ocrRec === "auto" ? { handwriting:
|
|
3023
|
+
...o.ocrRec === "auto" ? { handwriting: _chunkJML6QG4Wcjs.handwritingFallbackModels.call(void 0, models), autoRec: AUTO_REC } : o.ocrRec === void 0 ? { handwriting: _chunkJML6QG4Wcjs.handwritingFallbackModels.call(void 0, models), autoRec: o.ocr ? { ...DEFAULT_AUTO_REC, fetch: true } : DEFAULT_AUTO_REC } : {},
|
|
3023
3024
|
tuning: o.ocrDetLongSide === void 0 ? DEFAULT_OCR_TUNING : { ...DEFAULT_OCR_TUNING, detLongSide: o.ocrDetLongSide },
|
|
3024
3025
|
lines: o.ocrLines === "all" ? "all" : o.ocrLines ? "kept" : void 0
|
|
3025
3026
|
};
|
|
@@ -3045,8 +3046,8 @@ async function withHandwritingRec(items, config, tuning, rgba, width, height, st
|
|
|
3045
3046
|
const altStats = { droppedLowConf: 0, ...stats.dropped ? { dropped: [] } : {} };
|
|
3046
3047
|
let alt;
|
|
3047
3048
|
try {
|
|
3048
|
-
if (auto.lazy && !auto.fetch && !await
|
|
3049
|
-
if (auto.lazy) await
|
|
3049
|
+
if (auto.lazy && !auto.fetch && !await _chunkJML6QG4Wcjs.ocrModelsCached.call(void 0, config.handwriting)) return items;
|
|
3050
|
+
if (auto.lazy) await _chunkJML6QG4Wcjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
|
|
3050
3051
|
alt = await (await getOcrEngine(config.handwriting)).recognizePage(rgba, width, height, altStats, tuning, cellRules, rowRules);
|
|
3051
3052
|
} catch (e) {
|
|
3052
3053
|
if (!auto.lazy) throw e;
|
|
@@ -3092,8 +3093,8 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
3092
3093
|
"@hyzyla/pdfium",
|
|
3093
3094
|
() => Promise.resolve().then(() => _interopRequireWildcard(require("@hyzyla/pdfium")))
|
|
3094
3095
|
);
|
|
3095
|
-
if (mode === "builtin") await
|
|
3096
|
-
if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await
|
|
3096
|
+
if (mode === "builtin") await _chunkJML6QG4Wcjs.ensureOcrModelsFor.call(void 0, config.models, reportModelDownload);
|
|
3097
|
+
if (mode === "builtin" && config.handwriting && !_optionalChain([config, 'access', _79 => _79.autoRec, 'optionalAccess', _80 => _80.lazy])) await _chunkJML6QG4Wcjs.ensureOcrModelsFor.call(void 0, config.handwriting, reportModelDownload);
|
|
3097
3098
|
const engine = mode === "builtin" ? await getOcrEngine(config.models) : null;
|
|
3098
3099
|
const pdfium = await pdfiumMod.PDFiumLibrary.init();
|
|
3099
3100
|
const doc = await pdfium.loadDocument(new Uint8Array(buffer));
|
|
@@ -3206,7 +3207,7 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
3206
3207
|
const x1 = r.x1 * scale - 2, x2 = r.x2 * scale + 2, y1 = (pdfH - r.y2) * scale - 2, y2 = (pdfH - r.y1) * scale + 2;
|
|
3207
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));
|
|
3208
3209
|
if (columnRules < 2) {
|
|
3209
|
-
for (const b of blocks) if (b.type === "table")
|
|
3210
|
+
for (const b of blocks) if (b.type === "table") _chunkJML6QG4Wcjs.UNRULED_REGION_TABLES.add(b);
|
|
3210
3211
|
}
|
|
3211
3212
|
return blocks;
|
|
3212
3213
|
});
|
|
@@ -3278,7 +3279,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
3278
3279
|
const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
|
|
3279
3280
|
out.push(items.map((it) => {
|
|
3280
3281
|
const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
|
|
3281
|
-
|
|
3282
|
+
_chunkJML6QG4Wcjs.copyOcrTextGaps.call(void 0, it, placed, 0.5, x0 / 2);
|
|
3282
3283
|
return placed;
|
|
3283
3284
|
}));
|
|
3284
3285
|
}
|
|
@@ -3370,7 +3371,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
3370
3371
|
isHidden: false,
|
|
3371
3372
|
...xs[i].space ? { hasSpaceBefore: true } : {}
|
|
3372
3373
|
};
|
|
3373
|
-
|
|
3374
|
+
_chunkJML6QG4Wcjs.copyOcrTextGaps.call(void 0, it, normalized, 1 / scale);
|
|
3374
3375
|
return normalized;
|
|
3375
3376
|
}).filter((it) => it.text);
|
|
3376
3377
|
if (_optionalChain([extraLines, 'optionalAccess', _96 => _96.verticals, 'access', _97 => _97.length]) && items.length) {
|
|
@@ -3386,7 +3387,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
3386
3387
|
})
|
|
3387
3388
|
};
|
|
3388
3389
|
}
|
|
3389
|
-
const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(
|
|
3390
|
+
const laid = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(_chunkJML6QG4Wcjs.extractPageBlocksWithLines.call(void 0, norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))))), pdfH);
|
|
3390
3391
|
const blocks = figureRegion ? laid : splitOcrProseRows(laid);
|
|
3391
3392
|
if (!figureRegion) markOcrHeadings(blocks);
|
|
3392
3393
|
return blocks;
|
|
@@ -3447,7 +3448,7 @@ async function tryImport2(name, loader) {
|
|
|
3447
3448
|
return await loader();
|
|
3448
3449
|
} catch (e) {
|
|
3449
3450
|
throw new Error(
|
|
3450
|
-
`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.${_chunkG3QRGL6Tcjs.OPTIONAL_DEP_INSTALL_HINT} \uC6D0\uC778: ${e.message}`
|
|
3451
3452
|
);
|
|
3452
3453
|
}
|
|
3453
3454
|
}
|
|
@@ -3500,4 +3501,4 @@ function bgraToRgba(bgra) {
|
|
|
3500
3501
|
|
|
3501
3502
|
|
|
3502
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;
|
|
3503
|
-
//# sourceMappingURL=chunk-
|
|
3504
|
+
//# sourceMappingURL=chunk-DINY7T2A.cjs.map
|