kordoc 4.24.42 → 4.24.44
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/{-4FV4UFBP.js → -H334XSXO.js} +21 -21
- package/dist/{chunk-NQJCR4W6.js → chunk-2FDWBF47.js} +2 -2
- package/dist/{chunk-SHJFHRDG.js → chunk-2KHZVNCS.js} +3 -3
- package/dist/{chunk-FGTG4IIL.js → chunk-2TJ4E6MT.js} +2 -2
- package/dist/{chunk-L5ETE5GI.js → chunk-3EBWTFBT.js} +2 -2
- package/dist/{chunk-4CGVUHGB.js → chunk-4Y5KRSHV.js} +3 -3
- package/dist/{chunk-MXBFGNEJ.js → chunk-6M2Z6QDD.js} +2 -2
- package/dist/{chunk-BJ6CKAQL.js → chunk-6ZYOH3TZ.js} +2 -2
- package/dist/{chunk-6BKH6JOD.js → chunk-7VVBR5WX.js} +99 -8
- package/dist/chunk-7VVBR5WX.js.map +1 -0
- package/dist/{chunk-N6AEYYEV.js → chunk-7W6G4EC7.js} +2 -2
- package/dist/{chunk-US34K54L.js → chunk-ABJ5DR2C.js} +2 -2
- package/dist/{chunk-2RCML4RI.js → chunk-AMLNYJWV.js} +3 -3
- package/dist/{chunk-U4R7GNS3.js → chunk-AS6INVO3.js} +73 -9
- package/dist/chunk-AS6INVO3.js.map +1 -0
- package/dist/{chunk-YXBKSJXE.js → chunk-B3GHP32M.js} +6 -6
- package/dist/{chunk-2GJZMZKE.js → chunk-C2TMQUP4.js} +5 -5
- package/dist/{chunk-DDEOJIOC.js → chunk-FQMLFAEN.js} +10 -10
- package/dist/{chunk-SWJLFU2Y.js → chunk-GRY6ITVN.js} +2 -2
- package/dist/{chunk-RSZERVJO.cjs → chunk-HB3KLT7N.cjs} +58 -58
- package/dist/{chunk-RSZERVJO.cjs.map → chunk-HB3KLT7N.cjs.map} +1 -1
- package/dist/{chunk-3PMJMMYO.js → chunk-HD6RQDGW.js} +2 -2
- package/dist/{chunk-I4K5GVV5.js → chunk-HDP2NFYZ.js} +72 -8
- package/dist/chunk-HDP2NFYZ.js.map +1 -0
- package/dist/{chunk-BOFEAPZJ.cjs → chunk-HW6KA2HI.cjs} +3 -3
- package/dist/{chunk-BOFEAPZJ.cjs.map → chunk-HW6KA2HI.cjs.map} +1 -1
- package/dist/{chunk-7EKOJLJY.cjs → chunk-IT34DGXJ.cjs} +3 -3
- package/dist/{chunk-7EKOJLJY.cjs.map → chunk-IT34DGXJ.cjs.map} +1 -1
- package/dist/{chunk-SJOQYUWH.js → chunk-IV6GW3K7.js} +13 -6
- package/dist/chunk-IV6GW3K7.js.map +1 -0
- package/dist/{chunk-DEIHO5LT.js → chunk-JI3WWHN2.js} +6 -6
- package/dist/{chunk-QPQZUYIR.js → chunk-NJ2BJDHJ.js} +2 -2
- package/dist/{chunk-PSF2OWCU.js → chunk-NYQ6HNLA.js} +2 -2
- package/dist/{chunk-7JSL5CSQ.cjs → chunk-O7EDZT7I.cjs} +98 -98
- package/dist/{chunk-7JSL5CSQ.cjs.map → chunk-O7EDZT7I.cjs.map} +1 -1
- package/dist/{chunk-KMDRZIGO.cjs → chunk-OQCRVBB7.cjs} +51 -44
- package/dist/chunk-OQCRVBB7.cjs.map +1 -0
- package/dist/{chunk-RSY7TU4J.js → chunk-PSB3XI2U.js} +2 -2
- package/dist/{chunk-SL4UHGZV.js → chunk-QR5EL3EF.js} +2 -2
- package/dist/{chunk-VLHBQ2CA.js → chunk-RFSKHVLF.js} +2 -2
- package/dist/{chunk-GV3JHFAA.js → chunk-RUCMKRDE.js} +13 -6
- package/dist/chunk-RUCMKRDE.js.map +1 -0
- package/dist/{chunk-KOVWUN2F.cjs → chunk-SXULSPB6.cjs} +95 -31
- package/dist/chunk-SXULSPB6.cjs.map +1 -0
- package/dist/{chunk-2DK2NCNW.js → chunk-TRVRIIER.js} +2 -2
- package/dist/{chunk-ICF2GY2Q.js → chunk-UETXNBIQ.js} +7 -7
- package/dist/{chunk-G64OQCI2.js → chunk-UZTGIVEH.js} +5 -5
- package/dist/{chunk-N3MAZNY6.js → chunk-WF2GLWPA.js} +15 -15
- package/dist/{chunk-QZEPWIRV.js → chunk-WLBPDYAT.js} +11 -11
- package/dist/{chunk-INZHSNJP.js → chunk-WXTEM53O.js} +2 -2
- package/dist/{chunk-KGAV4N3R.js → chunk-XCRE5EMS.js} +2 -2
- package/dist/{chunk-3CMQ5PPW.js → chunk-YEKQTHWN.js} +5 -5
- package/dist/{chunk-RP2FGGAN.cjs → chunk-YN3C6T5M.cjs} +180 -89
- package/dist/chunk-YN3C6T5M.cjs.map +1 -0
- package/dist/{chunk-7VRDNOXF.js → chunk-YSRLHL2J.js} +100 -9
- package/dist/chunk-YSRLHL2J.js.map +1 -0
- package/dist/{chunk-BE62Y3BP.cjs → chunk-ZGYKWZJS.cjs} +2 -2
- package/dist/{chunk-BE62Y3BP.cjs.map → chunk-ZGYKWZJS.cjs.map} +1 -1
- package/dist/chunks-IBZZKRII.js +11 -0
- package/dist/cli.js +43 -43
- package/dist/{formula-3JFTK4RE.js → formula-2FOYPHV2.js} +3 -3
- package/dist/{formula-6ZNPMIO2.js → formula-DLJ44T7B.js} +4 -4
- package/dist/{formula-KSUG6YMF.cjs → formula-XAUTHBU5.cjs} +9 -9
- package/dist/{formula-KSUG6YMF.cjs.map → formula-XAUTHBU5.cjs.map} +1 -1
- package/dist/generator-5QCCBJM6.js +10 -0
- package/dist/generator-BIEVUOPW.cjs +11 -0
- package/dist/{generator-MZDOYDNL.cjs.map → generator-BIEVUOPW.cjs.map} +1 -1
- package/dist/generator-S373GIY7.js +17 -0
- package/dist/{hancom-7EP2RGN7.js → hancom-B5LZPM5Y.js} +2 -2
- package/dist/{hancom-5OKIXXYQ.cjs → hancom-TFYG5RGJ.cjs} +5 -5
- package/dist/{hancom-5OKIXXYQ.cjs.map → hancom-TFYG5RGJ.cjs.map} +1 -1
- package/dist/{hancom-FS3UV4XW.js → hancom-W6XQOGQY.js} +2 -2
- package/dist/{image-ocr-PWPS6GJO.cjs → image-ocr-6NMWKDT6.cjs} +27 -27
- package/dist/{image-ocr-PWPS6GJO.cjs.map → image-ocr-6NMWKDT6.cjs.map} +1 -1
- package/dist/{image-ocr-V2NFWERQ.js → image-ocr-BKFZMHFE.js} +7 -7
- package/dist/{image-ocr-CRSF47VX.js → image-ocr-XRXLPEBP.js} +10 -10
- package/dist/index.cjs +1105 -1105
- package/dist/index.js +9 -9
- package/dist/mcp.js +36 -36
- package/dist/memo-NMEJZR24.js +17 -0
- package/dist/{model-bundle-2SFOC7MN.js → model-bundle-R3AIXPVX.js} +5 -5
- package/dist/{models-PLU2EPT7.js → models-BLHI4JAU.js} +5 -5
- package/dist/{parse-worker-v2-WA23FJTR.js → parse-worker-v2-IB3KIORL.js} +22 -22
- package/dist/{parser-FPPPPFKG.cjs → parser-7VLNB7T6.cjs} +161 -160
- package/dist/parser-7VLNB7T6.cjs.map +1 -0
- package/dist/{parser-ZZ5J23BV.js → parser-QCPSCSGJ.js} +11 -10
- package/dist/{parser-ZZ5J23BV.js.map → parser-QCPSCSGJ.js.map} +1 -1
- package/dist/{parser-6STVLFXK.js → parser-QR2TG3WE.js} +14 -13
- package/dist/{parser-6STVLFXK.js.map → parser-QR2TG3WE.js.map} +1 -1
- package/dist/{pdf-ocr-ONVX6DOP.js → pdf-ocr-6PZ66I7G.js} +11 -9
- package/dist/{pdf-ocr-4HCIQNKN.js → pdf-ocr-TGXEFZB5.js} +8 -6
- package/dist/pdf-ocr-TUCEX4AY.cjs +42 -0
- package/dist/pdf-ocr-TUCEX4AY.cjs.map +1 -0
- package/dist/{profile-io-TZFFQUIK.js → profile-io-QL4XZ34F.js} +3 -3
- package/dist/{rasterize-MIMMMVE4.js → rasterize-PUG2V436.js} +3 -3
- package/dist/{redact-doc-ODRGSZR6.js → redact-doc-XDMXMF3A.js} +21 -21
- package/dist/{render-CAJOYHGB.js → render-IHE7XBO6.js} +12 -12
- package/dist/{rewrite-fallback-HFHVUJMY.js → rewrite-fallback-J2KE4JIC.js} +13 -13
- package/dist/seal-OXEZMJL4.js +16 -0
- package/dist/{setup-FNKZ44RB.js → setup-FAU3G7N3.js} +3 -3
- package/dist/{to-hwpx-2KBVGBZP.js → to-hwpx-B5CXJLNS.js} +4 -4
- package/dist/to-hwpx-KFQVO5YC.cjs +16 -0
- package/dist/{to-hwpx-MRHCQ535.cjs.map → to-hwpx-KFQVO5YC.cjs.map} +1 -1
- package/dist/{to-hwpx-U5ZI4SOL.js → to-hwpx-YLJE3AZW.js} +7 -7
- package/dist/visual-GJLFH23Q.js +37 -0
- package/dist/{watch-UAPAV4KE.js → watch-VKZVO6GV.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-6BKH6JOD.js.map +0 -1
- package/dist/chunk-7VRDNOXF.js.map +0 -1
- package/dist/chunk-GV3JHFAA.js.map +0 -1
- package/dist/chunk-I4K5GVV5.js.map +0 -1
- package/dist/chunk-KMDRZIGO.cjs.map +0 -1
- package/dist/chunk-KOVWUN2F.cjs.map +0 -1
- package/dist/chunk-RP2FGGAN.cjs.map +0 -1
- package/dist/chunk-SJOQYUWH.js.map +0 -1
- package/dist/chunk-U4R7GNS3.js.map +0 -1
- package/dist/chunks-456YDGK7.js +0 -11
- package/dist/generator-3XEJMYGP.js +0 -10
- package/dist/generator-HOFGOBUB.js +0 -17
- package/dist/generator-MZDOYDNL.cjs +0 -11
- package/dist/memo-5HCUFE7O.js +0 -17
- package/dist/parser-FPPPPFKG.cjs.map +0 -1
- package/dist/pdf-ocr-DEKAFNKL.cjs +0 -40
- package/dist/pdf-ocr-DEKAFNKL.cjs.map +0 -1
- package/dist/seal-WHIN7ENH.js +0 -16
- package/dist/to-hwpx-MRHCQ535.cjs +0 -16
- package/dist/visual-RMSREQRT.js +0 -37
- /package/dist/{-4FV4UFBP.js.map → -H334XSXO.js.map} +0 -0
- /package/dist/{chunk-NQJCR4W6.js.map → chunk-2FDWBF47.js.map} +0 -0
- /package/dist/{chunk-SHJFHRDG.js.map → chunk-2KHZVNCS.js.map} +0 -0
- /package/dist/{chunk-FGTG4IIL.js.map → chunk-2TJ4E6MT.js.map} +0 -0
- /package/dist/{chunk-L5ETE5GI.js.map → chunk-3EBWTFBT.js.map} +0 -0
- /package/dist/{chunk-4CGVUHGB.js.map → chunk-4Y5KRSHV.js.map} +0 -0
- /package/dist/{chunk-MXBFGNEJ.js.map → chunk-6M2Z6QDD.js.map} +0 -0
- /package/dist/{chunk-BJ6CKAQL.js.map → chunk-6ZYOH3TZ.js.map} +0 -0
- /package/dist/{chunk-N6AEYYEV.js.map → chunk-7W6G4EC7.js.map} +0 -0
- /package/dist/{chunk-US34K54L.js.map → chunk-ABJ5DR2C.js.map} +0 -0
- /package/dist/{chunk-2RCML4RI.js.map → chunk-AMLNYJWV.js.map} +0 -0
- /package/dist/{chunk-YXBKSJXE.js.map → chunk-B3GHP32M.js.map} +0 -0
- /package/dist/{chunk-2GJZMZKE.js.map → chunk-C2TMQUP4.js.map} +0 -0
- /package/dist/{chunk-DDEOJIOC.js.map → chunk-FQMLFAEN.js.map} +0 -0
- /package/dist/{chunk-SWJLFU2Y.js.map → chunk-GRY6ITVN.js.map} +0 -0
- /package/dist/{chunk-3PMJMMYO.js.map → chunk-HD6RQDGW.js.map} +0 -0
- /package/dist/{chunk-DEIHO5LT.js.map → chunk-JI3WWHN2.js.map} +0 -0
- /package/dist/{chunk-QPQZUYIR.js.map → chunk-NJ2BJDHJ.js.map} +0 -0
- /package/dist/{chunk-PSF2OWCU.js.map → chunk-NYQ6HNLA.js.map} +0 -0
- /package/dist/{chunk-RSY7TU4J.js.map → chunk-PSB3XI2U.js.map} +0 -0
- /package/dist/{chunk-SL4UHGZV.js.map → chunk-QR5EL3EF.js.map} +0 -0
- /package/dist/{chunk-VLHBQ2CA.js.map → chunk-RFSKHVLF.js.map} +0 -0
- /package/dist/{chunk-2DK2NCNW.js.map → chunk-TRVRIIER.js.map} +0 -0
- /package/dist/{chunk-ICF2GY2Q.js.map → chunk-UETXNBIQ.js.map} +0 -0
- /package/dist/{chunk-G64OQCI2.js.map → chunk-UZTGIVEH.js.map} +0 -0
- /package/dist/{chunk-N3MAZNY6.js.map → chunk-WF2GLWPA.js.map} +0 -0
- /package/dist/{chunk-QZEPWIRV.js.map → chunk-WLBPDYAT.js.map} +0 -0
- /package/dist/{chunk-INZHSNJP.js.map → chunk-WXTEM53O.js.map} +0 -0
- /package/dist/{chunk-KGAV4N3R.js.map → chunk-XCRE5EMS.js.map} +0 -0
- /package/dist/{chunk-3CMQ5PPW.js.map → chunk-YEKQTHWN.js.map} +0 -0
- /package/dist/{chunks-456YDGK7.js.map → chunks-IBZZKRII.js.map} +0 -0
- /package/dist/{formula-3JFTK4RE.js.map → formula-2FOYPHV2.js.map} +0 -0
- /package/dist/{formula-6ZNPMIO2.js.map → formula-DLJ44T7B.js.map} +0 -0
- /package/dist/{generator-3XEJMYGP.js.map → generator-5QCCBJM6.js.map} +0 -0
- /package/dist/{generator-HOFGOBUB.js.map → generator-S373GIY7.js.map} +0 -0
- /package/dist/{hancom-7EP2RGN7.js.map → hancom-B5LZPM5Y.js.map} +0 -0
- /package/dist/{hancom-FS3UV4XW.js.map → hancom-W6XQOGQY.js.map} +0 -0
- /package/dist/{image-ocr-V2NFWERQ.js.map → image-ocr-BKFZMHFE.js.map} +0 -0
- /package/dist/{image-ocr-CRSF47VX.js.map → image-ocr-XRXLPEBP.js.map} +0 -0
- /package/dist/{memo-5HCUFE7O.js.map → memo-NMEJZR24.js.map} +0 -0
- /package/dist/{model-bundle-2SFOC7MN.js.map → model-bundle-R3AIXPVX.js.map} +0 -0
- /package/dist/{models-PLU2EPT7.js.map → models-BLHI4JAU.js.map} +0 -0
- /package/dist/{parse-worker-v2-WA23FJTR.js.map → parse-worker-v2-IB3KIORL.js.map} +0 -0
- /package/dist/{pdf-ocr-4HCIQNKN.js.map → pdf-ocr-6PZ66I7G.js.map} +0 -0
- /package/dist/{pdf-ocr-ONVX6DOP.js.map → pdf-ocr-TGXEFZB5.js.map} +0 -0
- /package/dist/{profile-io-TZFFQUIK.js.map → profile-io-QL4XZ34F.js.map} +0 -0
- /package/dist/{rasterize-MIMMMVE4.js.map → rasterize-PUG2V436.js.map} +0 -0
- /package/dist/{redact-doc-ODRGSZR6.js.map → redact-doc-XDMXMF3A.js.map} +0 -0
- /package/dist/{render-CAJOYHGB.js.map → render-IHE7XBO6.js.map} +0 -0
- /package/dist/{rewrite-fallback-HFHVUJMY.js.map → rewrite-fallback-J2KE4JIC.js.map} +0 -0
- /package/dist/{seal-WHIN7ENH.js.map → seal-OXEZMJL4.js.map} +0 -0
- /package/dist/{setup-FNKZ44RB.js.map → setup-FAU3G7N3.js.map} +0 -0
- /package/dist/{to-hwpx-2KBVGBZP.js.map → to-hwpx-B5CXJLNS.js.map} +0 -0
- /package/dist/{to-hwpx-U5ZI4SOL.js.map → to-hwpx-YLJE3AZW.js.map} +0 -0
- /package/dist/{visual-RMSREQRT.js.map → visual-GJLFH23Q.js.map} +0 -0
- /package/dist/{watch-UAPAV4KE.js.map → watch-VKZVO6GV.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/utils.ts
|
|
2
|
-
var VERSION = true ? "4.24.
|
|
2
|
+
var VERSION = true ? "4.24.44" : "0.0.0-dev";
|
|
3
3
|
function toArrayBuffer(buf) {
|
|
4
4
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
5
5
|
return buf.buffer;
|
|
@@ -161,4 +161,4 @@ export {
|
|
|
161
161
|
classifyError,
|
|
162
162
|
partExtension
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-HD6RQDGW.js.map
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
HEADING_RATIO_H3,
|
|
7
7
|
tidyScriptTags,
|
|
8
8
|
toTex
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7W6G4EC7.js";
|
|
10
10
|
import {
|
|
11
11
|
safeMax,
|
|
12
12
|
safeMin
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TRVRIIER.js";
|
|
14
14
|
|
|
15
15
|
// src/ocr/line-split.ts
|
|
16
16
|
function grayCrop(rgba, pageW, box) {
|
|
@@ -395,6 +395,15 @@ function romanStems(gray, w, h, ink, prevX, nextX, prevHangul = false) {
|
|
|
395
395
|
return n >= 1 && n <= 3 && k >= rows * 0.7 ? n : null;
|
|
396
396
|
}
|
|
397
397
|
function circledAt(gray, w, h, ink, xs) {
|
|
398
|
+
const rings = ringBoxes(gray, w, h, ink);
|
|
399
|
+
return xs.map((x) => rings.some((r) => x >= r.x0 && x <= r.x1));
|
|
400
|
+
}
|
|
401
|
+
function ringBoxes(gray, w, h, ink) {
|
|
402
|
+
const strict = ringsAt(gray, w, h, ink);
|
|
403
|
+
const loose = ringsAt(gray, w, h, { ...ink, threshold: ink.darkInk ? ink.threshold + (255 - ink.threshold) / 2 : ink.threshold / 2 });
|
|
404
|
+
return [...strict, ...loose.filter((r) => !strict.some((s) => r.x0 < s.x1 && s.x0 < r.x1))];
|
|
405
|
+
}
|
|
406
|
+
function ringsAt(gray, w, h, ink) {
|
|
398
407
|
const { comps, label } = components(gray, w, h, ink);
|
|
399
408
|
let charH = 0;
|
|
400
409
|
for (const c of comps) charH = Math.max(charH, c.y1 - c.y0);
|
|
@@ -410,13 +419,46 @@ function circledAt(gray, w, h, ink, xs) {
|
|
|
410
419
|
}
|
|
411
420
|
return a <= b ? [a, b + 1] : [r.x0, r.x1];
|
|
412
421
|
};
|
|
413
|
-
|
|
422
|
+
return charH < 10 ? [] : comps.flatMap((r) => {
|
|
414
423
|
const rh = r.y1 - r.y0;
|
|
415
424
|
if (rh < charH * 0.55) return [];
|
|
416
425
|
const [x0, x1] = arcX(r), rw = x1 - x0;
|
|
417
|
-
|
|
426
|
+
if (rw < rh * 0.8 || rw > rh * 1.25) return [];
|
|
427
|
+
const inside = comps.filter((d) => d !== r && d.x0 > x0 && d.x1 < x1 && d.y0 > r.y0 && d.y1 < r.y1);
|
|
428
|
+
if (!inside.some((d) => d.y1 - d.y0 >= rh * 0.35)) return [];
|
|
429
|
+
const inner = { x0: Math.min(...inside.map((d) => d.x0)), x1: Math.max(...inside.map((d) => d.x1)), y0: Math.min(...inside.map((d) => d.y0)), y1: Math.max(...inside.map((d) => d.y1)) };
|
|
430
|
+
const ids = new Set(inside.map((d) => d.id));
|
|
431
|
+
return [{ x0, x1, y0: r.y0, y1: r.y1, inner, jamo: ringJamo(label, w, inner, ids) }];
|
|
418
432
|
});
|
|
419
|
-
|
|
433
|
+
}
|
|
434
|
+
function ringJamo(label, w, b, ids) {
|
|
435
|
+
const W = b.x1 - b.x0, H = b.y1 - b.y0;
|
|
436
|
+
if (W < 4 || H < 4) return null;
|
|
437
|
+
const on = (x, y) => ids.has(label[y * w + x]);
|
|
438
|
+
const row = (y) => {
|
|
439
|
+
let n = 0;
|
|
440
|
+
for (let x = b.x0; x < b.x1; x++) if (on(x, y)) n++;
|
|
441
|
+
return n / W;
|
|
442
|
+
};
|
|
443
|
+
const col = (x) => {
|
|
444
|
+
let n = 0;
|
|
445
|
+
for (let y = b.y0; y < b.y1; y++) if (on(x, y)) n++;
|
|
446
|
+
return n / H;
|
|
447
|
+
};
|
|
448
|
+
const band = (f, a, z) => {
|
|
449
|
+
let m = 0;
|
|
450
|
+
for (let v = Math.floor(a); v < Math.ceil(z); v++) m = Math.max(m, f(v));
|
|
451
|
+
return m;
|
|
452
|
+
};
|
|
453
|
+
const top = band(row, b.y0, b.y0 + H * 0.25), bot = band(row, b.y1 - H * 0.25, b.y1), mid = band(row, b.y0 + H * 0.35, b.y1 - H * 0.35);
|
|
454
|
+
const left = band(col, b.x0, b.x0 + W * 0.25), right = band(col, b.x1 - W * 0.25, b.x1);
|
|
455
|
+
const S = 0.75, Wk = 0.45;
|
|
456
|
+
if (top >= S && bot >= S && left >= S && right >= S && mid < Wk) return "\u3141";
|
|
457
|
+
if (top >= S && mid >= S && bot >= S && left < S && right < S) return "\u3139";
|
|
458
|
+
if (top >= S && bot >= S && left >= S && right < Wk) return "\u3137";
|
|
459
|
+
if (top >= S && right >= S && bot < Wk && left < Wk) return "\u3131";
|
|
460
|
+
if (left >= S && bot >= S && top < Wk && right < Wk) return "\u3134";
|
|
461
|
+
return null;
|
|
420
462
|
}
|
|
421
463
|
function quoteHead(gray, w, h, ink, cx) {
|
|
422
464
|
const { comps, label } = components(gray, w, h, ink);
|
|
@@ -4663,7 +4705,9 @@ function isChartTable(table, ocr = false) {
|
|
|
4663
4705
|
function isProseFragmentTable(table) {
|
|
4664
4706
|
const texts = table.cells.flat().map((cell) => cell.text.trim()).filter(Boolean);
|
|
4665
4707
|
if (texts.length < 4) return false;
|
|
4666
|
-
|
|
4708
|
+
const hangul = (text) => text.match(/[가-힣]/g)?.length ?? 0;
|
|
4709
|
+
if (texts.filter((text) => hangul(text) >= 2).length < texts.length * 0.7) return false;
|
|
4710
|
+
if (texts.length >= 12 && texts.filter((text) => hangul(text) >= 15 && !text.includes("\n")).length >= texts.length * 0.4) return true;
|
|
4667
4711
|
return texts.filter((text) => /(?:[다요고서는을를에게지며면어아야니까던]|[.,?!])$/.test(text)).length >= texts.length * 0.3;
|
|
4668
4712
|
}
|
|
4669
4713
|
function isFormulaTable(table) {
|
|
@@ -10240,7 +10284,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10240
10284
|
blocks.push({ type: "table", table: irTable, pageNumber: pageNum, bbox: tableBbox });
|
|
10241
10285
|
}
|
|
10242
10286
|
for (const p of pendingNested) blocks.push(p.block);
|
|
10243
|
-
let remaining = items.filter((i) => !usedItems.has(i));
|
|
10287
|
+
let remaining = attachParagraphNumbers(items.filter((i) => !usedItems.has(i)));
|
|
10244
10288
|
const groupSizes = [];
|
|
10245
10289
|
let finalTextBlocks = [];
|
|
10246
10290
|
let gutterX = null;
|
|
@@ -10429,6 +10473,25 @@ function isProseBesidePanel(unit, box) {
|
|
|
10429
10473
|
return unit.some(beside) && unit.every((b) => beside(b) || !!b.bbox && b.bbox.y < box.y);
|
|
10430
10474
|
}
|
|
10431
10475
|
var SIDEBAR_ITEMS = /* @__PURE__ */ new WeakMap();
|
|
10476
|
+
function attachParagraphNumbers(items) {
|
|
10477
|
+
const nums = items.filter((it) => /^\[\d{3,5}\]$/.test(it.text.trim()));
|
|
10478
|
+
if (!nums.length) return items;
|
|
10479
|
+
const drop = /* @__PURE__ */ new Set();
|
|
10480
|
+
for (const n of nums) {
|
|
10481
|
+
let next = null;
|
|
10482
|
+
for (const it of items) {
|
|
10483
|
+
if (it === n || drop.has(it) || Math.abs(it.y - n.y) > n.fontSize * 0.5 || it.x < n.x + n.w) continue;
|
|
10484
|
+
if (it.x - (n.x + n.w) > n.fontSize * 6) continue;
|
|
10485
|
+
if (!next || it.x < next.x) next = it;
|
|
10486
|
+
}
|
|
10487
|
+
if (!next || nums.includes(next)) continue;
|
|
10488
|
+
next.text = n.text.trim() + " " + next.text;
|
|
10489
|
+
next.w = next.x + next.w - n.x;
|
|
10490
|
+
next.x = n.x;
|
|
10491
|
+
drop.add(n);
|
|
10492
|
+
}
|
|
10493
|
+
return drop.size ? items.filter((it) => !drop.has(it)) : items;
|
|
10494
|
+
}
|
|
10432
10495
|
function clusterTableBlock(cr, source, pageNum, horizontals = []) {
|
|
10433
10496
|
const b = cr.bbox;
|
|
10434
10497
|
const rules2 = horizontals.filter((h) => h.y1 > b.y && h.y1 < b.y + b.height && Math.min(h.x2, b.x + b.width) - Math.max(h.x1, b.x) >= b.width * 0.6).length;
|
|
@@ -10822,6 +10885,7 @@ export {
|
|
|
10822
10885
|
slantedPair,
|
|
10823
10886
|
romanStems,
|
|
10824
10887
|
circledAt,
|
|
10888
|
+
ringBoxes,
|
|
10825
10889
|
quoteHead,
|
|
10826
10890
|
edgeTrim,
|
|
10827
10891
|
tallInkCount,
|
|
@@ -10891,4 +10955,4 @@ export {
|
|
|
10891
10955
|
UNRULED_REGION_TABLES,
|
|
10892
10956
|
mergeOcrImageRegions
|
|
10893
10957
|
};
|
|
10894
|
-
//# sourceMappingURL=chunk-
|
|
10958
|
+
//# sourceMappingURL=chunk-HDP2NFYZ.js.map
|