kordoc 4.18.0 → 4.18.1
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/dist/{-DHSHP3AB.js → -X4KTLQC6.js} +11 -11
- package/dist/{chunk-WDJJ77HP.js → chunk-2VFZQ634.js} +2 -2
- package/dist/{chunk-PGZX5JWZ.js → chunk-5PNQIF3V.js} +4 -4
- package/dist/{chunk-LLD4EY2F.js → chunk-6N5BOPJI.js} +2 -2
- package/dist/{chunk-PQZ4BDXT.js → chunk-6V7QRQY3.js} +4 -4
- package/dist/{chunk-ELTPM4HM.cjs → chunk-7DC2KL3V.cjs} +21 -21
- package/dist/{chunk-ELTPM4HM.cjs.map → chunk-7DC2KL3V.cjs.map} +1 -1
- package/dist/{chunk-WSYTO525.js → chunk-AQUNBGXH.js} +2 -2
- package/dist/{chunk-NKCKN4WW.js → chunk-CWJ5KY2F.js} +6 -6
- package/dist/{chunk-JU4DNVBP.js → chunk-HUGBJVAA.js} +17 -6
- package/dist/{chunk-JU4DNVBP.js.map → chunk-HUGBJVAA.js.map} +1 -1
- package/dist/{chunk-32FQLCUJ.js → chunk-I7YWXECO.js} +2 -2
- package/dist/{chunk-2QBZMCRT.cjs → chunk-IUMV45TX.cjs} +12 -12
- package/dist/{chunk-2QBZMCRT.cjs.map → chunk-IUMV45TX.cjs.map} +1 -1
- package/dist/{chunk-GP7BPJTU.cjs → chunk-IXAXI2S3.cjs} +3 -3
- package/dist/{chunk-GP7BPJTU.cjs.map → chunk-IXAXI2S3.cjs.map} +1 -1
- package/dist/{chunk-DSF64VZN.js → chunk-K35WIYBD.js} +2 -2
- package/dist/{chunk-GNBQXQDK.js → chunk-KBZ3MQJX.js} +2 -2
- package/dist/{chunk-DT57TAEL.js → chunk-KXR4CTFT.js} +2 -2
- package/dist/{chunk-NIPT5FJO.js → chunk-MTTYJEKA.js} +2 -2
- package/dist/{chunk-JUU2M5WI.js → chunk-NQR3VKWN.js} +2 -2
- package/dist/{chunk-CKMGVW6S.cjs → chunk-PCSOJ523.cjs} +2 -2
- package/dist/{chunk-CKMGVW6S.cjs.map → chunk-PCSOJ523.cjs.map} +1 -1
- package/dist/{chunk-VVJCQKXV.js → chunk-PWRY4W6Q.js} +2 -2
- package/dist/{chunk-F4ESJBGU.cjs → chunk-Q5N4YS3T.cjs} +21 -10
- package/dist/chunk-Q5N4YS3T.cjs.map +1 -0
- package/dist/{chunk-DTPALXTW.js → chunk-R2IFWAHI.js} +2 -2
- package/dist/{chunk-RLVALQZI.cjs → chunk-SIZ63E5G.cjs} +3 -3
- package/dist/{chunk-RLVALQZI.cjs.map → chunk-SIZ63E5G.cjs.map} +1 -1
- package/dist/{chunk-NYF7AGOX.js → chunk-SQQ4ITJ5.js} +2 -2
- package/dist/{chunk-FPU7WPQM.js → chunk-TMC4A3FM.js} +17 -6
- package/dist/chunk-TMC4A3FM.js.map +1 -0
- package/dist/{chunk-OLOMR452.js → chunk-UTVMLJZE.js} +16 -11
- package/dist/{chunk-OLOMR452.js.map → chunk-UTVMLJZE.js.map} +1 -1
- package/dist/{chunk-5JFKSCTE.js → chunk-VDIXNEWV.js} +2 -2
- package/dist/{chunk-QBTYETIU.js → chunk-WWOTHS2E.js} +3 -3
- package/dist/{chunk-UA7TQ37A.js → chunk-X625PCZM.js} +3 -3
- package/dist/{chunk-Q6SKAFWN.js → chunk-Z4KCEERM.js} +3 -3
- package/dist/chunks-ACUC63N3.js +10 -0
- package/dist/cli.js +26 -26
- package/dist/{formula-6Q2SBBQ5.js → formula-LICM6K27.js} +3 -3
- package/dist/{formula-M6JJBJ3O.js → formula-T4Q2UHWO.js} +4 -4
- package/dist/{formula-43KHT3B3.cjs → formula-W3GQC6L6.cjs} +9 -9
- package/dist/{formula-43KHT3B3.cjs.map → formula-W3GQC6L6.cjs.map} +1 -1
- package/dist/{image-ocr-22XQ4TMN.cjs → image-ocr-7PNHBD2G.cjs} +15 -15
- package/dist/{image-ocr-22XQ4TMN.cjs.map → image-ocr-7PNHBD2G.cjs.map} +1 -1
- package/dist/{image-ocr-2FIFDA7I.js → image-ocr-WZJURDX6.js} +6 -6
- package/dist/{image-ocr-TH2E6E3E.js → image-ocr-XB2NFKGZ.js} +9 -9
- package/dist/index.cjs +356 -351
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-MLEDO25V.js → model-bundle-O2XYR54X.js} +5 -5
- package/dist/{models-MYB5M4XC.js → models-SKK3NH3V.js} +5 -5
- package/dist/{parser-BKTX4GVM.js → parser-4D2M5BKY.js} +11 -11
- package/dist/{parser-WW7NWTUM.js → parser-5G5G7HHG.js} +8 -8
- package/dist/{parser-L77S4RZC.cjs → parser-PJUZSMFR.cjs} +113 -113
- package/dist/{parser-L77S4RZC.cjs.map → parser-PJUZSMFR.cjs.map} +1 -1
- package/dist/pdf-ocr-EGWOIB6O.cjs +16 -0
- package/dist/{pdf-ocr-ZWF6ZXLP.cjs.map → pdf-ocr-EGWOIB6O.cjs.map} +1 -1
- package/dist/pdf-ocr-NJTFXBRC.js +19 -0
- package/dist/pdf-ocr-ZXR6Q6BK.js +15 -0
- package/dist/{profile-io-XZPNRT4U.js → profile-io-BAQTYPK7.js} +3 -3
- package/dist/{rasterize-4EWPBCOJ.js → rasterize-A2ZEACKV.js} +3 -3
- package/dist/{redact-doc-YYCWBWGL.js → redact-doc-26KN2LSZ.js} +11 -11
- package/dist/{render-JNMBK4WF.js → render-62ZUDMHB.js} +7 -7
- package/dist/seal-3GXC2API.js +10 -0
- package/dist/{setup-NM5ICZ4U.js → setup-2A3E6WRE.js} +3 -3
- package/dist/visual-4ZBZRMCM.js +20 -0
- package/dist/{watch-PTTCHO32.js → watch-D2T5FEKT.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-F4ESJBGU.cjs.map +0 -1
- package/dist/chunk-FPU7WPQM.js.map +0 -1
- package/dist/chunks-WTZTE3OL.js +0 -10
- package/dist/pdf-ocr-IUTBPKOM.js +0 -15
- package/dist/pdf-ocr-RQUU3JBR.js +0 -19
- package/dist/pdf-ocr-ZWF6ZXLP.cjs +0 -16
- package/dist/seal-ZIVUVBLM.js +0 -10
- package/dist/visual-4W4RBIOA.js +0 -20
- /package/dist/{-DHSHP3AB.js.map → -X4KTLQC6.js.map} +0 -0
- /package/dist/{chunk-WDJJ77HP.js.map → chunk-2VFZQ634.js.map} +0 -0
- /package/dist/{chunk-PGZX5JWZ.js.map → chunk-5PNQIF3V.js.map} +0 -0
- /package/dist/{chunk-LLD4EY2F.js.map → chunk-6N5BOPJI.js.map} +0 -0
- /package/dist/{chunk-PQZ4BDXT.js.map → chunk-6V7QRQY3.js.map} +0 -0
- /package/dist/{chunk-WSYTO525.js.map → chunk-AQUNBGXH.js.map} +0 -0
- /package/dist/{chunk-NKCKN4WW.js.map → chunk-CWJ5KY2F.js.map} +0 -0
- /package/dist/{chunk-32FQLCUJ.js.map → chunk-I7YWXECO.js.map} +0 -0
- /package/dist/{chunk-DSF64VZN.js.map → chunk-K35WIYBD.js.map} +0 -0
- /package/dist/{chunk-GNBQXQDK.js.map → chunk-KBZ3MQJX.js.map} +0 -0
- /package/dist/{chunk-DT57TAEL.js.map → chunk-KXR4CTFT.js.map} +0 -0
- /package/dist/{chunk-NIPT5FJO.js.map → chunk-MTTYJEKA.js.map} +0 -0
- /package/dist/{chunk-JUU2M5WI.js.map → chunk-NQR3VKWN.js.map} +0 -0
- /package/dist/{chunk-VVJCQKXV.js.map → chunk-PWRY4W6Q.js.map} +0 -0
- /package/dist/{chunk-DTPALXTW.js.map → chunk-R2IFWAHI.js.map} +0 -0
- /package/dist/{chunk-NYF7AGOX.js.map → chunk-SQQ4ITJ5.js.map} +0 -0
- /package/dist/{chunk-5JFKSCTE.js.map → chunk-VDIXNEWV.js.map} +0 -0
- /package/dist/{chunk-QBTYETIU.js.map → chunk-WWOTHS2E.js.map} +0 -0
- /package/dist/{chunk-UA7TQ37A.js.map → chunk-X625PCZM.js.map} +0 -0
- /package/dist/{chunk-Q6SKAFWN.js.map → chunk-Z4KCEERM.js.map} +0 -0
- /package/dist/{chunks-WTZTE3OL.js.map → chunks-ACUC63N3.js.map} +0 -0
- /package/dist/{formula-6Q2SBBQ5.js.map → formula-LICM6K27.js.map} +0 -0
- /package/dist/{formula-M6JJBJ3O.js.map → formula-T4Q2UHWO.js.map} +0 -0
- /package/dist/{image-ocr-2FIFDA7I.js.map → image-ocr-WZJURDX6.js.map} +0 -0
- /package/dist/{image-ocr-TH2E6E3E.js.map → image-ocr-XB2NFKGZ.js.map} +0 -0
- /package/dist/{model-bundle-MLEDO25V.js.map → model-bundle-O2XYR54X.js.map} +0 -0
- /package/dist/{models-MYB5M4XC.js.map → models-SKK3NH3V.js.map} +0 -0
- /package/dist/{parser-BKTX4GVM.js.map → parser-4D2M5BKY.js.map} +0 -0
- /package/dist/{parser-WW7NWTUM.js.map → parser-5G5G7HHG.js.map} +0 -0
- /package/dist/{pdf-ocr-IUTBPKOM.js.map → pdf-ocr-NJTFXBRC.js.map} +0 -0
- /package/dist/{pdf-ocr-RQUU3JBR.js.map → pdf-ocr-ZXR6Q6BK.js.map} +0 -0
- /package/dist/{profile-io-XZPNRT4U.js.map → profile-io-BAQTYPK7.js.map} +0 -0
- /package/dist/{rasterize-4EWPBCOJ.js.map → rasterize-A2ZEACKV.js.map} +0 -0
- /package/dist/{redact-doc-YYCWBWGL.js.map → redact-doc-26KN2LSZ.js.map} +0 -0
- /package/dist/{render-JNMBK4WF.js.map → render-62ZUDMHB.js.map} +0 -0
- /package/dist/{seal-ZIVUVBLM.js.map → seal-3GXC2API.js.map} +0 -0
- /package/dist/{setup-NM5ICZ4U.js.map → setup-2A3E6WRE.js.map} +0 -0
- /package/dist/{visual-4W4RBIOA.js.map → visual-4ZBZRMCM.js.map} +0 -0
- /package/dist/{watch-PTTCHO32.js.map → watch-D2T5FEKT.js.map} +0 -0
|
@@ -50,17 +50,17 @@ import {
|
|
|
50
50
|
unknownFontWarnings,
|
|
51
51
|
usesGaejosikMunche,
|
|
52
52
|
validateHwpx
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-UTVMLJZE.js";
|
|
54
54
|
import {
|
|
55
55
|
blocksToPages
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-PWRY4W6Q.js";
|
|
57
57
|
import {
|
|
58
58
|
applySplices,
|
|
59
59
|
buildParagraphSplices,
|
|
60
60
|
buildRangeSplices,
|
|
61
61
|
placeSealHwpx,
|
|
62
62
|
scanSectionXml
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-Z4KCEERM.js";
|
|
64
64
|
import {
|
|
65
65
|
DEFAULT_REDACT_RULES,
|
|
66
66
|
redactMarkdown,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
} from "./chunk-3WSNLH4B.js";
|
|
69
69
|
import {
|
|
70
70
|
blocksToChunks
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-2VFZQ634.js";
|
|
72
72
|
import {
|
|
73
73
|
SPACE_EM_FIXED,
|
|
74
74
|
SPACE_EM_FONT,
|
|
@@ -93,20 +93,20 @@ import {
|
|
|
93
93
|
renderSceneToHtml,
|
|
94
94
|
simulateWrap,
|
|
95
95
|
simulateWrapKeepWord
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-CWJ5KY2F.js";
|
|
97
97
|
import "./chunk-7FCNOKOR.js";
|
|
98
|
-
import "./chunk-
|
|
98
|
+
import "./chunk-TMC4A3FM.js";
|
|
99
99
|
import "./chunk-VQFA55IC.js";
|
|
100
|
-
import "./chunk-
|
|
100
|
+
import "./chunk-6N5BOPJI.js";
|
|
101
101
|
import {
|
|
102
102
|
blocksToMarkdown,
|
|
103
103
|
flattenLayoutTables,
|
|
104
104
|
hasStructuredCellContent
|
|
105
|
-
} from "./chunk-
|
|
106
|
-
import "./chunk-
|
|
105
|
+
} from "./chunk-K35WIYBD.js";
|
|
106
|
+
import "./chunk-AQUNBGXH.js";
|
|
107
107
|
import {
|
|
108
108
|
VERSION
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-I7YWXECO.js";
|
|
110
110
|
export {
|
|
111
111
|
BUILTIN_TEMPLATES,
|
|
112
112
|
DEFAULT_REDACT_RULES,
|
|
@@ -196,4 +196,4 @@ export {
|
|
|
196
196
|
usesGaejosikMunche,
|
|
197
197
|
validateHwpx
|
|
198
198
|
};
|
|
199
|
-
//# sourceMappingURL=-
|
|
199
|
+
//# sourceMappingURL=-X4KTLQC6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToMarkdown
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K35WIYBD.js";
|
|
5
5
|
|
|
6
6
|
// src/chunks.ts
|
|
7
7
|
var LIST_MARKER_RE = /^(?:[□■◇◆○◎●◦ㅇ•▪▸▶※-]|\d{1,3}[.)]|[가나다라마바사아자차카타파하][.)]|\([가나다라마바사아자차카타파하0-9]{1,3}\)|[①-⑳㉮-㉻㈎-㈛])\s/;
|
|
@@ -79,4 +79,4 @@ function blocksToChunks(blocks, options) {
|
|
|
79
79
|
export {
|
|
80
80
|
blocksToChunks
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-2VFZQ634.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
extractPageBlocksWithLines
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WWOTHS2E.js";
|
|
5
5
|
import {
|
|
6
6
|
OCR_DET_MODEL,
|
|
7
7
|
OCR_REC_DICT,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
ensureOcrModels,
|
|
10
10
|
getOcrModelsDir,
|
|
11
11
|
parseCharacterDict
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-R2IFWAHI.js";
|
|
13
13
|
import {
|
|
14
14
|
OPTIONAL_DEP_INSTALL_HINT
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I7YWXECO.js";
|
|
16
16
|
|
|
17
17
|
// src/ocr/ruling-lines.ts
|
|
18
18
|
var INK_LUMA_MAX = 205;
|
|
@@ -2061,4 +2061,4 @@ export {
|
|
|
2061
2061
|
runPdfOcr,
|
|
2062
2062
|
ocrItemsToBlocks
|
|
2063
2063
|
};
|
|
2064
|
-
//# sourceMappingURL=chunk-
|
|
2064
|
+
//# sourceMappingURL=chunk-5PNQIF3V.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
KordocError,
|
|
4
4
|
unzipLimitBytes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-I7YWXECO.js";
|
|
6
6
|
|
|
7
7
|
// src/hwpx/parser-shared.ts
|
|
8
8
|
import { DOMParser } from "@xmldom/xmldom";
|
|
@@ -336,4 +336,4 @@ export {
|
|
|
336
336
|
hwpFaceToCssStack,
|
|
337
337
|
parseRenderStyles
|
|
338
338
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-6N5BOPJI.js.map
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
HEADING_RATIO_H2,
|
|
5
5
|
HEADING_RATIO_H3,
|
|
6
6
|
tidyScriptTags
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HUGBJVAA.js";
|
|
8
8
|
import {
|
|
9
9
|
ensureModelsIn,
|
|
10
10
|
getModelsDir
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KXR4CTFT.js";
|
|
12
12
|
import {
|
|
13
13
|
safeMax,
|
|
14
14
|
safeMin
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VDIXNEWV.js";
|
|
16
16
|
|
|
17
17
|
// src/ocr/models.ts
|
|
18
18
|
import { join } from "path";
|
|
@@ -7611,4 +7611,4 @@ export {
|
|
|
7611
7611
|
joinCellEdges,
|
|
7612
7612
|
extractPageBlocksWithLines
|
|
7613
7613
|
};
|
|
7614
|
-
//# sourceMappingURL=chunk-
|
|
7614
|
+
//# sourceMappingURL=chunk-6V7QRQY3.js.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkQ5N4YS3Tcjs = require('./chunk-Q5N4YS3T.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkSIZ63E5Gcjs = require('./chunk-SIZ63E5G.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkPCSOJ523cjs = require('./chunk-PCSOJ523.cjs');
|
|
16
16
|
|
|
17
17
|
// src/ocr/models.ts
|
|
18
18
|
var _path = require('path');
|
|
@@ -40,10 +40,10 @@ var OCR_REC_DICT = {
|
|
|
40
40
|
};
|
|
41
41
|
var ALL_OCR_MODELS = [OCR_DET_MODEL, OCR_REC_MODEL, OCR_REC_DICT];
|
|
42
42
|
function getOcrModelsDir() {
|
|
43
|
-
return
|
|
43
|
+
return _chunkSIZ63E5Gcjs.getModelsDir.call(void 0, "ppocr");
|
|
44
44
|
}
|
|
45
45
|
async function ensureOcrModels(onProgress) {
|
|
46
|
-
return
|
|
46
|
+
return _chunkSIZ63E5Gcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
|
|
47
47
|
}
|
|
48
48
|
async function ocrModelsCached() {
|
|
49
49
|
const dir = getOcrModelsDir();
|
|
@@ -2090,7 +2090,7 @@ function tagScripts(text, lines) {
|
|
|
2090
2090
|
const [s, e, kind] = marks[m];
|
|
2091
2091
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2092
2092
|
}
|
|
2093
|
-
return
|
|
2093
|
+
return _chunkQ5N4YS3Tcjs.tidyScriptTags.call(void 0, out);
|
|
2094
2094
|
}
|
|
2095
2095
|
|
|
2096
2096
|
// src/pdf/line-wrap.ts
|
|
@@ -3641,9 +3641,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
3641
3641
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
3642
3642
|
const ratio = block.style.fontSize / medianFontSize;
|
|
3643
3643
|
let level = 0;
|
|
3644
|
-
if (ratio >=
|
|
3645
|
-
else if (ratio >=
|
|
3646
|
-
else if (ratio >=
|
|
3644
|
+
if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H1) level = 1;
|
|
3645
|
+
else if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H2) level = 2;
|
|
3646
|
+
else if (ratio >= _chunkQ5N4YS3Tcjs.HEADING_RATIO_H3) level = 3;
|
|
3647
3647
|
if (level > 0) {
|
|
3648
3648
|
block.type = "heading";
|
|
3649
3649
|
block.level = level;
|
|
@@ -3656,7 +3656,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
3656
3656
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _94 => _94.style, 'optionalAccess', _95 => _95.fontSize]), () => ( 0));
|
|
3657
3657
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _96 => _96.text, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()]), () => ( ""));
|
|
3658
3658
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _99 => _99.bbox]);
|
|
3659
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _100 => _100.text, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
3659
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _100 => _100.text, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkQ5N4YS3Tcjs.HEADING_RATIO_H1 && text.length > 0 && text.length <= 80 && !/^[\d\s.]+$/.test(text) && !!a && !!b && a.y > b.y && a.y - (b.y + b.height) <= size * 2;
|
|
3660
3660
|
}
|
|
3661
3661
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
3662
3662
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -5565,16 +5565,16 @@ function isProseSpread(items) {
|
|
|
5565
5565
|
for (let i = 1; i < sorted.length; i++) {
|
|
5566
5566
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
5567
5567
|
}
|
|
5568
|
-
const maxGap =
|
|
5568
|
+
const maxGap = _chunkPCSOJ523cjs.safeMax.call(void 0, gaps);
|
|
5569
5569
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
5570
5570
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
5571
|
-
const minGap =
|
|
5571
|
+
const minGap = _chunkPCSOJ523cjs.safeMin.call(void 0, gaps);
|
|
5572
5572
|
return minGap > 0 && maxGap - minGap <= Math.max(2, maxGap * 0.15) && items.filter((i) => /^\P{L}*\p{Ll}/u.test(i.text)).length * 2 >= items.length;
|
|
5573
5573
|
}
|
|
5574
5574
|
function detectColumns(yLines) {
|
|
5575
5575
|
const allItems = yLines.flat();
|
|
5576
5576
|
if (allItems.length === 0) return null;
|
|
5577
|
-
const pageWidth =
|
|
5577
|
+
const pageWidth = _chunkPCSOJ523cjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkPCSOJ523cjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
5578
5578
|
if (pageWidth < 100) return null;
|
|
5579
5579
|
let bigoLineIdx = -1;
|
|
5580
5580
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -6012,12 +6012,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
|
|
|
6012
6012
|
}
|
|
6013
6013
|
function takeClipCellEdges(from, to) {
|
|
6014
6014
|
const e = CLIP_CELL_EDGES.get(from);
|
|
6015
|
-
if (e)
|
|
6015
|
+
if (e) _chunkQ5N4YS3Tcjs.CELL_EDGES.set(to, e);
|
|
6016
6016
|
}
|
|
6017
6017
|
function joinCellEdges(a, b) {
|
|
6018
|
-
const u =
|
|
6018
|
+
const u = _chunkQ5N4YS3Tcjs.CELL_EDGES.get(a), d = _chunkQ5N4YS3Tcjs.CELL_EDGES.get(b);
|
|
6019
6019
|
if (!u || !d) return;
|
|
6020
|
-
|
|
6020
|
+
_chunkQ5N4YS3Tcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
6021
6021
|
}
|
|
6022
6022
|
|
|
6023
6023
|
// src/pdf/table-unit-row.ts
|
|
@@ -6033,7 +6033,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
6033
6033
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
6034
6034
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
6035
6035
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
6036
|
-
for (const cell of cells[0])
|
|
6036
|
+
for (const cell of cells[0]) _chunkQ5N4YS3Tcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
6037
6037
|
for (const item of line) usedItems.add(item);
|
|
6038
6038
|
}
|
|
6039
6039
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7204,7 +7204,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7204
7204
|
if (gutterX !== null) {
|
|
7205
7205
|
const gx = gutterX;
|
|
7206
7206
|
const allY = remaining.map((i) => i.y);
|
|
7207
|
-
const pageH =
|
|
7207
|
+
const pageH = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
|
|
7208
7208
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
7209
7209
|
const sides = [
|
|
7210
7210
|
remaining.filter((i) => i.x + i.w <= gx),
|
|
@@ -7224,7 +7224,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7224
7224
|
finalTextBlocks = detectListBlocks(textBlocks);
|
|
7225
7225
|
} else {
|
|
7226
7226
|
const allY = remaining.map((i) => i.y);
|
|
7227
|
-
const pageH =
|
|
7227
|
+
const pageH = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
|
|
7228
7228
|
const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
|
|
7229
7229
|
const textBlocks = [];
|
|
7230
7230
|
for (const group of groups) {
|
|
@@ -7543,7 +7543,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
7543
7543
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
7544
7544
|
} else {
|
|
7545
7545
|
const allY = items.map((i) => i.y);
|
|
7546
|
-
const pageHeight =
|
|
7546
|
+
const pageHeight = _chunkPCSOJ523cjs.safeMax.call(void 0, allY) - _chunkPCSOJ523cjs.safeMin.call(void 0, allY);
|
|
7547
7547
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
7548
7548
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
|
|
7549
7549
|
for (const group of orderedGroups) {
|
|
@@ -7611,4 +7611,4 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
7611
7611
|
|
|
7612
7612
|
|
|
7613
7613
|
exports.OCR_DET_MODEL = OCR_DET_MODEL; exports.OCR_REC_MODEL = OCR_REC_MODEL; exports.OCR_REC_DICT = OCR_REC_DICT; exports.getOcrModelsDir = getOcrModelsDir; exports.ensureOcrModels = ensureOcrModels; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.filterHiddenText = filterHiddenText; exports.collapseEvenSpacing = collapseEvenSpacing; exports.normalizeItems = normalizeItems; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.latinSoftWrap = latinSoftWrap; exports.TOC_BLOCKS = TOC_BLOCKS; exports.computeMedianFontSizeFromFreq = computeMedianFontSizeFromFreq; exports.detectHeadings = detectHeadings; exports.mergeStackedHeadingLines = mergeStackedHeadingLines; exports.detectTypographyHeadings = detectTypographyHeadings; exports.detectDocumentStyleHeadings = detectDocumentStyleHeadings; exports.detectSiblingStyleHeadings = detectSiblingStyleHeadings; exports.detectRepeatedPageLabels = detectRepeatedPageLabels; exports.detectPageLeadHeadings = detectPageLeadHeadings; exports.refineDocumentStyleHeadings = refineDocumentStyleHeadings; exports.detectMarkerHeadings = detectMarkerHeadings; exports.detectTableCaptions = detectTableCaptions; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks; exports.CLIP_TABLES = CLIP_TABLES; exports.TABLE_COLXS = TABLE_COLXS; exports.TABLE_ROWYS = TABLE_ROWYS; exports.TABLE_TAIL = TABLE_TAIL; exports.PART_COLXS = PART_COLXS; exports.EMPTY_PARTS = EMPTY_PARTS; exports.IMAGE_CELLS = IMAGE_CELLS; exports.FILLER_CELLS = FILLER_CELLS; exports.CONT_PARTS = CONT_PARTS; exports.CELL_LINES = CELL_LINES; exports.ROW_RULES = ROW_RULES; exports.trimTrailingEmptyTableCols = trimTrailingEmptyTableCols; exports.NO_EDGES = NO_EDGES; exports.joinCellEdges = joinCellEdges; exports.extractPageBlocksWithLines = extractPageBlocksWithLines;
|
|
7614
|
-
//# sourceMappingURL=chunk-
|
|
7614
|
+
//# sourceMappingURL=chunk-7DC2KL3V.cjs.map
|