kordoc 4.19.0 → 4.19.2
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 +3 -1
- package/dist/{-I3DEUQUC.js → -3JIHF2AL.js} +11 -11
- package/dist/{chunk-CR4RXHXO.js → chunk-4CS7XE2Q.js} +2 -2
- package/dist/{chunk-UCTD3BXH.js → chunk-56ZWAREM.js} +2 -2
- package/dist/{chunk-YV4PWWRW.cjs → chunk-5PGOZBEQ.cjs} +22 -22
- package/dist/{chunk-YV4PWWRW.cjs.map → chunk-5PGOZBEQ.cjs.map} +1 -1
- package/dist/{chunk-OMJWAJBD.js → chunk-6ZBORHFB.js} +2 -2
- package/dist/{chunk-DH75ZUYF.js → chunk-AKSCTGKG.js} +10 -4
- package/dist/chunk-AKSCTGKG.js.map +1 -0
- package/dist/{chunk-L5KNWOGR.js → chunk-AOVMOCTK.js} +10 -4
- package/dist/chunk-AOVMOCTK.js.map +1 -0
- package/dist/{chunk-XXUXQHUC.js → chunk-B4R443MV.js} +2 -2
- package/dist/{chunk-RYKNAYKC.js → chunk-EUCBMW6C.js} +3 -3
- package/dist/{chunk-XIWGPC3V.js → chunk-GNUGD4RO.js} +2 -2
- package/dist/{chunk-AMDDV4CI.js → chunk-I2TBI7PN.js} +2 -2
- package/dist/{chunk-5B55S4JU.js → chunk-J75TVRJB.js} +2 -2
- package/dist/{chunk-VZSOPECZ.js → chunk-JK7N4R4K.js} +2 -2
- package/dist/{chunk-DEYCTP2S.js → chunk-JXJDXDOU.js} +3 -3
- package/dist/{chunk-34RIECIF.cjs → chunk-MZ6XNFZL.cjs} +2 -2
- package/dist/{chunk-34RIECIF.cjs.map → chunk-MZ6XNFZL.cjs.map} +1 -1
- package/dist/{chunk-C4JHZNRL.js → chunk-NV46IWKF.js} +27 -21
- package/dist/chunk-NV46IWKF.js.map +1 -0
- package/dist/{chunk-UTVNSCEI.js → chunk-OKHKEYTL.js} +2 -2
- package/dist/{chunk-LNU54ZKV.cjs → chunk-ORGWGR4K.cjs} +15 -9
- package/dist/chunk-ORGWGR4K.cjs.map +1 -0
- package/dist/{chunk-AAE765MK.js → chunk-PWQ2BVAT.js} +3 -3
- package/dist/{chunk-FJE3TMZ7.js → chunk-QYJPU4FZ.js} +30 -2
- package/dist/chunk-QYJPU4FZ.js.map +1 -0
- package/dist/{chunk-DGXGVC4Z.js → chunk-QZ63HXEG.js} +51 -20
- package/dist/chunk-QZ63HXEG.js.map +1 -0
- package/dist/{chunk-GCYLNOTJ.js → chunk-R2JM2HOJ.js} +4 -4
- package/dist/{chunk-LLVF6X5W.cjs → chunk-RVBQT2PD.cjs} +3 -3
- package/dist/{chunk-LLVF6X5W.cjs.map → chunk-RVBQT2PD.cjs.map} +1 -1
- package/dist/{chunk-7TVRQJXI.cjs → chunk-T2DZTOGG.cjs} +12 -12
- package/dist/{chunk-7TVRQJXI.cjs.map → chunk-T2DZTOGG.cjs.map} +1 -1
- package/dist/{chunk-GYQVQF2J.js → chunk-TM4T4NYJ.js} +2 -2
- package/dist/{chunk-W5XX2GKO.js → chunk-U6AJU2VD.js} +2 -2
- package/dist/{chunk-QHN7N2QA.js → chunk-VO22VAR3.js} +2 -2
- package/dist/{chunk-5ZSQ2ZIH.cjs → chunk-WQAGDJIP.cjs} +3 -3
- package/dist/{chunk-5ZSQ2ZIH.cjs.map → chunk-WQAGDJIP.cjs.map} +1 -1
- package/dist/{chunk-HFMIAMEO.js → chunk-XPM7WC54.js} +4 -4
- package/dist/chunks-2EC2R7PY.js +10 -0
- package/dist/cli.js +26 -26
- package/dist/{formula-L2BKGA4J.cjs → formula-RNATQ3FQ.cjs} +9 -9
- package/dist/{formula-L2BKGA4J.cjs.map → formula-RNATQ3FQ.cjs.map} +1 -1
- package/dist/{formula-DUEAYGIG.js → formula-RSTTP626.js} +4 -4
- package/dist/{formula-I4MAHCTZ.js → formula-STIFIS57.js} +3 -3
- package/dist/{image-ocr-ZWRJZKYR.cjs → image-ocr-7L5TBBPA.cjs} +15 -15
- package/dist/{image-ocr-ZWRJZKYR.cjs.map → image-ocr-7L5TBBPA.cjs.map} +1 -1
- package/dist/{image-ocr-B32G24XW.js → image-ocr-R6ZDFBAN.js} +6 -6
- package/dist/{image-ocr-NUL3JKXM.js → image-ocr-XKSAEEXP.js} +9 -9
- package/dist/index.cjs +824 -761
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -31
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-OBIKG4K5.js → model-bundle-NGTKULP7.js} +5 -5
- package/dist/{models-2OZHOPPM.js → models-QOSU5SYL.js} +5 -5
- package/dist/{parser-FDE6GQST.js → parser-3G4G6SST.js} +176 -12
- package/dist/parser-3G4G6SST.js.map +1 -0
- package/dist/{parser-YW3NMSJE.js → parser-5GUEP6EK.js} +173 -9
- package/dist/parser-5GUEP6EK.js.map +1 -0
- package/dist/{parser-DMWCXX7A.cjs → parser-AIQBU7FS.cjs} +392 -228
- package/dist/parser-AIQBU7FS.cjs.map +1 -0
- package/dist/pdf-ocr-7OAFUDM4.cjs +17 -0
- package/dist/{pdf-ocr-K2OK7FNQ.cjs.map → pdf-ocr-7OAFUDM4.cjs.map} +1 -1
- package/dist/pdf-ocr-DAXS5RX4.js +16 -0
- package/dist/pdf-ocr-R3VGX6F2.js +20 -0
- package/dist/{profile-io-6WCU4KHY.js → profile-io-ZVNMDLLS.js} +3 -3
- package/dist/{rasterize-X3I7SWXF.js → rasterize-Y2RLMVCL.js} +3 -3
- package/dist/{redact-doc-6H7WPUQD.js → redact-doc-PNRDDBI3.js} +11 -11
- package/dist/{render-PBQJGZT3.js → render-S3ALARVO.js} +7 -7
- package/dist/seal-EJWPS5VK.js +10 -0
- package/dist/{setup-UORJSR3M.js → setup-JH66VSFZ.js} +3 -3
- package/dist/visual-GDXMKDVY.js +20 -0
- package/dist/{watch-S2ZMDDZU.js → watch-KMB2FTOD.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-C4JHZNRL.js.map +0 -1
- package/dist/chunk-DGXGVC4Z.js.map +0 -1
- package/dist/chunk-DH75ZUYF.js.map +0 -1
- package/dist/chunk-FJE3TMZ7.js.map +0 -1
- package/dist/chunk-L5KNWOGR.js.map +0 -1
- package/dist/chunk-LNU54ZKV.cjs.map +0 -1
- package/dist/chunks-JPNLQOVD.js +0 -10
- package/dist/parser-DMWCXX7A.cjs.map +0 -1
- package/dist/parser-FDE6GQST.js.map +0 -1
- package/dist/parser-YW3NMSJE.js.map +0 -1
- package/dist/pdf-ocr-7MR56U4P.js +0 -16
- package/dist/pdf-ocr-K2OK7FNQ.cjs +0 -17
- package/dist/pdf-ocr-YHC4X67W.js +0 -20
- package/dist/seal-E2E7CFZJ.js +0 -10
- package/dist/visual-4GDT5BRH.js +0 -20
- /package/dist/{-I3DEUQUC.js.map → -3JIHF2AL.js.map} +0 -0
- /package/dist/{chunk-CR4RXHXO.js.map → chunk-4CS7XE2Q.js.map} +0 -0
- /package/dist/{chunk-UCTD3BXH.js.map → chunk-56ZWAREM.js.map} +0 -0
- /package/dist/{chunk-OMJWAJBD.js.map → chunk-6ZBORHFB.js.map} +0 -0
- /package/dist/{chunk-XXUXQHUC.js.map → chunk-B4R443MV.js.map} +0 -0
- /package/dist/{chunk-RYKNAYKC.js.map → chunk-EUCBMW6C.js.map} +0 -0
- /package/dist/{chunk-XIWGPC3V.js.map → chunk-GNUGD4RO.js.map} +0 -0
- /package/dist/{chunk-AMDDV4CI.js.map → chunk-I2TBI7PN.js.map} +0 -0
- /package/dist/{chunk-5B55S4JU.js.map → chunk-J75TVRJB.js.map} +0 -0
- /package/dist/{chunk-VZSOPECZ.js.map → chunk-JK7N4R4K.js.map} +0 -0
- /package/dist/{chunk-DEYCTP2S.js.map → chunk-JXJDXDOU.js.map} +0 -0
- /package/dist/{chunk-UTVNSCEI.js.map → chunk-OKHKEYTL.js.map} +0 -0
- /package/dist/{chunk-AAE765MK.js.map → chunk-PWQ2BVAT.js.map} +0 -0
- /package/dist/{chunk-GCYLNOTJ.js.map → chunk-R2JM2HOJ.js.map} +0 -0
- /package/dist/{chunk-GYQVQF2J.js.map → chunk-TM4T4NYJ.js.map} +0 -0
- /package/dist/{chunk-W5XX2GKO.js.map → chunk-U6AJU2VD.js.map} +0 -0
- /package/dist/{chunk-QHN7N2QA.js.map → chunk-VO22VAR3.js.map} +0 -0
- /package/dist/{chunk-HFMIAMEO.js.map → chunk-XPM7WC54.js.map} +0 -0
- /package/dist/{chunks-JPNLQOVD.js.map → chunks-2EC2R7PY.js.map} +0 -0
- /package/dist/{formula-DUEAYGIG.js.map → formula-RSTTP626.js.map} +0 -0
- /package/dist/{formula-I4MAHCTZ.js.map → formula-STIFIS57.js.map} +0 -0
- /package/dist/{image-ocr-B32G24XW.js.map → image-ocr-R6ZDFBAN.js.map} +0 -0
- /package/dist/{image-ocr-NUL3JKXM.js.map → image-ocr-XKSAEEXP.js.map} +0 -0
- /package/dist/{model-bundle-OBIKG4K5.js.map → model-bundle-NGTKULP7.js.map} +0 -0
- /package/dist/{models-2OZHOPPM.js.map → models-QOSU5SYL.js.map} +0 -0
- /package/dist/{pdf-ocr-7MR56U4P.js.map → pdf-ocr-DAXS5RX4.js.map} +0 -0
- /package/dist/{pdf-ocr-YHC4X67W.js.map → pdf-ocr-R3VGX6F2.js.map} +0 -0
- /package/dist/{profile-io-6WCU4KHY.js.map → profile-io-ZVNMDLLS.js.map} +0 -0
- /package/dist/{rasterize-X3I7SWXF.js.map → rasterize-Y2RLMVCL.js.map} +0 -0
- /package/dist/{redact-doc-6H7WPUQD.js.map → redact-doc-PNRDDBI3.js.map} +0 -0
- /package/dist/{render-PBQJGZT3.js.map → render-S3ALARVO.js.map} +0 -0
- /package/dist/{seal-E2E7CFZJ.js.map → seal-EJWPS5VK.js.map} +0 -0
- /package/dist/{setup-UORJSR3M.js.map → setup-JH66VSFZ.js.map} +0 -0
- /package/dist/{visual-4GDT5BRH.js.map → visual-GDXMKDVY.js.map} +0 -0
- /package/dist/{watch-S2ZMDDZU.js.map → watch-KMB2FTOD.js.map} +0 -0
package/README.md
CHANGED
|
@@ -111,10 +111,12 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
111
111
|
|
|
112
112
|
## 최근 업데이트
|
|
113
113
|
|
|
114
|
-
최신 배포: **[4.19.
|
|
114
|
+
최신 배포: **[4.19.2](https://github.com/chrisryugj/kordoc/releases/tag/v4.19.2)** · 2026-10-07
|
|
115
115
|
|
|
116
116
|
| 버전 | 주요 변경 |
|
|
117
117
|
| --- | --- |
|
|
118
|
+
| 4.19.2 | rhwp v0.8.7 파서 수정 반영 — HWP3 체크박스 □, HWP5 짝 없는 서로게이트 □, 손상 CFB 복구의 본문 경로 오인 수정, HWPX 압축 해제 상한을 엔트리 읽는 도중에 적용 |
|
|
119
|
+
| 4.19.1 | PDF 쪽별 마크다운(`pages`)에서 쪽 넘김 표를 쪽마다 다시 갈라 뒤 쪽 행·상자가 앞 쪽에 붙거나 쪽 항목이 빠지지 않게 (#136) |
|
|
118
120
|
| 4.19.0 | RAG 색인용 `tableFormat: "gfm"` — 병합·중첩 표도 HTML 없이 GFM 파이프 표로, 셀 안 표는 부모·자식 관계 표지와 함께 독립 표로 (#138) |
|
|
119
121
|
| 4.18.12–13 | PDF 쪽 넘김 문단 잇기 판정을 HWPX·DOCX 원문 대조로 재조정 — 문장 끝·들여쓰기·나열 기호·탭 행 근거 (HWPX 쌍 오판 50 → 5) |
|
|
120
122
|
| 4.18.11 | 글꼴 사전 수천 개가 글꼴 파일을 나눠 쓰는 PDF의 메모리 폭주(힙 7GB+ 종료) 수정 (#137) |
|
|
@@ -51,17 +51,17 @@ import {
|
|
|
51
51
|
unknownFontWarnings,
|
|
52
52
|
usesGaejosikMunche,
|
|
53
53
|
validateHwpx
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-NV46IWKF.js";
|
|
55
55
|
import {
|
|
56
56
|
blocksToPages
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VO22VAR3.js";
|
|
58
58
|
import {
|
|
59
59
|
applySplices,
|
|
60
60
|
buildParagraphSplices,
|
|
61
61
|
buildRangeSplices,
|
|
62
62
|
placeSealHwpx,
|
|
63
63
|
scanSectionXml
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-PWQ2BVAT.js";
|
|
65
65
|
import {
|
|
66
66
|
DEFAULT_REDACT_RULES,
|
|
67
67
|
redactMarkdown,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
} from "./chunk-3WSNLH4B.js";
|
|
70
70
|
import {
|
|
71
71
|
blocksToChunks
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-TM4T4NYJ.js";
|
|
73
73
|
import {
|
|
74
74
|
SPACE_EM_FIXED,
|
|
75
75
|
SPACE_EM_FONT,
|
|
@@ -94,20 +94,20 @@ import {
|
|
|
94
94
|
renderSceneToHtml,
|
|
95
95
|
simulateWrap,
|
|
96
96
|
simulateWrapKeepWord
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-QZ63HXEG.js";
|
|
98
98
|
import "./chunk-7FCNOKOR.js";
|
|
99
|
-
import "./chunk-
|
|
99
|
+
import "./chunk-AOVMOCTK.js";
|
|
100
100
|
import "./chunk-VQFA55IC.js";
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-QYJPU4FZ.js";
|
|
102
102
|
import {
|
|
103
103
|
blocksToMarkdown,
|
|
104
104
|
flattenLayoutTables,
|
|
105
105
|
hasStructuredCellContent
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import "./chunk-
|
|
106
|
+
} from "./chunk-B4R443MV.js";
|
|
107
|
+
import "./chunk-6ZBORHFB.js";
|
|
108
108
|
import {
|
|
109
109
|
VERSION
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-OKHKEYTL.js";
|
|
111
111
|
export {
|
|
112
112
|
BUILTIN_TEMPLATES,
|
|
113
113
|
DEFAULT_REDACT_RULES,
|
|
@@ -198,4 +198,4 @@ export {
|
|
|
198
198
|
usesGaejosikMunche,
|
|
199
199
|
validateHwpx
|
|
200
200
|
};
|
|
201
|
-
//# sourceMappingURL=-
|
|
201
|
+
//# sourceMappingURL=-3JIHF2AL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KordocError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OKHKEYTL.js";
|
|
5
5
|
|
|
6
6
|
// src/hwpx/profile-io.ts
|
|
7
7
|
import { z } from "zod";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
formatProfileSchema,
|
|
90
90
|
parseFormatProfileJson
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-4CS7XE2Q.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ensureModelsIn,
|
|
4
4
|
getModelStatusIn,
|
|
5
5
|
getModelsDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JK7N4R4K.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-56ZWAREM.js.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkORGWGR4Kcjs = require('./chunk-ORGWGR4K.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkWQAGDJIPcjs = require('./chunk-WQAGDJIP.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkMZ6XNFZLcjs = require('./chunk-MZ6XNFZL.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 _chunkWQAGDJIPcjs.getModelsDir.call(void 0, "ppocr");
|
|
44
44
|
}
|
|
45
45
|
async function ensureOcrModels(onProgress) {
|
|
46
|
-
return
|
|
46
|
+
return _chunkWQAGDJIPcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
|
|
47
47
|
}
|
|
48
48
|
async function ocrModelsCached() {
|
|
49
49
|
const dir = getOcrModelsDir();
|
|
@@ -2091,7 +2091,7 @@ function tagScripts(text, lines) {
|
|
|
2091
2091
|
const [s, e, kind] = marks[m];
|
|
2092
2092
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2093
2093
|
}
|
|
2094
|
-
return
|
|
2094
|
+
return _chunkORGWGR4Kcjs.tidyScriptTags.call(void 0, out);
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
2097
|
// src/pdf/line-wrap.ts
|
|
@@ -3689,9 +3689,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
3689
3689
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
3690
3690
|
const ratio = block.style.fontSize / medianFontSize;
|
|
3691
3691
|
let level = 0;
|
|
3692
|
-
if (ratio >=
|
|
3693
|
-
else if (ratio >=
|
|
3694
|
-
else if (ratio >=
|
|
3692
|
+
if (ratio >= _chunkORGWGR4Kcjs.HEADING_RATIO_H1) level = 1;
|
|
3693
|
+
else if (ratio >= _chunkORGWGR4Kcjs.HEADING_RATIO_H2) level = 2;
|
|
3694
|
+
else if (ratio >= _chunkORGWGR4Kcjs.HEADING_RATIO_H3) level = 3;
|
|
3695
3695
|
if (level > 0) {
|
|
3696
3696
|
block.type = "heading";
|
|
3697
3697
|
block.level = level;
|
|
@@ -3704,7 +3704,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
3704
3704
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _98 => _98.style, 'optionalAccess', _99 => _99.fontSize]), () => ( 0));
|
|
3705
3705
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _100 => _100.text, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]), () => ( ""));
|
|
3706
3706
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _103 => _103.bbox]);
|
|
3707
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _104 => _104.text, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
3707
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _104 => _104.text, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkORGWGR4Kcjs.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;
|
|
3708
3708
|
}
|
|
3709
3709
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
3710
3710
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -6016,16 +6016,16 @@ function isProseSpread(items) {
|
|
|
6016
6016
|
for (let i = 1; i < sorted.length; i++) {
|
|
6017
6017
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
6018
6018
|
}
|
|
6019
|
-
const maxGap =
|
|
6019
|
+
const maxGap = _chunkMZ6XNFZLcjs.safeMax.call(void 0, gaps);
|
|
6020
6020
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
6021
6021
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
6022
|
-
const minGap =
|
|
6022
|
+
const minGap = _chunkMZ6XNFZLcjs.safeMin.call(void 0, gaps);
|
|
6023
6023
|
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;
|
|
6024
6024
|
}
|
|
6025
6025
|
function detectColumns(yLines) {
|
|
6026
6026
|
const allItems = yLines.flat();
|
|
6027
6027
|
if (allItems.length === 0) return null;
|
|
6028
|
-
const pageWidth =
|
|
6028
|
+
const pageWidth = _chunkMZ6XNFZLcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkMZ6XNFZLcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
6029
6029
|
if (pageWidth < 100) return null;
|
|
6030
6030
|
let bigoLineIdx = -1;
|
|
6031
6031
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -6495,12 +6495,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
|
|
|
6495
6495
|
}
|
|
6496
6496
|
function takeClipCellEdges(from, to) {
|
|
6497
6497
|
const e = CLIP_CELL_EDGES.get(from);
|
|
6498
|
-
if (e)
|
|
6498
|
+
if (e) _chunkORGWGR4Kcjs.CELL_EDGES.set(to, e);
|
|
6499
6499
|
}
|
|
6500
6500
|
function joinCellEdges(a, b) {
|
|
6501
|
-
const u =
|
|
6501
|
+
const u = _chunkORGWGR4Kcjs.CELL_EDGES.get(a), d = _chunkORGWGR4Kcjs.CELL_EDGES.get(b);
|
|
6502
6502
|
if (!u || !d) return;
|
|
6503
|
-
|
|
6503
|
+
_chunkORGWGR4Kcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
6504
6504
|
}
|
|
6505
6505
|
|
|
6506
6506
|
// src/pdf/table-unit-row.ts
|
|
@@ -6516,7 +6516,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
6516
6516
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
6517
6517
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
6518
6518
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
6519
|
-
for (const cell of cells[0])
|
|
6519
|
+
for (const cell of cells[0]) _chunkORGWGR4Kcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
6520
6520
|
for (const item of line) usedItems.add(item);
|
|
6521
6521
|
}
|
|
6522
6522
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7046,7 +7046,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7046
7046
|
const [label, spacer, title] = cells;
|
|
7047
7047
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7048
7048
|
if (cells.some((c) => {
|
|
7049
|
-
const e =
|
|
7049
|
+
const e = _chunkORGWGR4Kcjs.CELL_EDGES.get(c);
|
|
7050
7050
|
return !e || e.t || e.b || e.l || e.r;
|
|
7051
7051
|
})) return;
|
|
7052
7052
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _326 => _326.fontSize]), () => ( 0));
|
|
@@ -7958,7 +7958,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7958
7958
|
groupSizes.push(1);
|
|
7959
7959
|
}
|
|
7960
7960
|
const allY = remaining.map((i) => i.y);
|
|
7961
|
-
const pageH =
|
|
7961
|
+
const pageH = _chunkMZ6XNFZLcjs.safeMax.call(void 0, allY) - _chunkMZ6XNFZLcjs.safeMin.call(void 0, allY);
|
|
7962
7962
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
7963
7963
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
7964
7964
|
const textBlocks = [];
|
|
@@ -7974,7 +7974,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7974
7974
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
7975
7975
|
} else {
|
|
7976
7976
|
const allY = remaining.map((i) => i.y);
|
|
7977
|
-
const pageH =
|
|
7977
|
+
const pageH = _chunkMZ6XNFZLcjs.safeMax.call(void 0, allY) - _chunkMZ6XNFZLcjs.safeMin.call(void 0, allY);
|
|
7978
7978
|
const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
|
|
7979
7979
|
const textBlocks = [];
|
|
7980
7980
|
for (const group of groups) {
|
|
@@ -8299,7 +8299,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8299
8299
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8300
8300
|
} else {
|
|
8301
8301
|
const allY = items.map((i) => i.y);
|
|
8302
|
-
const pageHeight =
|
|
8302
|
+
const pageHeight = _chunkMZ6XNFZLcjs.safeMax.call(void 0, allY) - _chunkMZ6XNFZLcjs.safeMin.call(void 0, allY);
|
|
8303
8303
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8304
8304
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
|
|
8305
8305
|
for (const group of orderedGroups) {
|
|
@@ -8378,4 +8378,4 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8378
8378
|
|
|
8379
8379
|
|
|
8380
8380
|
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.FRAME_READING_UNITS = FRAME_READING_UNITS; exports.recordFrameReadingUnit = recordFrameReadingUnit; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines;
|
|
8381
|
-
//# sourceMappingURL=chunk-
|
|
8381
|
+
//# sourceMappingURL=chunk-5PGOZBEQ.cjs.map
|