kordoc 4.21.12 → 4.21.13
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 +19 -4
- package/dist/{-RX7XZ3YG.js → -4UPN43UD.js} +11 -11
- package/dist/{chunk-73GNY7ZX.js → chunk-3YD3SAQW.js} +3 -3
- package/dist/{chunk-JILWW4LO.cjs → chunk-57EOUEB4.cjs} +13 -13
- package/dist/{chunk-JILWW4LO.cjs.map → chunk-57EOUEB4.cjs.map} +1 -1
- package/dist/{chunk-GTNCTRNQ.js → chunk-6EB77P5L.js} +2 -2
- package/dist/{chunk-OOTAJZXG.js → chunk-B7CZZBKZ.js} +2 -2
- package/dist/{chunk-UB55GFHD.js → chunk-C7OK4MBX.js} +3 -3
- package/dist/{chunk-7BHPPEWK.js → chunk-DAR2TMBL.js} +10 -10
- package/dist/{chunk-4OQ3JGNI.js → chunk-DI7WHDXG.js} +2 -2
- package/dist/{chunk-ZUFZNZHO.cjs → chunk-DU2HC36X.cjs} +22 -22
- package/dist/{chunk-ZUFZNZHO.cjs.map → chunk-DU2HC36X.cjs.map} +1 -1
- package/dist/{chunk-UJARPT2G.js → chunk-FFBZG5MK.js} +2 -2
- package/dist/{chunk-2SOILEGV.js → chunk-FW7QWLBL.js} +3 -3
- package/dist/{chunk-FM33S6NN.js → chunk-HCCQTNDS.js} +2 -2
- package/dist/{chunk-D37FRGQT.js → chunk-HIUHLJQD.js} +2 -2
- package/dist/{chunk-XER4EWKZ.cjs → chunk-IS2EXA5D.cjs} +6 -6
- package/dist/{chunk-XER4EWKZ.cjs.map → chunk-IS2EXA5D.cjs.map} +1 -1
- package/dist/{chunk-SBHOOTMT.js → chunk-JGAY3BHY.js} +3 -3
- package/dist/{chunk-R6MRWKSL.js → chunk-JQBUWC6W.js} +2 -2
- package/dist/{chunk-YGQBX5D3.js → chunk-K23A2CP7.js} +2 -2
- package/dist/{chunk-IUHBMZT2.cjs → chunk-LOO3UV25.cjs} +3 -3
- package/dist/{chunk-IUHBMZT2.cjs.map → chunk-LOO3UV25.cjs.map} +1 -1
- package/dist/{chunk-4BGPR423.js → chunk-LXYM2EST.js} +2 -2
- package/dist/{chunk-AQBOKFSW.js → chunk-N4UL5NEO.js} +4 -4
- package/dist/{chunk-A6CQXV52.js → chunk-NX5A22B6.js} +2 -2
- package/dist/{chunk-QVMQ2NDS.js → chunk-QOIZF57S.js} +2 -2
- package/dist/{chunk-4QVMW26U.js → chunk-RMMMNE2V.js} +4 -4
- package/dist/{chunk-4PNWGIFX.js → chunk-UAEY6VPV.js} +6 -6
- package/dist/{chunk-5JNM2FTX.cjs → chunk-V7LTELVS.cjs} +3 -3
- package/dist/{chunk-5JNM2FTX.cjs.map → chunk-V7LTELVS.cjs.map} +1 -1
- package/dist/{chunk-OAU5DO2L.js → chunk-VC2SS3OH.js} +2 -2
- package/dist/{chunk-Y27V3EBB.js → chunk-VXNR2JYB.js} +2 -2
- package/dist/{chunk-W5EQNSO6.cjs → chunk-WPZOIIM2.cjs} +2 -2
- package/dist/{chunk-W5EQNSO6.cjs.map → chunk-WPZOIIM2.cjs.map} +1 -1
- package/dist/{chunk-W5MRFI5K.js → chunk-YJ4J6EG5.js} +2 -2
- package/dist/{chunk-PBNL6TOS.js → chunk-YM4AEOS4.js} +2 -2
- package/dist/chunks-A67IJS56.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-E3BHMBU7.cjs → formula-BCWYXJPE.cjs} +9 -9
- package/dist/{formula-E3BHMBU7.cjs.map → formula-BCWYXJPE.cjs.map} +1 -1
- package/dist/{formula-AT252TKF.js → formula-N4TZPWWU.js} +4 -4
- package/dist/{formula-VUABWUUV.js → formula-ZFB6JGOW.js} +3 -3
- package/dist/{image-ocr-JYUWUJVP.js → image-ocr-4Y23NCW4.js} +9 -9
- package/dist/{image-ocr-RXNTLXZ4.js → image-ocr-7YHK7Q4C.js} +6 -6
- package/dist/{image-ocr-24253ZWW.cjs → image-ocr-RE7BFBGV.cjs} +15 -15
- package/dist/{image-ocr-24253ZWW.cjs.map → image-ocr-RE7BFBGV.cjs.map} +1 -1
- package/dist/index.cjs +276 -276
- package/dist/index.js +5 -5
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-KPTPEAK5.js → model-bundle-WISSN6YF.js} +5 -5
- package/dist/{models-34A4VIVW.js → models-SG4VHU65.js} +5 -5
- package/dist/{parse-worker-v2-HYLWPIVX.js → parse-worker-v2-VNLAK2VC.js} +33 -16
- package/dist/parse-worker-v2-VNLAK2VC.js.map +1 -0
- package/dist/{parser-JRVDYJJ6.cjs → parser-KYZD3NNB.cjs} +257 -234
- package/dist/parser-KYZD3NNB.cjs.map +1 -0
- package/dist/{parser-FQLPABMD.js → parser-V3R7TKU5.js} +37 -14
- package/dist/parser-V3R7TKU5.js.map +1 -0
- package/dist/{parser-OJAOIUTR.js → parser-VPVVJDB3.js} +34 -11
- package/dist/parser-VPVVJDB3.js.map +1 -0
- package/dist/pdf-ocr-G2SX5FKB.cjs +19 -0
- package/dist/{pdf-ocr-TLUFBJKD.cjs.map → pdf-ocr-G2SX5FKB.cjs.map} +1 -1
- package/dist/pdf-ocr-KNNBYXVO.js +22 -0
- package/dist/pdf-ocr-PP2GGLS3.js +18 -0
- package/dist/{profile-io-SFW2AOCN.js → profile-io-72YURUWT.js} +3 -3
- package/dist/{rasterize-S4X4E2CH.js → rasterize-UPE2IZLP.js} +3 -3
- package/dist/{redact-doc-ZYUGJ7BI.js → redact-doc-GW6ILR52.js} +11 -11
- package/dist/{render-I7CNQ2H7.js → render-2XLPO3ZA.js} +7 -7
- package/dist/seal-VLJCGOP7.js +10 -0
- package/dist/{setup-H6A2OJMU.js → setup-GE4JKPHY.js} +3 -3
- package/dist/visual-7NPMIPSC.js +20 -0
- package/dist/{watch-GFZYBGKG.js → watch-XBVNOG6B.js} +12 -12
- package/package.json +7 -2
- package/dist/chunks-DNAX75UI.js +0 -10
- package/dist/parse-worker-v2-HYLWPIVX.js.map +0 -1
- package/dist/parser-FQLPABMD.js.map +0 -1
- package/dist/parser-JRVDYJJ6.cjs.map +0 -1
- package/dist/parser-OJAOIUTR.js.map +0 -1
- package/dist/pdf-ocr-KIQBC3N7.js +0 -22
- package/dist/pdf-ocr-TLUFBJKD.cjs +0 -19
- package/dist/pdf-ocr-ZYCLPDS4.js +0 -18
- package/dist/seal-ZHGMRUHX.js +0 -10
- package/dist/visual-NOQSOXZ5.js +0 -20
- /package/dist/{-RX7XZ3YG.js.map → -4UPN43UD.js.map} +0 -0
- /package/dist/{chunk-73GNY7ZX.js.map → chunk-3YD3SAQW.js.map} +0 -0
- /package/dist/{chunk-GTNCTRNQ.js.map → chunk-6EB77P5L.js.map} +0 -0
- /package/dist/{chunk-OOTAJZXG.js.map → chunk-B7CZZBKZ.js.map} +0 -0
- /package/dist/{chunk-UB55GFHD.js.map → chunk-C7OK4MBX.js.map} +0 -0
- /package/dist/{chunk-7BHPPEWK.js.map → chunk-DAR2TMBL.js.map} +0 -0
- /package/dist/{chunk-4OQ3JGNI.js.map → chunk-DI7WHDXG.js.map} +0 -0
- /package/dist/{chunk-UJARPT2G.js.map → chunk-FFBZG5MK.js.map} +0 -0
- /package/dist/{chunk-2SOILEGV.js.map → chunk-FW7QWLBL.js.map} +0 -0
- /package/dist/{chunk-FM33S6NN.js.map → chunk-HCCQTNDS.js.map} +0 -0
- /package/dist/{chunk-D37FRGQT.js.map → chunk-HIUHLJQD.js.map} +0 -0
- /package/dist/{chunk-SBHOOTMT.js.map → chunk-JGAY3BHY.js.map} +0 -0
- /package/dist/{chunk-R6MRWKSL.js.map → chunk-JQBUWC6W.js.map} +0 -0
- /package/dist/{chunk-YGQBX5D3.js.map → chunk-K23A2CP7.js.map} +0 -0
- /package/dist/{chunk-4BGPR423.js.map → chunk-LXYM2EST.js.map} +0 -0
- /package/dist/{chunk-AQBOKFSW.js.map → chunk-N4UL5NEO.js.map} +0 -0
- /package/dist/{chunk-A6CQXV52.js.map → chunk-NX5A22B6.js.map} +0 -0
- /package/dist/{chunk-QVMQ2NDS.js.map → chunk-QOIZF57S.js.map} +0 -0
- /package/dist/{chunk-4QVMW26U.js.map → chunk-RMMMNE2V.js.map} +0 -0
- /package/dist/{chunk-4PNWGIFX.js.map → chunk-UAEY6VPV.js.map} +0 -0
- /package/dist/{chunk-OAU5DO2L.js.map → chunk-VC2SS3OH.js.map} +0 -0
- /package/dist/{chunk-Y27V3EBB.js.map → chunk-VXNR2JYB.js.map} +0 -0
- /package/dist/{chunk-W5MRFI5K.js.map → chunk-YJ4J6EG5.js.map} +0 -0
- /package/dist/{chunk-PBNL6TOS.js.map → chunk-YM4AEOS4.js.map} +0 -0
- /package/dist/{chunks-DNAX75UI.js.map → chunks-A67IJS56.js.map} +0 -0
- /package/dist/{formula-AT252TKF.js.map → formula-N4TZPWWU.js.map} +0 -0
- /package/dist/{formula-VUABWUUV.js.map → formula-ZFB6JGOW.js.map} +0 -0
- /package/dist/{image-ocr-JYUWUJVP.js.map → image-ocr-4Y23NCW4.js.map} +0 -0
- /package/dist/{image-ocr-RXNTLXZ4.js.map → image-ocr-7YHK7Q4C.js.map} +0 -0
- /package/dist/{model-bundle-KPTPEAK5.js.map → model-bundle-WISSN6YF.js.map} +0 -0
- /package/dist/{models-34A4VIVW.js.map → models-SG4VHU65.js.map} +0 -0
- /package/dist/{pdf-ocr-KIQBC3N7.js.map → pdf-ocr-KNNBYXVO.js.map} +0 -0
- /package/dist/{pdf-ocr-ZYCLPDS4.js.map → pdf-ocr-PP2GGLS3.js.map} +0 -0
- /package/dist/{profile-io-SFW2AOCN.js.map → profile-io-72YURUWT.js.map} +0 -0
- /package/dist/{rasterize-S4X4E2CH.js.map → rasterize-UPE2IZLP.js.map} +0 -0
- /package/dist/{redact-doc-ZYUGJ7BI.js.map → redact-doc-GW6ILR52.js.map} +0 -0
- /package/dist/{render-I7CNQ2H7.js.map → render-2XLPO3ZA.js.map} +0 -0
- /package/dist/{seal-ZHGMRUHX.js.map → seal-VLJCGOP7.js.map} +0 -0
- /package/dist/{setup-H6A2OJMU.js.map → setup-GE4JKPHY.js.map} +0 -0
- /package/dist/{visual-NOQSOXZ5.js.map → visual-7NPMIPSC.js.map} +0 -0
- /package/dist/{watch-GFZYBGKG.js.map → watch-XBVNOG6B.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ensureModelsIn,
|
|
4
4
|
getModelStatusIn,
|
|
5
5
|
getModelsDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HIUHLJQD.js";
|
|
7
7
|
|
|
8
8
|
// src/ocr/models.ts
|
|
9
9
|
import { join } from "path";
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
parseCharacterDict,
|
|
94
94
|
ocrModelPath
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-6EB77P5L.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KordocError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JQBUWC6W.js";
|
|
4
4
|
|
|
5
5
|
// src/pdf/formula/models.ts
|
|
6
6
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -308,4 +308,4 @@ export {
|
|
|
308
308
|
ensureFormulaModels,
|
|
309
309
|
ensureSingleModel
|
|
310
310
|
};
|
|
311
|
-
//# sourceMappingURL=chunk-
|
|
311
|
+
//# sourceMappingURL=chunk-B7CZZBKZ.js.map
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
extractPageBlocksWithLines,
|
|
11
11
|
getOcrModelsDir,
|
|
12
12
|
parseCharacterDict
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-N4UL5NEO.js";
|
|
14
14
|
import {
|
|
15
15
|
OPTIONAL_DEP_INSTALL_HINT
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JQBUWC6W.js";
|
|
17
17
|
|
|
18
18
|
// src/ocr/ruling-lines.ts
|
|
19
19
|
var INK_LUMA_MAX = 205;
|
|
@@ -2130,4 +2130,4 @@ export {
|
|
|
2130
2130
|
groupOcrLines,
|
|
2131
2131
|
ocrItemsToBlocks
|
|
2132
2132
|
};
|
|
2133
|
-
//# sourceMappingURL=chunk-
|
|
2133
|
+
//# sourceMappingURL=chunk-C7OK4MBX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToPages
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FFBZG5MK.js";
|
|
5
5
|
import {
|
|
6
6
|
allLinesegRemovalSplices,
|
|
7
7
|
applySplices,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
patchZipEntries,
|
|
17
17
|
readZipEntries,
|
|
18
18
|
scanSectionXml
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-JGAY3BHY.js";
|
|
20
20
|
import {
|
|
21
21
|
CONVERT_MAP,
|
|
22
22
|
FLAG_COMPRESSED,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
romanNumeral,
|
|
68
68
|
simulateWrap,
|
|
69
69
|
takeTocLeaders
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-UAEY6VPV.js";
|
|
71
71
|
import {
|
|
72
72
|
inlineImagesIntoMarkdown
|
|
73
73
|
} from "./chunk-7FCNOKOR.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
tidyScriptTags,
|
|
83
83
|
unframeLayoutTables,
|
|
84
84
|
wrapScript
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-YM4AEOS4.js";
|
|
86
86
|
import {
|
|
87
87
|
parsePageRange
|
|
88
88
|
} from "./chunk-VQFA55IC.js";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
localName,
|
|
103
103
|
rawTextContent,
|
|
104
104
|
readZipEntry
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-YJ4J6EG5.js";
|
|
106
106
|
import {
|
|
107
107
|
MAX_COLS,
|
|
108
108
|
MAX_ROWS,
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
hasStructuredCellContent,
|
|
118
118
|
mapPuaText,
|
|
119
119
|
noteSuffix
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-QOIZF57S.js";
|
|
121
121
|
import {
|
|
122
122
|
KordocError,
|
|
123
123
|
classifyError,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
toArrayBuffer,
|
|
134
134
|
unescapeHtml,
|
|
135
135
|
unzipLimitBytes
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-LXYM2EST.js";
|
|
137
137
|
|
|
138
138
|
// src/table/visual.ts
|
|
139
139
|
import { readFile as readFile2 } from "fs/promises";
|
|
@@ -30754,7 +30754,7 @@ function scriptsOff(r, off) {
|
|
|
30754
30754
|
}
|
|
30755
30755
|
async function parseImage(buffer, options) {
|
|
30756
30756
|
try {
|
|
30757
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
30757
|
+
const { parseImageDocument } = await import("./image-ocr-4Y23NCW4.js");
|
|
30758
30758
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
30759
30759
|
stripScriptTags({ blocks });
|
|
30760
30760
|
return {
|
|
@@ -30814,7 +30814,7 @@ async function parseHwp(buffer, options) {
|
|
|
30814
30814
|
async function parsePdf(buffer, options) {
|
|
30815
30815
|
let parsePdfDocument;
|
|
30816
30816
|
try {
|
|
30817
|
-
const mod = await import("./parser-
|
|
30817
|
+
const mod = await import("./parser-V3R7TKU5.js");
|
|
30818
30818
|
parsePdfDocument = mod.parsePdfDocument;
|
|
30819
30819
|
} catch {
|
|
30820
30820
|
return {
|
|
@@ -31044,4 +31044,4 @@ export {
|
|
|
31044
31044
|
parseHwpml,
|
|
31045
31045
|
fillForm
|
|
31046
31046
|
};
|
|
31047
|
-
//# sourceMappingURL=chunk-
|
|
31047
|
+
//# sourceMappingURL=chunk-DAR2TMBL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
escapeHtml,
|
|
3
3
|
sanitizeHref
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JQBUWC6W.js";
|
|
5
5
|
|
|
6
6
|
// src/script-tags.ts
|
|
7
7
|
var LITERAL_TAG = /<(?=\/?(?:u|sup|sub)>)/g;
|
|
@@ -1359,4 +1359,4 @@ export {
|
|
|
1359
1359
|
HEADING_RATIO_H2,
|
|
1360
1360
|
HEADING_RATIO_H3
|
|
1361
1361
|
};
|
|
1362
|
-
//# sourceMappingURL=chunk-
|
|
1362
|
+
//# sourceMappingURL=chunk-DI7WHDXG.js.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIS2EXA5Dcjs = require('./chunk-IS2EXA5D.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkV7LTELVScjs = require('./chunk-V7LTELVS.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkWPZOIIM2cjs = require('./chunk-WPZOIIM2.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 _chunkV7LTELVScjs.getModelsDir.call(void 0, "ppocr");
|
|
44
44
|
}
|
|
45
45
|
async function ensureOcrModels(onProgress) {
|
|
46
|
-
return
|
|
46
|
+
return _chunkV7LTELVScjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
|
|
47
47
|
}
|
|
48
48
|
async function ocrModelsCached() {
|
|
49
49
|
const dir = getOcrModelsDir();
|
|
@@ -2123,7 +2123,7 @@ function tagScripts(text, lines) {
|
|
|
2123
2123
|
const [s, e, kind] = marks[m];
|
|
2124
2124
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2125
2125
|
}
|
|
2126
|
-
return
|
|
2126
|
+
return _chunkIS2EXA5Dcjs.tidyScriptTags.call(void 0, out);
|
|
2127
2127
|
}
|
|
2128
2128
|
|
|
2129
2129
|
// src/pdf/line-wrap.ts
|
|
@@ -5124,9 +5124,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
5124
5124
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
5125
5125
|
const ratio = block.style.fontSize / medianFontSize;
|
|
5126
5126
|
let level = 0;
|
|
5127
|
-
if (ratio >=
|
|
5128
|
-
else if (ratio >=
|
|
5129
|
-
else if (ratio >=
|
|
5127
|
+
if (ratio >= _chunkIS2EXA5Dcjs.HEADING_RATIO_H1) level = 1;
|
|
5128
|
+
else if (ratio >= _chunkIS2EXA5Dcjs.HEADING_RATIO_H2) level = 2;
|
|
5129
|
+
else if (ratio >= _chunkIS2EXA5Dcjs.HEADING_RATIO_H3) level = 3;
|
|
5130
5130
|
if (level > 0) {
|
|
5131
5131
|
block.type = "heading";
|
|
5132
5132
|
block.level = level;
|
|
@@ -5139,7 +5139,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
5139
5139
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _141 => _141.style, 'optionalAccess', _142 => _142.fontSize]), () => ( 0));
|
|
5140
5140
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _143 => _143.text, 'optionalAccess', _144 => _144.trim, 'call', _145 => _145()]), () => ( ""));
|
|
5141
5141
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _146 => _146.bbox]);
|
|
5142
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _147 => _147.text, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
5142
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _147 => _147.text, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkIS2EXA5Dcjs.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;
|
|
5143
5143
|
}
|
|
5144
5144
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
5145
5145
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -6512,16 +6512,16 @@ function isProseSpread(items) {
|
|
|
6512
6512
|
for (let i = 1; i < sorted.length; i++) {
|
|
6513
6513
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
6514
6514
|
}
|
|
6515
|
-
const maxGap =
|
|
6515
|
+
const maxGap = _chunkWPZOIIM2cjs.safeMax.call(void 0, gaps);
|
|
6516
6516
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
6517
6517
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
6518
|
-
const minGap =
|
|
6518
|
+
const minGap = _chunkWPZOIIM2cjs.safeMin.call(void 0, gaps);
|
|
6519
6519
|
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;
|
|
6520
6520
|
}
|
|
6521
6521
|
function detectColumns(yLines) {
|
|
6522
6522
|
const allItems = yLines.flat();
|
|
6523
6523
|
if (allItems.length === 0) return null;
|
|
6524
|
-
const pageWidth =
|
|
6524
|
+
const pageWidth = _chunkWPZOIIM2cjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkWPZOIIM2cjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
6525
6525
|
if (pageWidth < 100) return null;
|
|
6526
6526
|
let bigoLineIdx = -1;
|
|
6527
6527
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -7065,12 +7065,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
|
|
|
7065
7065
|
}
|
|
7066
7066
|
function takeClipCellEdges(from, to) {
|
|
7067
7067
|
const e = CLIP_CELL_EDGES.get(from);
|
|
7068
|
-
if (e)
|
|
7068
|
+
if (e) _chunkIS2EXA5Dcjs.CELL_EDGES.set(to, e);
|
|
7069
7069
|
}
|
|
7070
7070
|
function joinCellEdges(a, b) {
|
|
7071
|
-
const u =
|
|
7071
|
+
const u = _chunkIS2EXA5Dcjs.CELL_EDGES.get(a), d = _chunkIS2EXA5Dcjs.CELL_EDGES.get(b);
|
|
7072
7072
|
if (!u || !d) return;
|
|
7073
|
-
|
|
7073
|
+
_chunkIS2EXA5Dcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
7074
7074
|
}
|
|
7075
7075
|
|
|
7076
7076
|
// src/pdf/table-unit-row.ts
|
|
@@ -7086,7 +7086,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
7086
7086
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
7087
7087
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
7088
7088
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
7089
|
-
for (const cell of cells[0])
|
|
7089
|
+
for (const cell of cells[0]) _chunkIS2EXA5Dcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
7090
7090
|
for (const item of line) usedItems.add(item);
|
|
7091
7091
|
}
|
|
7092
7092
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7616,7 +7616,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7616
7616
|
const [label, spacer, title] = cells;
|
|
7617
7617
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7618
7618
|
if (cells.some((c) => {
|
|
7619
|
-
const e =
|
|
7619
|
+
const e = _chunkIS2EXA5Dcjs.CELL_EDGES.get(c);
|
|
7620
7620
|
return !e || e.t || e.b || e.l || e.r;
|
|
7621
7621
|
})) return;
|
|
7622
7622
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _342 => _342.fontSize]), () => ( 0));
|
|
@@ -8272,7 +8272,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8272
8272
|
groupSizes.push(1);
|
|
8273
8273
|
}
|
|
8274
8274
|
const allY = remaining.map((i) => i.y);
|
|
8275
|
-
const pageH =
|
|
8275
|
+
const pageH = _chunkWPZOIIM2cjs.safeMax.call(void 0, allY) - _chunkWPZOIIM2cjs.safeMin.call(void 0, allY);
|
|
8276
8276
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8277
8277
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
8278
8278
|
const textBlocks = [];
|
|
@@ -8288,7 +8288,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8288
8288
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
8289
8289
|
} else {
|
|
8290
8290
|
const allY = remaining.map((i) => i.y);
|
|
8291
|
-
const pageH =
|
|
8291
|
+
const pageH = _chunkWPZOIIM2cjs.safeMax.call(void 0, allY) - _chunkWPZOIIM2cjs.safeMin.call(void 0, allY);
|
|
8292
8292
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8293
8293
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
8294
8294
|
const textBlocks = [];
|
|
@@ -8615,7 +8615,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8615
8615
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8616
8616
|
} else {
|
|
8617
8617
|
const allY = items.map((i) => i.y);
|
|
8618
|
-
const pageHeight =
|
|
8618
|
+
const pageHeight = _chunkWPZOIIM2cjs.safeMax.call(void 0, allY) - _chunkWPZOIIM2cjs.safeMin.call(void 0, allY);
|
|
8619
8619
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8620
8620
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
8621
8621
|
for (const group of orderedGroups) {
|
|
@@ -8826,4 +8826,4 @@ function rowParagraphs(block) {
|
|
|
8826
8826
|
|
|
8827
8827
|
|
|
8828
8828
|
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.computeBBox = computeBBox; exports.dominantStyle = dominantStyle; exports.normalizeItems = normalizeItems; exports.groupByY = groupByY; exports.mergeLineSimple = mergeLineSimple; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.splitPageBreakWraps = splitPageBreakWraps; 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.FRAME_TITLE_BLOCKS = FRAME_TITLE_BLOCKS; 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.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines; exports.UNRULED_REGION_TABLES = UNRULED_REGION_TABLES; exports.mergeOcrImageRegions = mergeOcrImageRegions;
|
|
8829
|
-
//# sourceMappingURL=chunk-
|
|
8829
|
+
//# sourceMappingURL=chunk-DU2HC36X.cjs.map
|