kordoc 4.21.17 → 4.21.18
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 +5 -4
- package/dist/{-GS6LEDZ6.js → -AQAGPODO.js} +11 -11
- package/dist/{chunk-I43ZKTUM.cjs → chunk-6GSIGM7S.cjs} +30 -24
- package/dist/chunk-6GSIGM7S.cjs.map +1 -0
- package/dist/{chunk-VOMOC7YF.js → chunk-6TDWJ3L3.js} +3 -3
- package/dist/{chunk-UEI7A4N5.js → chunk-A35RAVW6.js} +2 -2
- package/dist/{chunk-6F6L63RG.js → chunk-AIJCO3QD.js} +10 -10
- package/dist/{chunk-QMQCFVTC.cjs → chunk-BDZUODUH.cjs} +3 -3
- package/dist/{chunk-QMQCFVTC.cjs.map → chunk-BDZUODUH.cjs.map} +1 -1
- package/dist/{chunk-BTMFVKL7.js → chunk-BXMW24VV.js} +2 -2
- package/dist/{chunk-Y4TO3GBF.cjs → chunk-CYGTZS4M.cjs} +2 -2
- package/dist/{chunk-Y4TO3GBF.cjs.map → chunk-CYGTZS4M.cjs.map} +1 -1
- package/dist/{chunk-TZU7PXV2.js → chunk-DVGX37KX.js} +2 -2
- package/dist/{chunk-7ASI3XKM.js → chunk-ES4VPZ3R.js} +3 -3
- package/dist/{chunk-OZW5RYGF.js → chunk-EUKY5YTO.js} +2 -2
- package/dist/{chunk-AJJLT6QJ.js → chunk-JBFZPYHH.js} +2 -2
- package/dist/{chunk-Z3OHMNYF.cjs → chunk-K5WKFUUK.cjs} +13 -13
- package/dist/{chunk-Z3OHMNYF.cjs.map → chunk-K5WKFUUK.cjs.map} +1 -1
- package/dist/{chunk-FWQHYJZ2.js → chunk-LS535RMK.js} +2 -2
- package/dist/{chunk-TUSREHO3.js → chunk-M3SJKVRX.js} +2 -2
- package/dist/{chunk-L3U6MKGV.cjs → chunk-NL5H3LN7.cjs} +3 -3
- package/dist/{chunk-L3U6MKGV.cjs.map → chunk-NL5H3LN7.cjs.map} +1 -1
- package/dist/{chunk-Q4GXF444.js → chunk-NV3HZV5U.js} +2 -2
- package/dist/{chunk-7NXHIM2I.js → chunk-OYFQ2PHZ.js} +2 -2
- package/dist/{chunk-J2FMAYNJ.js → chunk-P5UH7KV7.js} +2 -2
- package/dist/{chunk-QLL7VG6L.js → chunk-PIIW5A33.js} +2 -2
- package/dist/{chunk-3PYAUHWY.js → chunk-REWXXBWB.js} +2 -2
- package/dist/{chunk-PEQ5K2JO.js → chunk-RRQTQNEZ.js} +2 -2
- package/dist/{chunk-L3VCBSFW.js → chunk-RV6FN6H5.js} +2 -2
- package/dist/{chunk-GTSEPXAH.js → chunk-SL4GJOXD.js} +4 -4
- package/dist/{chunk-VVFNVMFM.cjs → chunk-TKFGJLFS.cjs} +6 -6
- package/dist/{chunk-VVFNVMFM.cjs.map → chunk-TKFGJLFS.cjs.map} +1 -1
- package/dist/{chunk-S27YQEPA.js → chunk-V6AEFU7P.js} +12 -6
- package/dist/chunk-V6AEFU7P.js.map +1 -0
- package/dist/{chunk-XBQ554QP.js → chunk-WDNGLRFG.js} +3 -3
- package/dist/{chunk-FMUBLLIZ.js → chunk-WKBQRD3C.js} +6 -6
- package/dist/{chunk-ORNPI5YF.js → chunk-YJSLC7EL.js} +2 -2
- package/dist/{chunk-I7TWFW4X.js → chunk-ZTTQQIIU.js} +11 -5
- package/dist/chunk-ZTTQQIIU.js.map +1 -0
- package/dist/chunks-6DQOG4DF.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-JZXPEDK3.js → formula-5FJYWUCU.js} +4 -4
- package/dist/{formula-BCCH3T3Y.cjs → formula-HZLAXSXC.cjs} +9 -9
- package/dist/{formula-BCCH3T3Y.cjs.map → formula-HZLAXSXC.cjs.map} +1 -1
- package/dist/{formula-CJ5DGNGC.js → formula-TVCXNIK6.js} +3 -3
- package/dist/{image-ocr-HLEL6TED.js → image-ocr-7GO5TH5P.js} +9 -9
- package/dist/{image-ocr-5TZMNEGR.cjs → image-ocr-JXYHKOMK.cjs} +15 -15
- package/dist/{image-ocr-5TZMNEGR.cjs.map → image-ocr-JXYHKOMK.cjs.map} +1 -1
- package/dist/{image-ocr-2POAP5GL.js → image-ocr-V7I6PCZZ.js} +6 -6
- package/dist/index.cjs +276 -276
- package/dist/index.js +5 -5
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-7Z5HLNGX.js → model-bundle-WMRLFW4G.js} +5 -5
- package/dist/{models-IGPCMPQQ.js → models-W6FRSQGA.js} +5 -5
- package/dist/{parse-worker-v2-TS2JTIS2.js → parse-worker-v2-VQLZUE4K.js} +12 -12
- package/dist/{parser-KANGHQU4.cjs → parser-EYKIFP5L.cjs} +134 -134
- package/dist/{parser-KANGHQU4.cjs.map → parser-EYKIFP5L.cjs.map} +1 -1
- package/dist/{parser-VHZ2PZXG.js → parser-K6IJGGTN.js} +8 -8
- package/dist/{parser-WR6UBRI4.js → parser-K7EWKMGE.js} +11 -11
- package/dist/pdf-ocr-MGQOWUSS.js +18 -0
- package/dist/pdf-ocr-OLBZVGJY.js +22 -0
- package/dist/pdf-ocr-SWUPEUKF.cjs +19 -0
- package/dist/{pdf-ocr-SCLTCB2B.cjs.map → pdf-ocr-SWUPEUKF.cjs.map} +1 -1
- package/dist/{profile-io-KHEXVGDJ.js → profile-io-7Z7S6C4I.js} +3 -3
- package/dist/{rasterize-KHGMOS2F.js → rasterize-YIQ5U4YU.js} +3 -3
- package/dist/{redact-doc-DYWNTB2J.js → redact-doc-Q2G2VKBR.js} +11 -11
- package/dist/{render-JNMZ5ULA.js → render-AQ2QOWOL.js} +7 -7
- package/dist/seal-QDD5TY2C.js +10 -0
- package/dist/{setup-OQZS6I7X.js → setup-O7JRLVNI.js} +3 -3
- package/dist/visual-VPCGIMNA.js +20 -0
- package/dist/{watch-DPNIOMTV.js → watch-E4ZMMTRI.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-I43ZKTUM.cjs.map +0 -1
- package/dist/chunk-I7TWFW4X.js.map +0 -1
- package/dist/chunk-S27YQEPA.js.map +0 -1
- package/dist/chunks-RRV5535L.js +0 -10
- package/dist/pdf-ocr-BLT45T3Z.js +0 -22
- package/dist/pdf-ocr-DKYP5EKK.js +0 -18
- package/dist/pdf-ocr-SCLTCB2B.cjs +0 -19
- package/dist/seal-FDHX37MP.js +0 -10
- package/dist/visual-VZTQMICM.js +0 -20
- /package/dist/{-GS6LEDZ6.js.map → -AQAGPODO.js.map} +0 -0
- /package/dist/{chunk-VOMOC7YF.js.map → chunk-6TDWJ3L3.js.map} +0 -0
- /package/dist/{chunk-UEI7A4N5.js.map → chunk-A35RAVW6.js.map} +0 -0
- /package/dist/{chunk-6F6L63RG.js.map → chunk-AIJCO3QD.js.map} +0 -0
- /package/dist/{chunk-BTMFVKL7.js.map → chunk-BXMW24VV.js.map} +0 -0
- /package/dist/{chunk-TZU7PXV2.js.map → chunk-DVGX37KX.js.map} +0 -0
- /package/dist/{chunk-7ASI3XKM.js.map → chunk-ES4VPZ3R.js.map} +0 -0
- /package/dist/{chunk-OZW5RYGF.js.map → chunk-EUKY5YTO.js.map} +0 -0
- /package/dist/{chunk-AJJLT6QJ.js.map → chunk-JBFZPYHH.js.map} +0 -0
- /package/dist/{chunk-FWQHYJZ2.js.map → chunk-LS535RMK.js.map} +0 -0
- /package/dist/{chunk-TUSREHO3.js.map → chunk-M3SJKVRX.js.map} +0 -0
- /package/dist/{chunk-Q4GXF444.js.map → chunk-NV3HZV5U.js.map} +0 -0
- /package/dist/{chunk-7NXHIM2I.js.map → chunk-OYFQ2PHZ.js.map} +0 -0
- /package/dist/{chunk-J2FMAYNJ.js.map → chunk-P5UH7KV7.js.map} +0 -0
- /package/dist/{chunk-QLL7VG6L.js.map → chunk-PIIW5A33.js.map} +0 -0
- /package/dist/{chunk-3PYAUHWY.js.map → chunk-REWXXBWB.js.map} +0 -0
- /package/dist/{chunk-PEQ5K2JO.js.map → chunk-RRQTQNEZ.js.map} +0 -0
- /package/dist/{chunk-L3VCBSFW.js.map → chunk-RV6FN6H5.js.map} +0 -0
- /package/dist/{chunk-GTSEPXAH.js.map → chunk-SL4GJOXD.js.map} +0 -0
- /package/dist/{chunk-XBQ554QP.js.map → chunk-WDNGLRFG.js.map} +0 -0
- /package/dist/{chunk-FMUBLLIZ.js.map → chunk-WKBQRD3C.js.map} +0 -0
- /package/dist/{chunk-ORNPI5YF.js.map → chunk-YJSLC7EL.js.map} +0 -0
- /package/dist/{chunks-RRV5535L.js.map → chunks-6DQOG4DF.js.map} +0 -0
- /package/dist/{formula-JZXPEDK3.js.map → formula-5FJYWUCU.js.map} +0 -0
- /package/dist/{formula-CJ5DGNGC.js.map → formula-TVCXNIK6.js.map} +0 -0
- /package/dist/{image-ocr-HLEL6TED.js.map → image-ocr-7GO5TH5P.js.map} +0 -0
- /package/dist/{image-ocr-2POAP5GL.js.map → image-ocr-V7I6PCZZ.js.map} +0 -0
- /package/dist/{model-bundle-7Z5HLNGX.js.map → model-bundle-WMRLFW4G.js.map} +0 -0
- /package/dist/{models-IGPCMPQQ.js.map → models-W6FRSQGA.js.map} +0 -0
- /package/dist/{parse-worker-v2-TS2JTIS2.js.map → parse-worker-v2-VQLZUE4K.js.map} +0 -0
- /package/dist/{parser-VHZ2PZXG.js.map → parser-K6IJGGTN.js.map} +0 -0
- /package/dist/{parser-WR6UBRI4.js.map → parser-K7EWKMGE.js.map} +0 -0
- /package/dist/{pdf-ocr-BLT45T3Z.js.map → pdf-ocr-MGQOWUSS.js.map} +0 -0
- /package/dist/{pdf-ocr-DKYP5EKK.js.map → pdf-ocr-OLBZVGJY.js.map} +0 -0
- /package/dist/{profile-io-KHEXVGDJ.js.map → profile-io-7Z7S6C4I.js.map} +0 -0
- /package/dist/{rasterize-KHGMOS2F.js.map → rasterize-YIQ5U4YU.js.map} +0 -0
- /package/dist/{redact-doc-DYWNTB2J.js.map → redact-doc-Q2G2VKBR.js.map} +0 -0
- /package/dist/{render-JNMZ5ULA.js.map → render-AQ2QOWOL.js.map} +0 -0
- /package/dist/{seal-FDHX37MP.js.map → seal-QDD5TY2C.js.map} +0 -0
- /package/dist/{setup-OQZS6I7X.js.map → setup-O7JRLVNI.js.map} +0 -0
- /package/dist/{visual-VZTQMICM.js.map → visual-VPCGIMNA.js.map} +0 -0
- /package/dist/{watch-DPNIOMTV.js.map → watch-E4ZMMTRI.js.map} +0 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ HWP 3.x·5.x, HWPX, HWPML, PDF, XLS·XLSX, DOCX, PPTX, PNG·JPG·WebP를 Markdow
|
|
|
12
12
|
[English](README-EN.md) · [상세 사용법](docs/usage.md) · [벤치마크](docs/benchmarks.md) · [변경 이력](CHANGELOG.md)
|
|
13
13
|
|
|
14
14
|
- 📊 **PDF 공개 벤치 종합 0.963** — opendataloader-bench 200문서. 공개 12개 파서 비교 1위(2026-09-29 기록). [측정 조건](docs/benchmarks.md)
|
|
15
|
-
- 🇰🇷 **한국 공문서 표 구조 100%** — 원본 HWPX 2,424문서의 보이는 표 **10,342개 전부 구조 일치**. [4.21.
|
|
15
|
+
- 🇰🇷 **한국 공문서 표 구조 100%** — 원본 HWPX 2,424문서의 보이는 표 **10,342개 전부 구조 일치**. [4.21.18 검증](docs/benchmarks.md)
|
|
16
16
|
|
|
17
17
|
쓸모 있었다면 GitHub ⭐ 하나 눌러주세요. 다른 사람이 이 도구를 찾는 데 도움이 됩니다.
|
|
18
18
|
|
|
@@ -100,7 +100,7 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
100
100
|
|
|
101
101
|
## 검증 결과
|
|
102
102
|
|
|
103
|
-
**4.21.
|
|
103
|
+
**4.21.18 · 2026-10-11 배포 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
|
|
104
104
|
|
|
105
105
|
| 대상 | 규모 | 결과 |
|
|
106
106
|
| --- | --- | --- |
|
|
@@ -113,14 +113,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
113
113
|
|
|
114
114
|
표 구조 점수와 셀 내용·화면 재현은 별도 지표입니다. 채점 범위·제외 기준·전 벤치 문서별 비교는 [벤치마크 상세](docs/benchmarks.md)에 있습니다.
|
|
115
115
|
|
|
116
|
-
외부 PDF 벤치 **opendataloader-bench 200문서**는 4.21.
|
|
116
|
+
외부 PDF 벤치 **opendataloader-bench 200문서**는 4.21.18 배포 측정에서 기본값 종합 **0.963**, OCR 끔 **0.939**입니다. [옵션별 결과와 재현 방법](docs/benchmarks.md#pdf--markdown--opendataloader-bench)
|
|
117
117
|
|
|
118
118
|
## 최근 업데이트
|
|
119
119
|
|
|
120
|
-
최신 배포: **[4.21.
|
|
120
|
+
최신 배포: **[4.21.18](https://github.com/chrisryugj/kordoc/releases/tag/v4.21.18)** · 2026-10-11
|
|
121
121
|
|
|
122
122
|
| 버전 | 주요 변경 |
|
|
123
123
|
| --- | --- |
|
|
124
|
+
| 4.21.18 | 쪽 넘김 문단 잇기도 줄 끝 공백 글리프를 어절 경계로 — "지원⏎활동이"·"계정⏎정보를" 을 띄워 씀 (PDF 어절 F1 98.986 → 98.987%, 5문서 상승) |
|
|
124
125
|
| 4.21.17 | PDF 공백 없는 꽉 찬 줄 끝 + 영문 괄호 — "공적개발원조⏎(ODA)"·"하네스⏎(safety …)" 를 붙여 씀 (PDF 어절 F1 98.98 → 98.99%) |
|
|
125
126
|
| 4.21.16 | PDF 표 쪽 넘김 갈린 행의 수량 이어짐 — 머리 칸 "30%" / 다음 쪽 "미만" 을 한 칸으로; 공문서 autoFit.safety(다른 조판기용 한 줄 판정 여유) (법령 별표 PDF 표 97.40 → 97.69%) |
|
|
126
127
|
| 4.21.15 | PDF 줄 끝 공백 글리프로 어절 경계 꺾임 가르기 — 원문이 띄운 줄 꺾임("이루어⏎진다면")을 붙이던 것 (PDF 어절 F1 98.89 → 98.98%) |
|
|
@@ -54,17 +54,17 @@ import {
|
|
|
54
54
|
unknownFontWarnings,
|
|
55
55
|
usesGaejosikMunche,
|
|
56
56
|
validateHwpx
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-AIJCO3QD.js";
|
|
58
58
|
import {
|
|
59
59
|
blocksToPages
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-RV6FN6H5.js";
|
|
61
61
|
import {
|
|
62
62
|
applySplices,
|
|
63
63
|
buildParagraphSplices,
|
|
64
64
|
buildRangeSplices,
|
|
65
65
|
placeSealHwpx,
|
|
66
66
|
scanSectionXml
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-ES4VPZ3R.js";
|
|
68
68
|
import {
|
|
69
69
|
DEFAULT_REDACT_RULES,
|
|
70
70
|
redactMarkdown,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
} from "./chunk-3WSNLH4B.js";
|
|
73
73
|
import {
|
|
74
74
|
blocksToChunks
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-LS535RMK.js";
|
|
76
76
|
import {
|
|
77
77
|
SPACE_EM_FIXED,
|
|
78
78
|
SPACE_EM_FONT,
|
|
@@ -97,20 +97,20 @@ import {
|
|
|
97
97
|
renderSceneToHtml,
|
|
98
98
|
simulateWrap,
|
|
99
99
|
simulateWrapKeepWord
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-WKBQRD3C.js";
|
|
101
101
|
import "./chunk-7FCNOKOR.js";
|
|
102
|
-
import "./chunk-
|
|
102
|
+
import "./chunk-DVGX37KX.js";
|
|
103
103
|
import "./chunk-VQFA55IC.js";
|
|
104
|
-
import "./chunk-
|
|
104
|
+
import "./chunk-NV3HZV5U.js";
|
|
105
105
|
import {
|
|
106
106
|
blocksToMarkdown,
|
|
107
107
|
flattenLayoutTables,
|
|
108
108
|
hasStructuredCellContent
|
|
109
|
-
} from "./chunk-
|
|
110
|
-
import "./chunk-
|
|
109
|
+
} from "./chunk-PIIW5A33.js";
|
|
110
|
+
import "./chunk-M3SJKVRX.js";
|
|
111
111
|
import {
|
|
112
112
|
VERSION
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-RRQTQNEZ.js";
|
|
114
114
|
export {
|
|
115
115
|
AGENCY_COMMON_NAME,
|
|
116
116
|
BUILTIN_TEMPLATES,
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
usesGaejosikMunche,
|
|
205
205
|
validateHwpx
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=-
|
|
207
|
+
//# sourceMappingURL=-AQAGPODO.js.map
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkTKFGJLFScjs = require('./chunk-TKFGJLFS.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkNL5H3LN7cjs = require('./chunk-NL5H3LN7.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkCYGTZS4Mcjs = require('./chunk-CYGTZS4M.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 _chunkNL5H3LN7cjs.getModelsDir.call(void 0, "ppocr");
|
|
44
44
|
}
|
|
45
45
|
async function ensureOcrModels(onProgress) {
|
|
46
|
-
return
|
|
46
|
+
return _chunkNL5H3LN7cjs.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 _chunkTKFGJLFScjs.tidyScriptTags.call(void 0, out);
|
|
2127
2127
|
}
|
|
2128
2128
|
|
|
2129
2129
|
// src/pdf/line-wrap.ts
|
|
@@ -2339,7 +2339,8 @@ function joinPageBreakWraps(blocks, lex) {
|
|
|
2339
2339
|
if (indented && SENTENCE_END.test(a.text.replace(MARKUP, "").trimEnd())) continue;
|
|
2340
2340
|
if (Math.round(_nullishCoalesce(_optionalChain([b, 'access', _70 => _70.style, 'optionalAccess', _71 => _71.fontSize]), () => ( 0))) !== Math.round(fs) && titleLike(b.text)) continue;
|
|
2341
2341
|
if (/\t/.test(a.text.slice(a.text.lastIndexOf("\n") + 1).replace(/^\S{1,8}\t/, "")) && titleLike(bt.trim().split("\n")[0])) continue;
|
|
2342
|
-
const
|
|
2342
|
+
const joined = wrapJoiner(a.text, b.text, lex);
|
|
2343
|
+
const head = a.text, joiner = joined === "" && last.spaceAfter ? " " : joined;
|
|
2343
2344
|
a.text += joiner + b.text;
|
|
2344
2345
|
const later = b.bbox && PAGE_BREAK_JOINS.get(b.bbox) || [];
|
|
2345
2346
|
PAGE_BREAK_JOINS.set(a.bbox, [{ head, gap: joiner.length, tail: b }, ...later.map((c) => ({ ...c, head: head + joiner + c.head }))]);
|
|
@@ -5115,7 +5116,12 @@ function pushLineParagraphs(out, yLines, pageNum, lex) {
|
|
|
5115
5116
|
const faces = /* @__PURE__ */ new Map();
|
|
5116
5117
|
for (const it of items) faces.set(it.fontName, (_nullishCoalesce(faces.get(it.fontName), () => ( 0))) + it.text.length);
|
|
5117
5118
|
FACE_CHARS.set(block, faces);
|
|
5118
|
-
PARA_LAST_LINE.set(block.bbox, {
|
|
5119
|
+
PARA_LAST_LINE.set(block.bbox, {
|
|
5120
|
+
right: geo[i].right,
|
|
5121
|
+
width: geo[i].right - geo[i].left,
|
|
5122
|
+
fontSize: geo[i].fontSize,
|
|
5123
|
+
spaceAfter: lines[i].items.reduce((a, b) => b.x + b.w > a.x + a.w ? b : a).spaceAfter
|
|
5124
|
+
});
|
|
5119
5125
|
PARA_FIRST_LEFT.set(block.bbox, geo[first2].left);
|
|
5120
5126
|
out.push(block);
|
|
5121
5127
|
i++;
|
|
@@ -5145,9 +5151,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
5145
5151
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
5146
5152
|
const ratio = block.style.fontSize / medianFontSize;
|
|
5147
5153
|
let level = 0;
|
|
5148
|
-
if (ratio >=
|
|
5149
|
-
else if (ratio >=
|
|
5150
|
-
else if (ratio >=
|
|
5154
|
+
if (ratio >= _chunkTKFGJLFScjs.HEADING_RATIO_H1) level = 1;
|
|
5155
|
+
else if (ratio >= _chunkTKFGJLFScjs.HEADING_RATIO_H2) level = 2;
|
|
5156
|
+
else if (ratio >= _chunkTKFGJLFScjs.HEADING_RATIO_H3) level = 3;
|
|
5151
5157
|
if (level > 0) {
|
|
5152
5158
|
block.type = "heading";
|
|
5153
5159
|
block.level = level;
|
|
@@ -5160,7 +5166,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
5160
5166
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _143 => _143.style, 'optionalAccess', _144 => _144.fontSize]), () => ( 0));
|
|
5161
5167
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _145 => _145.text, 'optionalAccess', _146 => _146.trim, 'call', _147 => _147()]), () => ( ""));
|
|
5162
5168
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _148 => _148.bbox]);
|
|
5163
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _149 => _149.text, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
5169
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _149 => _149.text, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkTKFGJLFScjs.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;
|
|
5164
5170
|
}
|
|
5165
5171
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
5166
5172
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -6533,16 +6539,16 @@ function isProseSpread(items) {
|
|
|
6533
6539
|
for (let i = 1; i < sorted.length; i++) {
|
|
6534
6540
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
6535
6541
|
}
|
|
6536
|
-
const maxGap =
|
|
6542
|
+
const maxGap = _chunkCYGTZS4Mcjs.safeMax.call(void 0, gaps);
|
|
6537
6543
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
6538
6544
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
6539
|
-
const minGap =
|
|
6545
|
+
const minGap = _chunkCYGTZS4Mcjs.safeMin.call(void 0, gaps);
|
|
6540
6546
|
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;
|
|
6541
6547
|
}
|
|
6542
6548
|
function detectColumns(yLines) {
|
|
6543
6549
|
const allItems = yLines.flat();
|
|
6544
6550
|
if (allItems.length === 0) return null;
|
|
6545
|
-
const pageWidth =
|
|
6551
|
+
const pageWidth = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
6546
6552
|
if (pageWidth < 100) return null;
|
|
6547
6553
|
let bigoLineIdx = -1;
|
|
6548
6554
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -7086,12 +7092,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
|
|
|
7086
7092
|
}
|
|
7087
7093
|
function takeClipCellEdges(from, to) {
|
|
7088
7094
|
const e = CLIP_CELL_EDGES.get(from);
|
|
7089
|
-
if (e)
|
|
7095
|
+
if (e) _chunkTKFGJLFScjs.CELL_EDGES.set(to, e);
|
|
7090
7096
|
}
|
|
7091
7097
|
function joinCellEdges(a, b) {
|
|
7092
|
-
const u =
|
|
7098
|
+
const u = _chunkTKFGJLFScjs.CELL_EDGES.get(a), d = _chunkTKFGJLFScjs.CELL_EDGES.get(b);
|
|
7093
7099
|
if (!u || !d) return;
|
|
7094
|
-
|
|
7100
|
+
_chunkTKFGJLFScjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
7095
7101
|
}
|
|
7096
7102
|
|
|
7097
7103
|
// src/pdf/table-unit-row.ts
|
|
@@ -7107,7 +7113,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
7107
7113
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
7108
7114
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
7109
7115
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
7110
|
-
for (const cell of cells[0])
|
|
7116
|
+
for (const cell of cells[0]) _chunkTKFGJLFScjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
7111
7117
|
for (const item of line) usedItems.add(item);
|
|
7112
7118
|
}
|
|
7113
7119
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7637,7 +7643,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7637
7643
|
const [label, spacer, title] = cells;
|
|
7638
7644
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7639
7645
|
if (cells.some((c) => {
|
|
7640
|
-
const e =
|
|
7646
|
+
const e = _chunkTKFGJLFScjs.CELL_EDGES.get(c);
|
|
7641
7647
|
return !e || e.t || e.b || e.l || e.r;
|
|
7642
7648
|
})) return;
|
|
7643
7649
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _344 => _344.fontSize]), () => ( 0));
|
|
@@ -8296,7 +8302,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8296
8302
|
groupSizes.push(1);
|
|
8297
8303
|
}
|
|
8298
8304
|
const allY = remaining.map((i) => i.y);
|
|
8299
|
-
const pageH =
|
|
8305
|
+
const pageH = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
|
|
8300
8306
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8301
8307
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
8302
8308
|
const textBlocks = [];
|
|
@@ -8312,7 +8318,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8312
8318
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
8313
8319
|
} else {
|
|
8314
8320
|
const allY = remaining.map((i) => i.y);
|
|
8315
|
-
const pageH =
|
|
8321
|
+
const pageH = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
|
|
8316
8322
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8317
8323
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
8318
8324
|
const textBlocks = [];
|
|
@@ -8640,7 +8646,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8640
8646
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8641
8647
|
} else {
|
|
8642
8648
|
const allY = items.map((i) => i.y);
|
|
8643
|
-
const pageHeight =
|
|
8649
|
+
const pageHeight = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
|
|
8644
8650
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8645
8651
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
8646
8652
|
for (const group of orderedGroups) {
|
|
@@ -8851,4 +8857,4 @@ function rowParagraphs(block) {
|
|
|
8851
8857
|
|
|
8852
8858
|
|
|
8853
8859
|
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;
|
|
8854
|
-
//# sourceMappingURL=chunk-
|
|
8860
|
+
//# sourceMappingURL=chunk-6GSIGM7S.cjs.map
|