kordoc 4.24.49 → 4.24.51
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 +14 -13
- package/dist/{-22V6D2US.js → -KCRZNASU.js} +42 -42
- package/dist/{chunk-DA5AXURC.js → chunk-2SIZ5MFF.js} +84 -11
- package/dist/chunk-2SIZ5MFF.js.map +1 -0
- package/dist/{chunk-EUJX7HTR.js → chunk-35G7U3YU.js} +26 -10
- package/dist/{chunk-EUJX7HTR.js.map → chunk-35G7U3YU.js.map} +1 -1
- package/dist/{chunk-UBY2PLKR.cjs → chunk-45LMTY3P.cjs} +48 -32
- package/dist/chunk-45LMTY3P.cjs.map +1 -0
- package/dist/{chunk-PW7MQZI4.cjs → chunk-4ATTNHKS.cjs} +2 -2
- package/dist/{chunk-PW7MQZI4.cjs.map → chunk-4ATTNHKS.cjs.map} +1 -1
- package/dist/{chunk-L3JP55ZY.js → chunk-4IPFRFVU.js} +2 -2
- package/dist/{chunk-7KKL3PRK.js → chunk-5IMZWUXP.js} +32 -30
- package/dist/chunk-5IMZWUXP.js.map +1 -0
- package/dist/{chunk-M5RQ2PNP.js → chunk-6IAYV5W4.js} +14 -6
- package/dist/chunk-6IAYV5W4.js.map +1 -0
- package/dist/{chunk-4MWUBTAE.js → chunk-7ZWEK6GU.js} +2 -2
- package/dist/{chunk-LCRSRVFJ.js → chunk-AI43WY7Q.js} +2 -2
- package/dist/{chunk-Q7FDPJUS.js → chunk-BW7M7NEK.js} +13 -11
- package/dist/{chunk-Q7FDPJUS.js.map → chunk-BW7M7NEK.js.map} +1 -1
- package/dist/{chunk-HETGOJ6V.js → chunk-BZNS2FVC.js} +2 -2
- package/dist/{chunk-VMOUAWGD.js → chunk-D4AMLUTJ.js} +7 -7
- package/dist/{chunk-KB4ORA7M.js → chunk-DAGVJDCR.js} +2 -2
- package/dist/{chunk-MIJTZKWF.js → chunk-EOU3LHBZ.js} +2 -2
- package/dist/{chunk-S54DZB2Z.js → chunk-G5BBHFKH.js} +83 -10
- package/dist/chunk-G5BBHFKH.js.map +1 -0
- package/dist/{chunk-LOSCIAHY.js → chunk-GCYCXGNW.js} +4 -2
- package/dist/chunk-GCYCXGNW.js.map +1 -0
- package/dist/{chunk-PMGJQWSW.js → chunk-I44OXMPJ.js} +2 -2
- package/dist/{chunk-67GSFYG7.js → chunk-IWAYL364.js} +2 -2
- package/dist/{chunk-UU54HN5I.js → chunk-J2223EAJ.js} +25 -31
- package/dist/chunk-J2223EAJ.js.map +1 -0
- package/dist/{chunk-6BFWLS7E.js → chunk-JQVDG7KX.js} +3 -3
- package/dist/{chunk-LFFARZYZ.js → chunk-MCQSIN7Z.js} +2 -2
- package/dist/{chunk-HW7WVYBF.js → chunk-NQBHDDAT.js} +2 -2
- package/dist/{chunk-MLBX6KQM.js → chunk-NZPCUEGV.js} +2 -2
- package/dist/{chunk-4HJKBRZJ.js → chunk-O42SEA4E.js} +18 -18
- package/dist/{chunk-TAHS42ED.js → chunk-P6UVZNSO.js} +27 -11
- package/dist/{chunk-TAHS42ED.js.map → chunk-P6UVZNSO.js.map} +1 -1
- package/dist/{chunk-R2RLNUNK.js → chunk-PUMTE6MJ.js} +6 -6
- package/dist/{chunk-IRAZCKQ6.cjs → chunk-QECUDHOQ.cjs} +3 -3
- package/dist/{chunk-IRAZCKQ6.cjs.map → chunk-QECUDHOQ.cjs.map} +1 -1
- package/dist/{chunk-367WLMPO.cjs → chunk-QMLFUMPU.cjs} +85 -83
- package/dist/chunk-QMLFUMPU.cjs.map +1 -0
- package/dist/{chunk-ZF24SO45.js → chunk-TAZTQPXH.js} +2 -2
- package/dist/{chunk-CCQMSIZQ.js → chunk-TKMHLKEP.js} +19 -19
- package/dist/{chunk-2UWWWM4Q.cjs → chunk-TUQER6U6.cjs} +98 -98
- package/dist/{chunk-2UWWWM4Q.cjs.map → chunk-TUQER6U6.cjs.map} +1 -1
- package/dist/{chunk-OAETOHH3.js → chunk-TZNID7WN.js} +3 -3
- package/dist/{chunk-Y6QW3FJQ.js → chunk-U45FZY4H.js} +2 -2
- package/dist/{chunk-AXW2FMVR.js → chunk-U65CFPRW.js} +2 -2
- package/dist/{chunk-TQOAPKLU.cjs → chunk-USVDMFOC.cjs} +6 -6
- package/dist/{chunk-TQOAPKLU.cjs.map → chunk-USVDMFOC.cjs.map} +1 -1
- package/dist/{chunk-KXHUHGMC.js → chunk-V26RXRUA.js} +2 -2
- package/dist/{chunk-WLFZOBZR.js → chunk-V4A3L5KR.js} +3 -3
- package/dist/{chunk-Y4MFHEK4.cjs → chunk-VEQ33FMY.cjs} +3 -3
- package/dist/{chunk-Y4MFHEK4.cjs.map → chunk-VEQ33FMY.cjs.map} +1 -1
- package/dist/{chunk-AUAJVQQK.js → chunk-WTDEYE6F.js} +2 -2
- package/dist/{chunk-RQLEGKEV.js → chunk-X2ZNWQBA.js} +2 -2
- package/dist/{chunk-PVV6OY4M.cjs → chunk-XENUD7JK.cjs} +177 -104
- package/dist/chunk-XENUD7JK.cjs.map +1 -0
- package/dist/{chunk-EYSXMDA7.js → chunk-XO6DCDIT.js} +17 -17
- package/dist/{chunk-DAAJO62F.js → chunk-ZWNVRSGF.js} +2 -2
- package/dist/chunks-TMBS7TRD.js +11 -0
- package/dist/cli.js +52 -51
- package/dist/cli.js.map +1 -1
- package/dist/{formula-QJEOIVKR.cjs → formula-4O54LMV4.cjs} +14 -13
- package/dist/formula-4O54LMV4.cjs.map +1 -0
- package/dist/{formula-FQLMMBDP.js → formula-6JZI46QH.js} +4 -3
- package/dist/formula-6JZI46QH.js.map +1 -0
- package/dist/{formula-BYEDWWZU.js → formula-PSPOE4NL.js} +5 -4
- package/dist/formula-PSPOE4NL.js.map +1 -0
- package/dist/generator-IHU3ZJFL.cjs +11 -0
- package/dist/{generator-FTM6GOGB.cjs.map → generator-IHU3ZJFL.cjs.map} +1 -1
- package/dist/generator-KE3WTY4O.js +17 -0
- package/dist/generator-SMNLBY45.js +10 -0
- package/dist/hancom-GB6HZKL7.js +84 -0
- package/dist/hancom-GB6HZKL7.js.map +1 -0
- package/dist/hancom-SZBRFB4L.js +85 -0
- package/dist/hancom-SZBRFB4L.js.map +1 -0
- package/dist/hancom-YAUQDSDK.cjs +85 -0
- package/dist/hancom-YAUQDSDK.cjs.map +1 -0
- package/dist/{image-ocr-7Y3FCGRR.js → image-ocr-7SIIO5GO.js} +10 -10
- package/dist/{image-ocr-VIGZE4YL.js → image-ocr-J63QUDI2.js} +7 -7
- package/dist/{image-ocr-WRILL3WO.cjs → image-ocr-YPKWLJVD.cjs} +28 -28
- package/dist/{image-ocr-WRILL3WO.cjs.map → image-ocr-YPKWLJVD.cjs.map} +1 -1
- package/dist/index.cjs +1119 -1117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +75 -73
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +42 -41
- package/dist/mcp.js.map +1 -1
- package/dist/memo-5MQ6DM4A.js +17 -0
- package/dist/{model-bundle-UJRQPYUU.js → model-bundle-72BDGCZY.js} +5 -5
- package/dist/{models-64YLAWTI.js → models-QXVI5UHR.js} +5 -5
- package/dist/{parse-worker-v2-QWQZKFQO.js → parse-worker-v2-RCZPPU7G.js} +23 -23
- package/dist/{parser-RB6CBNAM.cjs → parser-IRERCFMK.cjs} +166 -166
- package/dist/{parser-RB6CBNAM.cjs.map → parser-IRERCFMK.cjs.map} +1 -1
- package/dist/{parser-JPWANPLM.js → parser-MAOMYZY5.js} +12 -12
- package/dist/{parser-XFU3VRWM.js → parser-NZJD3JG7.js} +16 -16
- package/dist/{pdf-ocr-XTZZEYKJ.js → pdf-ocr-ELMWWH5T.js} +6 -6
- package/dist/pdf-ocr-KIIEIQU6.cjs +42 -0
- package/dist/{pdf-ocr-NOJHEH4M.cjs.map → pdf-ocr-KIIEIQU6.cjs.map} +1 -1
- package/dist/{pdf-ocr-ZV3KYIIE.js → pdf-ocr-NP3BOUA5.js} +9 -9
- package/dist/{profile-io-FAJORRD2.js → profile-io-HDWE5EY3.js} +3 -3
- package/dist/{rasterize-4ZJUA2DZ.js → rasterize-4TQAGBZQ.js} +3 -3
- package/dist/{redact-doc-JPNROEH6.js → redact-doc-NZVL45JN.js} +29 -29
- package/dist/{render-D4WBOBKI.js → render-7JRZBK5R.js} +12 -12
- package/dist/{rewrite-fallback-OF3QI6CX.js → rewrite-fallback-VYGY2GAX.js} +13 -13
- package/dist/seal-TXHDIO27.js +16 -0
- package/dist/{setup-YC25YCQB.js → setup-ME45RAIC.js} +3 -3
- package/dist/{to-hwpx-ZWN64NCQ.js → to-hwpx-7XR5P4NH.js} +4 -4
- package/dist/to-hwpx-HIL2WODY.cjs +16 -0
- package/dist/{to-hwpx-LUA6F5RR.cjs.map → to-hwpx-HIL2WODY.cjs.map} +1 -1
- package/dist/{to-hwpx-D7OMPDUQ.js → to-hwpx-IFL6CZ6T.js} +7 -7
- package/dist/visual-J3E3ZYN3.js +37 -0
- package/dist/{watch-ZU576VSR.js → watch-BAED4COV.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-367WLMPO.cjs.map +0 -1
- package/dist/chunk-7KKL3PRK.js.map +0 -1
- package/dist/chunk-DA5AXURC.js.map +0 -1
- package/dist/chunk-LOSCIAHY.js.map +0 -1
- package/dist/chunk-M5RQ2PNP.js.map +0 -1
- package/dist/chunk-PVV6OY4M.cjs.map +0 -1
- package/dist/chunk-S54DZB2Z.js.map +0 -1
- package/dist/chunk-UBY2PLKR.cjs.map +0 -1
- package/dist/chunk-UU54HN5I.js.map +0 -1
- package/dist/chunks-Q7242OJE.js +0 -11
- package/dist/formula-BYEDWWZU.js.map +0 -1
- package/dist/formula-FQLMMBDP.js.map +0 -1
- package/dist/formula-QJEOIVKR.cjs.map +0 -1
- package/dist/generator-FTM6GOGB.cjs +0 -11
- package/dist/generator-Q3L7RNUY.js +0 -17
- package/dist/generator-SU73HZHR.js +0 -10
- package/dist/memo-T5ZQEXEA.js +0 -17
- package/dist/pdf-ocr-NOJHEH4M.cjs +0 -42
- package/dist/seal-DQWEHIAM.js +0 -16
- package/dist/to-hwpx-LUA6F5RR.cjs +0 -16
- package/dist/visual-SW7NPY6K.js +0 -37
- /package/dist/{-22V6D2US.js.map → -KCRZNASU.js.map} +0 -0
- /package/dist/{chunk-L3JP55ZY.js.map → chunk-4IPFRFVU.js.map} +0 -0
- /package/dist/{chunk-4MWUBTAE.js.map → chunk-7ZWEK6GU.js.map} +0 -0
- /package/dist/{chunk-LCRSRVFJ.js.map → chunk-AI43WY7Q.js.map} +0 -0
- /package/dist/{chunk-HETGOJ6V.js.map → chunk-BZNS2FVC.js.map} +0 -0
- /package/dist/{chunk-VMOUAWGD.js.map → chunk-D4AMLUTJ.js.map} +0 -0
- /package/dist/{chunk-KB4ORA7M.js.map → chunk-DAGVJDCR.js.map} +0 -0
- /package/dist/{chunk-MIJTZKWF.js.map → chunk-EOU3LHBZ.js.map} +0 -0
- /package/dist/{chunk-PMGJQWSW.js.map → chunk-I44OXMPJ.js.map} +0 -0
- /package/dist/{chunk-67GSFYG7.js.map → chunk-IWAYL364.js.map} +0 -0
- /package/dist/{chunk-6BFWLS7E.js.map → chunk-JQVDG7KX.js.map} +0 -0
- /package/dist/{chunk-LFFARZYZ.js.map → chunk-MCQSIN7Z.js.map} +0 -0
- /package/dist/{chunk-HW7WVYBF.js.map → chunk-NQBHDDAT.js.map} +0 -0
- /package/dist/{chunk-MLBX6KQM.js.map → chunk-NZPCUEGV.js.map} +0 -0
- /package/dist/{chunk-4HJKBRZJ.js.map → chunk-O42SEA4E.js.map} +0 -0
- /package/dist/{chunk-R2RLNUNK.js.map → chunk-PUMTE6MJ.js.map} +0 -0
- /package/dist/{chunk-ZF24SO45.js.map → chunk-TAZTQPXH.js.map} +0 -0
- /package/dist/{chunk-CCQMSIZQ.js.map → chunk-TKMHLKEP.js.map} +0 -0
- /package/dist/{chunk-OAETOHH3.js.map → chunk-TZNID7WN.js.map} +0 -0
- /package/dist/{chunk-Y6QW3FJQ.js.map → chunk-U45FZY4H.js.map} +0 -0
- /package/dist/{chunk-AXW2FMVR.js.map → chunk-U65CFPRW.js.map} +0 -0
- /package/dist/{chunk-KXHUHGMC.js.map → chunk-V26RXRUA.js.map} +0 -0
- /package/dist/{chunk-WLFZOBZR.js.map → chunk-V4A3L5KR.js.map} +0 -0
- /package/dist/{chunk-AUAJVQQK.js.map → chunk-WTDEYE6F.js.map} +0 -0
- /package/dist/{chunk-RQLEGKEV.js.map → chunk-X2ZNWQBA.js.map} +0 -0
- /package/dist/{chunk-EYSXMDA7.js.map → chunk-XO6DCDIT.js.map} +0 -0
- /package/dist/{chunk-DAAJO62F.js.map → chunk-ZWNVRSGF.js.map} +0 -0
- /package/dist/{chunks-Q7242OJE.js.map → chunks-TMBS7TRD.js.map} +0 -0
- /package/dist/{generator-Q3L7RNUY.js.map → generator-KE3WTY4O.js.map} +0 -0
- /package/dist/{generator-SU73HZHR.js.map → generator-SMNLBY45.js.map} +0 -0
- /package/dist/{image-ocr-7Y3FCGRR.js.map → image-ocr-7SIIO5GO.js.map} +0 -0
- /package/dist/{image-ocr-VIGZE4YL.js.map → image-ocr-J63QUDI2.js.map} +0 -0
- /package/dist/{memo-T5ZQEXEA.js.map → memo-5MQ6DM4A.js.map} +0 -0
- /package/dist/{model-bundle-UJRQPYUU.js.map → model-bundle-72BDGCZY.js.map} +0 -0
- /package/dist/{models-64YLAWTI.js.map → models-QXVI5UHR.js.map} +0 -0
- /package/dist/{parse-worker-v2-QWQZKFQO.js.map → parse-worker-v2-RCZPPU7G.js.map} +0 -0
- /package/dist/{parser-JPWANPLM.js.map → parser-MAOMYZY5.js.map} +0 -0
- /package/dist/{parser-XFU3VRWM.js.map → parser-NZJD3JG7.js.map} +0 -0
- /package/dist/{pdf-ocr-XTZZEYKJ.js.map → pdf-ocr-ELMWWH5T.js.map} +0 -0
- /package/dist/{pdf-ocr-ZV3KYIIE.js.map → pdf-ocr-NP3BOUA5.js.map} +0 -0
- /package/dist/{profile-io-FAJORRD2.js.map → profile-io-HDWE5EY3.js.map} +0 -0
- /package/dist/{rasterize-4ZJUA2DZ.js.map → rasterize-4TQAGBZQ.js.map} +0 -0
- /package/dist/{redact-doc-JPNROEH6.js.map → redact-doc-NZVL45JN.js.map} +0 -0
- /package/dist/{render-D4WBOBKI.js.map → render-7JRZBK5R.js.map} +0 -0
- /package/dist/{rewrite-fallback-OF3QI6CX.js.map → rewrite-fallback-VYGY2GAX.js.map} +0 -0
- /package/dist/{seal-DQWEHIAM.js.map → seal-TXHDIO27.js.map} +0 -0
- /package/dist/{setup-YC25YCQB.js.map → setup-ME45RAIC.js.map} +0 -0
- /package/dist/{to-hwpx-D7OMPDUQ.js.map → to-hwpx-7XR5P4NH.js.map} +0 -0
- /package/dist/{to-hwpx-ZWN64NCQ.js.map → to-hwpx-IFL6CZ6T.js.map} +0 -0
- /package/dist/{visual-SW7NPY6K.js.map → visual-J3E3ZYN3.js.map} +0 -0
- /package/dist/{watch-ZU576VSR.js.map → watch-BAED4COV.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
escapeHtml,
|
|
7
7
|
sanitizeHref
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-V26RXRUA.js";
|
|
9
9
|
|
|
10
10
|
// src/table/builder.ts
|
|
11
11
|
var MAX_COLS = 200;
|
|
@@ -683,4 +683,4 @@ export {
|
|
|
683
683
|
hasInlineCellBlocks,
|
|
684
684
|
cellToMarkdown
|
|
685
685
|
};
|
|
686
|
-
//# sourceMappingURL=chunk-
|
|
686
|
+
//# sourceMappingURL=chunk-BZNS2FVC.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
parseRenderStyles
|
|
4
|
+
} from "./chunk-X2ZNWQBA.js";
|
|
2
5
|
import {
|
|
3
6
|
patchZipEntries
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U45FZY4H.js";
|
|
5
8
|
import {
|
|
6
9
|
applySplices,
|
|
7
10
|
scanSectionXml
|
|
8
11
|
} from "./chunk-3AHL6YEA.js";
|
|
9
|
-
import {
|
|
10
|
-
parseRenderStyles
|
|
11
|
-
} from "./chunk-RQLEGKEV.js";
|
|
12
12
|
import {
|
|
13
13
|
readZipEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DAGVJDCR.js";
|
|
15
15
|
import {
|
|
16
16
|
KordocError,
|
|
17
17
|
precheckZipSize
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V26RXRUA.js";
|
|
19
19
|
|
|
20
20
|
// src/form/seal.ts
|
|
21
21
|
import JSZip from "jszip";
|
|
@@ -321,4 +321,4 @@ export {
|
|
|
321
321
|
collectSites,
|
|
322
322
|
placeSealHwpx
|
|
323
323
|
};
|
|
324
|
-
//# sourceMappingURL=chunk-
|
|
324
|
+
//# sourceMappingURL=chunk-D4AMLUTJ.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
KordocError,
|
|
4
4
|
unzipLimitBytes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-V26RXRUA.js";
|
|
6
6
|
|
|
7
7
|
// src/hwpx/parser-shared.ts
|
|
8
8
|
import { DOMParser } from "@xmldom/xmldom";
|
|
@@ -156,4 +156,4 @@ export {
|
|
|
156
156
|
createXmlParser,
|
|
157
157
|
applyPageText
|
|
158
158
|
};
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-DAGVJDCR.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
findChildByLocalName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DAGVJDCR.js";
|
|
5
5
|
import {
|
|
6
6
|
circledHangul,
|
|
7
7
|
circledNumber,
|
|
@@ -11038,4 +11038,4 @@ export {
|
|
|
11038
11038
|
simulateWrapKeepWord,
|
|
11039
11039
|
fitRatioForFewerLines
|
|
11040
11040
|
};
|
|
11041
|
-
//# sourceMappingURL=chunk-
|
|
11041
|
+
//# sourceMappingURL=chunk-EOU3LHBZ.js.map
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
stackedGlyphBands,
|
|
38
38
|
starRun,
|
|
39
39
|
tallInkCount
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-P6UVZNSO.js";
|
|
41
41
|
import {
|
|
42
42
|
validateOcrOptions
|
|
43
43
|
} from "./chunk-TBGGAR7W.js";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
KordocError,
|
|
49
49
|
OPTIONAL_DEP_INSTALL_HINT
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-ZWNVRSGF.js";
|
|
51
51
|
|
|
52
52
|
// src/ocr/ocr-stacked-rows.ts
|
|
53
53
|
var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—·∼~]$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
|
|
@@ -85,6 +85,9 @@ function splitTable(t) {
|
|
|
85
85
|
const counts = /* @__PURE__ */ new Map();
|
|
86
86
|
for (const ls of lines) if (ls.length >= 2) counts.set(ls.length, (counts.get(ls.length) ?? 0) + 1);
|
|
87
87
|
const [k, n] = [...counts].sort((a, b) => b[1] - a[1])[0] ?? [0, 0];
|
|
88
|
+
lines.forEach((ls, i) => {
|
|
89
|
+
if (ls.length > 1 && ls.length < k && ls.every((l) => /^[가-힣A-Za-z]$/.test(l))) lines[i] = [ls.join("")];
|
|
90
|
+
});
|
|
88
91
|
const nonEmpty = lines.filter((ls) => ls.length).length;
|
|
89
92
|
const near = (ls) => ls.length >= 2 && ls.length <= k && ls.length >= Math.ceil(k * 0.8);
|
|
90
93
|
const stacked = lines.filter(near);
|
|
@@ -2327,7 +2330,11 @@ function rotateRgba(rgba, width, height, deg) {
|
|
|
2327
2330
|
|
|
2328
2331
|
// src/ocr/ocr-chart-axes.ts
|
|
2329
2332
|
var NUMBER = /^-?\d+(?:\.\d+)?%?$/;
|
|
2330
|
-
var
|
|
2333
|
+
var CLOCK = /^(\d{1,2}):(\d{2})$/;
|
|
2334
|
+
var value = (t) => {
|
|
2335
|
+
const m = CLOCK.exec(t);
|
|
2336
|
+
return m ? Number(m[1]) * 60 + Number(m[2]) : Number(t.replace(/%$/, ""));
|
|
2337
|
+
};
|
|
2331
2338
|
function evenRun(ticks) {
|
|
2332
2339
|
let best = [];
|
|
2333
2340
|
for (let s = 0; s + 1 < ticks.length; s++) {
|
|
@@ -2343,7 +2350,10 @@ function evenRun(ticks) {
|
|
|
2343
2350
|
}
|
|
2344
2351
|
return best;
|
|
2345
2352
|
}
|
|
2346
|
-
var number = (t) =>
|
|
2353
|
+
var number = (t) => {
|
|
2354
|
+
const s = t.replace(/-$/, "").trim();
|
|
2355
|
+
return NUMBER.test(s) || CLOCK.test(s) ? value(s) : null;
|
|
2356
|
+
};
|
|
2347
2357
|
function valueAxes(items) {
|
|
2348
2358
|
const nums = items.filter((it) => number(it.text) !== null);
|
|
2349
2359
|
const out = [];
|
|
@@ -2352,11 +2362,19 @@ function valueAxes(items) {
|
|
|
2352
2362
|
if (used.has(seed)) continue;
|
|
2353
2363
|
const col = nums.filter((it) => Math.abs(it.x + it.w - seed.x - seed.w) <= seed.h * 0.8).sort((a, b) => a.y - b.y);
|
|
2354
2364
|
const run = evenRun(col.map((it) => ({ pos: it.y + it.h / 2, value: number(it.text), it })));
|
|
2355
|
-
if (run.length < 4 || run[1].value > run[0].value) continue;
|
|
2365
|
+
if (run.length < (run[run.length - 1]?.value === 0 ? 3 : 4) || run[1].value > run[0].value) continue;
|
|
2356
2366
|
const ticks = run.map((r) => r.it);
|
|
2357
2367
|
for (const it of ticks) used.add(it);
|
|
2358
2368
|
const h = ticks.reduce((a, it) => a + it.h, 0) / ticks.length;
|
|
2359
|
-
out.push({
|
|
2369
|
+
out.push({
|
|
2370
|
+
x1: Math.min(...ticks.map((it) => it.x)),
|
|
2371
|
+
x2: Math.max(...ticks.map((it) => it.x + it.w)),
|
|
2372
|
+
y1: ticks[0].y,
|
|
2373
|
+
y2: ticks[ticks.length - 1].y + ticks[ticks.length - 1].h,
|
|
2374
|
+
h,
|
|
2375
|
+
zero: run[run.length - 1].value === 0,
|
|
2376
|
+
gap: (run[run.length - 1].pos - run[0].pos) / (run.length - 1)
|
|
2377
|
+
});
|
|
2360
2378
|
}
|
|
2361
2379
|
return out;
|
|
2362
2380
|
}
|
|
@@ -2382,6 +2400,18 @@ function timeAxes(items) {
|
|
|
2382
2400
|
}
|
|
2383
2401
|
return out;
|
|
2384
2402
|
}
|
|
2403
|
+
function categoryRow(items, v) {
|
|
2404
|
+
if (!v.zero) return [];
|
|
2405
|
+
const row = items.filter((it) => {
|
|
2406
|
+
const cy = it.y + it.h / 2, t = it.text.trim();
|
|
2407
|
+
return cy > v.y2 && cy < v.y2 + 3 * v.h && it.x > v.x2 && !/\d/.test(t) && /[가-힣A-Za-z]{2}/.test(t) && t.split(/\s+/).length <= 4;
|
|
2408
|
+
});
|
|
2409
|
+
if (!row.length) return [];
|
|
2410
|
+
const base = row[0].y + row[0].h / 2;
|
|
2411
|
+
const line = row.filter((it) => Math.abs(it.y + it.h / 2 - base) <= v.h * 0.6);
|
|
2412
|
+
const words = line.reduce((n, it) => n + it.text.trim().split(/\s+/).length, 0);
|
|
2413
|
+
return words >= 2 && Math.max(...line.map((it) => it.x + it.w)) > v.x2 + 6 * v.h ? line : [];
|
|
2414
|
+
}
|
|
2385
2415
|
function chartPlotItems(items) {
|
|
2386
2416
|
const drop = /* @__PURE__ */ new Set();
|
|
2387
2417
|
const verticals = valueAxes(items);
|
|
@@ -2389,8 +2419,11 @@ function chartPlotItems(items) {
|
|
|
2389
2419
|
const horizontals = timeAxes(items);
|
|
2390
2420
|
for (const v of verticals) {
|
|
2391
2421
|
const hz = horizontals.find((a) => a.y1 >= v.y2 - v.h && a.y1 <= v.y2 + 5 * v.h && a.x1 >= v.x1 - v.h && a.x1 <= v.x2 + 4 * v.h && a.x2 > v.x2 + 8 * v.h);
|
|
2392
|
-
|
|
2393
|
-
|
|
2422
|
+
const cats = hz ? [] : categoryRow(items, v);
|
|
2423
|
+
if (!hz && cats.length === 0) continue;
|
|
2424
|
+
const bottom = hz ? hz.y2 + 2.5 * v.h : Math.max(...cats.map((c) => c.y + c.h)) + 0.5 * v.h;
|
|
2425
|
+
const right = hz ? hz.x2 + 2 * v.h : Math.max(...cats.map((c) => c.x + c.w)) + v.h;
|
|
2426
|
+
const x1 = v.x1 - 5 * v.h, x2 = right, y1 = v.y1 - (hz ? 1.5 * v.h : Math.max(1.5 * v.h, v.gap ?? 0)), y2 = bottom;
|
|
2394
2427
|
items.forEach((it, i) => {
|
|
2395
2428
|
const cx = it.x + it.w / 2, cy = it.y + it.h / 2;
|
|
2396
2429
|
if (cx >= x1 && cx <= x2 && cy >= y1 && cy <= y2 && it.x >= x1 - v.h && it.x + it.w <= x2 + v.h) drop.add(i);
|
|
@@ -2460,6 +2493,46 @@ function splitOcrContactColumns(blocks) {
|
|
|
2460
2493
|
return blocks;
|
|
2461
2494
|
}
|
|
2462
2495
|
|
|
2496
|
+
// src/ocr/ocr-header-split.ts
|
|
2497
|
+
var NUMBER2 = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—]$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
|
|
2498
|
+
function splitTable4(t) {
|
|
2499
|
+
if (t.cells.length !== t.rows || t.cells.some((row) => row.length !== t.cols)) return;
|
|
2500
|
+
const own = Array.from({ length: t.rows }, () => Array(t.cols));
|
|
2501
|
+
for (let r2 = 0; r2 < t.rows; r2++) for (let c = 0; c < t.cols; c++) {
|
|
2502
|
+
if (own[r2][c]) continue;
|
|
2503
|
+
const cell = t.cells[r2][c];
|
|
2504
|
+
for (let i = r2; i < Math.min(t.rows, r2 + Math.max(1, cell.rowSpan ?? 1)); i++)
|
|
2505
|
+
for (let j = c; j < Math.min(t.cols, c + Math.max(1, cell.colSpan ?? 1)); j++) own[i][j] ??= cell;
|
|
2506
|
+
}
|
|
2507
|
+
const numericRow = (r2) => {
|
|
2508
|
+
const texts = [...new Set(own[r2])].map((c) => c.text.trim()).filter(Boolean);
|
|
2509
|
+
return texts.length >= 2 && texts.filter((s) => NUMBER2.test(s.replace(/\s+/g, ""))).length >= texts.length * 0.5;
|
|
2510
|
+
};
|
|
2511
|
+
const first = [...Array(t.rows).keys()].find(numericRow);
|
|
2512
|
+
if (first === void 0 || first < 1) return;
|
|
2513
|
+
const r = first - 1;
|
|
2514
|
+
for (let c = 0; c < t.cols; c++) {
|
|
2515
|
+
const cell = t.cells[r][c], k = cell.colSpan ?? 1;
|
|
2516
|
+
if (own[r][c] !== cell || k < 2 || (cell.rowSpan ?? 1) !== 1 || cell.blocks?.length) continue;
|
|
2517
|
+
const words = cell.text.trim().split(/\s+/);
|
|
2518
|
+
if (words.length !== k || words.some((w) => (w.match(/[가-힣]/g) ?? []).length < 2)) continue;
|
|
2519
|
+
let ok = true;
|
|
2520
|
+
for (let j = c; j < c + k && ok; j++) {
|
|
2521
|
+
const below = [...new Set(own.slice(first).map((row) => row[j]))].map((x) => x.text.trim()).filter(Boolean);
|
|
2522
|
+
ok = below.length >= 2 && below.filter((s) => NUMBER2.test(s.replace(/\s+/g, ""))).length >= below.length * 0.8;
|
|
2523
|
+
}
|
|
2524
|
+
if (!ok) continue;
|
|
2525
|
+
words.forEach((w, i) => {
|
|
2526
|
+
t.cells[r][c + i] = { ...cell, text: w, colSpan: 1 };
|
|
2527
|
+
});
|
|
2528
|
+
c += k - 1;
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
function splitOcrJoinedHeaders(blocks) {
|
|
2532
|
+
for (const b of blocks) if (b.type === "table" && b.table) splitTable4(b.table);
|
|
2533
|
+
return blocks;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2463
2536
|
// src/ocr/empty-cell-rescue.ts
|
|
2464
2537
|
var MAX_CELLS = 60;
|
|
2465
2538
|
var TOL = 3;
|
|
@@ -2860,7 +2933,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
2860
2933
|
copyOcrTextGaps(it, normalized, 1 / scale);
|
|
2861
2934
|
return normalized;
|
|
2862
2935
|
}).filter((it) => it.text);
|
|
2863
|
-
const blocks = unframeOcrLayoutTables(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(extractPageBlocksWithLines(norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables)))), pdfH);
|
|
2936
|
+
const blocks = unframeOcrLayoutTables(splitOcrJoinedHeaders(splitOcrContactColumns(splitOcrNameValueColumns(splitStackedOcrRows(extractPageBlocksWithLines(norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables))))), pdfH);
|
|
2864
2937
|
if (!figureRegion) markOcrHeadings(blocks);
|
|
2865
2938
|
return blocks;
|
|
2866
2939
|
}
|
|
@@ -2972,4 +3045,4 @@ export {
|
|
|
2972
3045
|
ocrItemsToBlocks,
|
|
2973
3046
|
markOcrHeadings
|
|
2974
3047
|
};
|
|
2975
|
-
//# sourceMappingURL=chunk-
|
|
3048
|
+
//# sourceMappingURL=chunk-G5BBHFKH.js.map
|