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,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
visibleText
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RUCMKRDE.js";
|
|
5
5
|
|
|
6
6
|
// src/script-tags.ts
|
|
7
7
|
var LITERAL_TAG = /<(?=\/?(?:u|sup|sub)>)/g;
|
|
@@ -336,4 +336,4 @@ export {
|
|
|
336
336
|
HEADING_RATIO_H2,
|
|
337
337
|
HEADING_RATIO_H3
|
|
338
338
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-7W6G4EC7.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
assignTableIds,
|
|
4
4
|
blocksToMarkdown
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RUCMKRDE.js";
|
|
6
6
|
|
|
7
7
|
// src/chunks.ts
|
|
8
8
|
var LIST_MARKER_RE = /^(?:[□■◇◆○◎●◦ㅇ•▪▸▶※-]|\d{1,3}[.)]|[가나다라마바사아자차카타파하][.)]|\([가나다라마바사아자차카타파하0-9]{1,3}\)|[①-⑳㉮-㉻㈎-㈛])\s/;
|
|
@@ -82,4 +82,4 @@ function blocksToChunks(blocks, options) {
|
|
|
82
82
|
export {
|
|
83
83
|
blocksToChunks
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-ABJ5DR2C.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
parse
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WF2GLWPA.js";
|
|
5
5
|
import {
|
|
6
6
|
classifyError,
|
|
7
7
|
sanitizeError,
|
|
8
8
|
toArrayBuffer
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TRVRIIER.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/worker-parse.ts
|
|
12
12
|
import { readFileSync, statSync } from "fs";
|
|
@@ -26,4 +26,4 @@ async function parseWorkerFile(absPath, options) {
|
|
|
26
26
|
export {
|
|
27
27
|
parseWorkerFile
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-AMLNYJWV.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureModelsIn,
|
|
3
3
|
getModelsDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XCRE5EMS.js";
|
|
5
5
|
import {
|
|
6
6
|
CELL_EDGES,
|
|
7
7
|
HEADING_RATIO_H1,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
HEADING_RATIO_H3,
|
|
10
10
|
tidyScriptTags,
|
|
11
11
|
toTex
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IV6GW3K7.js";
|
|
13
13
|
import {
|
|
14
14
|
safeMax,
|
|
15
15
|
safeMin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HD6RQDGW.js";
|
|
17
17
|
|
|
18
18
|
// src/ocr/models.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -540,6 +540,15 @@ function romanStems(gray, w, h, ink, prevX, nextX, prevHangul = false) {
|
|
|
540
540
|
return n >= 1 && n <= 3 && k >= rows * 0.7 ? n : null;
|
|
541
541
|
}
|
|
542
542
|
function circledAt(gray, w, h, ink, xs) {
|
|
543
|
+
const rings = ringBoxes(gray, w, h, ink);
|
|
544
|
+
return xs.map((x) => rings.some((r) => x >= r.x0 && x <= r.x1));
|
|
545
|
+
}
|
|
546
|
+
function ringBoxes(gray, w, h, ink) {
|
|
547
|
+
const strict = ringsAt(gray, w, h, ink);
|
|
548
|
+
const loose = ringsAt(gray, w, h, { ...ink, threshold: ink.darkInk ? ink.threshold + (255 - ink.threshold) / 2 : ink.threshold / 2 });
|
|
549
|
+
return [...strict, ...loose.filter((r) => !strict.some((s) => r.x0 < s.x1 && s.x0 < r.x1))];
|
|
550
|
+
}
|
|
551
|
+
function ringsAt(gray, w, h, ink) {
|
|
543
552
|
const { comps, label } = components(gray, w, h, ink);
|
|
544
553
|
let charH = 0;
|
|
545
554
|
for (const c of comps) charH = Math.max(charH, c.y1 - c.y0);
|
|
@@ -555,13 +564,46 @@ function circledAt(gray, w, h, ink, xs) {
|
|
|
555
564
|
}
|
|
556
565
|
return a <= b ? [a, b + 1] : [r.x0, r.x1];
|
|
557
566
|
};
|
|
558
|
-
|
|
567
|
+
return charH < 10 ? [] : comps.flatMap((r) => {
|
|
559
568
|
const rh = r.y1 - r.y0;
|
|
560
569
|
if (rh < charH * 0.55) return [];
|
|
561
570
|
const [x0, x1] = arcX(r), rw = x1 - x0;
|
|
562
|
-
|
|
571
|
+
if (rw < rh * 0.8 || rw > rh * 1.25) return [];
|
|
572
|
+
const inside = comps.filter((d) => d !== r && d.x0 > x0 && d.x1 < x1 && d.y0 > r.y0 && d.y1 < r.y1);
|
|
573
|
+
if (!inside.some((d) => d.y1 - d.y0 >= rh * 0.35)) return [];
|
|
574
|
+
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)) };
|
|
575
|
+
const ids = new Set(inside.map((d) => d.id));
|
|
576
|
+
return [{ x0, x1, y0: r.y0, y1: r.y1, inner, jamo: ringJamo(label, w, inner, ids) }];
|
|
563
577
|
});
|
|
564
|
-
|
|
578
|
+
}
|
|
579
|
+
function ringJamo(label, w, b, ids) {
|
|
580
|
+
const W = b.x1 - b.x0, H = b.y1 - b.y0;
|
|
581
|
+
if (W < 4 || H < 4) return null;
|
|
582
|
+
const on = (x, y) => ids.has(label[y * w + x]);
|
|
583
|
+
const row = (y) => {
|
|
584
|
+
let n = 0;
|
|
585
|
+
for (let x = b.x0; x < b.x1; x++) if (on(x, y)) n++;
|
|
586
|
+
return n / W;
|
|
587
|
+
};
|
|
588
|
+
const col = (x) => {
|
|
589
|
+
let n = 0;
|
|
590
|
+
for (let y = b.y0; y < b.y1; y++) if (on(x, y)) n++;
|
|
591
|
+
return n / H;
|
|
592
|
+
};
|
|
593
|
+
const band = (f, a, z) => {
|
|
594
|
+
let m = 0;
|
|
595
|
+
for (let v = Math.floor(a); v < Math.ceil(z); v++) m = Math.max(m, f(v));
|
|
596
|
+
return m;
|
|
597
|
+
};
|
|
598
|
+
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);
|
|
599
|
+
const left = band(col, b.x0, b.x0 + W * 0.25), right = band(col, b.x1 - W * 0.25, b.x1);
|
|
600
|
+
const S = 0.75, Wk = 0.45;
|
|
601
|
+
if (top >= S && bot >= S && left >= S && right >= S && mid < Wk) return "\u3141";
|
|
602
|
+
if (top >= S && mid >= S && bot >= S && left < S && right < S) return "\u3139";
|
|
603
|
+
if (top >= S && bot >= S && left >= S && right < Wk) return "\u3137";
|
|
604
|
+
if (top >= S && right >= S && bot < Wk && left < Wk) return "\u3131";
|
|
605
|
+
if (left >= S && bot >= S && top < Wk && right < Wk) return "\u3134";
|
|
606
|
+
return null;
|
|
565
607
|
}
|
|
566
608
|
function quoteHead(gray, w, h, ink, cx) {
|
|
567
609
|
const { comps, label } = components(gray, w, h, ink);
|
|
@@ -4808,7 +4850,9 @@ function isChartTable(table, ocr = false) {
|
|
|
4808
4850
|
function isProseFragmentTable(table) {
|
|
4809
4851
|
const texts = table.cells.flat().map((cell) => cell.text.trim()).filter(Boolean);
|
|
4810
4852
|
if (texts.length < 4) return false;
|
|
4811
|
-
|
|
4853
|
+
const hangul = (text) => text.match(/[가-힣]/g)?.length ?? 0;
|
|
4854
|
+
if (texts.filter((text) => hangul(text) >= 2).length < texts.length * 0.7) return false;
|
|
4855
|
+
if (texts.length >= 12 && texts.filter((text) => hangul(text) >= 15 && !text.includes("\n")).length >= texts.length * 0.4) return true;
|
|
4812
4856
|
return texts.filter((text) => /(?:[다요고서는을를에게지며면어아야니까던]|[.,?!])$/.test(text)).length >= texts.length * 0.3;
|
|
4813
4857
|
}
|
|
4814
4858
|
function isFormulaTable(table) {
|
|
@@ -10385,7 +10429,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10385
10429
|
blocks.push({ type: "table", table: irTable, pageNumber: pageNum, bbox: tableBbox });
|
|
10386
10430
|
}
|
|
10387
10431
|
for (const p of pendingNested) blocks.push(p.block);
|
|
10388
|
-
let remaining = items.filter((i) => !usedItems.has(i));
|
|
10432
|
+
let remaining = attachParagraphNumbers(items.filter((i) => !usedItems.has(i)));
|
|
10389
10433
|
const groupSizes = [];
|
|
10390
10434
|
let finalTextBlocks = [];
|
|
10391
10435
|
let gutterX = null;
|
|
@@ -10574,6 +10618,25 @@ function isProseBesidePanel(unit, box) {
|
|
|
10574
10618
|
return unit.some(beside) && unit.every((b) => beside(b) || !!b.bbox && b.bbox.y < box.y);
|
|
10575
10619
|
}
|
|
10576
10620
|
var SIDEBAR_ITEMS = /* @__PURE__ */ new WeakMap();
|
|
10621
|
+
function attachParagraphNumbers(items) {
|
|
10622
|
+
const nums = items.filter((it) => /^\[\d{3,5}\]$/.test(it.text.trim()));
|
|
10623
|
+
if (!nums.length) return items;
|
|
10624
|
+
const drop = /* @__PURE__ */ new Set();
|
|
10625
|
+
for (const n of nums) {
|
|
10626
|
+
let next = null;
|
|
10627
|
+
for (const it of items) {
|
|
10628
|
+
if (it === n || drop.has(it) || Math.abs(it.y - n.y) > n.fontSize * 0.5 || it.x < n.x + n.w) continue;
|
|
10629
|
+
if (it.x - (n.x + n.w) > n.fontSize * 6) continue;
|
|
10630
|
+
if (!next || it.x < next.x) next = it;
|
|
10631
|
+
}
|
|
10632
|
+
if (!next || nums.includes(next)) continue;
|
|
10633
|
+
next.text = n.text.trim() + " " + next.text;
|
|
10634
|
+
next.w = next.x + next.w - n.x;
|
|
10635
|
+
next.x = n.x;
|
|
10636
|
+
drop.add(n);
|
|
10637
|
+
}
|
|
10638
|
+
return drop.size ? items.filter((it) => !drop.has(it)) : items;
|
|
10639
|
+
}
|
|
10577
10640
|
function clusterTableBlock(cr, source, pageNum, horizontals = []) {
|
|
10578
10641
|
const b = cr.bbox;
|
|
10579
10642
|
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;
|
|
@@ -10975,6 +11038,7 @@ export {
|
|
|
10975
11038
|
slantedPair,
|
|
10976
11039
|
romanStems,
|
|
10977
11040
|
circledAt,
|
|
11041
|
+
ringBoxes,
|
|
10978
11042
|
quoteHead,
|
|
10979
11043
|
edgeTrim,
|
|
10980
11044
|
tallInkCount,
|
|
@@ -11044,4 +11108,4 @@ export {
|
|
|
11044
11108
|
UNRULED_REGION_TABLES,
|
|
11045
11109
|
mergeOcrImageRegions
|
|
11046
11110
|
};
|
|
11047
|
-
//# sourceMappingURL=chunk-
|
|
11111
|
+
//# sourceMappingURL=chunk-AS6INVO3.js.map
|