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.
Files changed (123) hide show
  1. package/README.md +5 -4
  2. package/dist/{-GS6LEDZ6.js → -AQAGPODO.js} +11 -11
  3. package/dist/{chunk-I43ZKTUM.cjs → chunk-6GSIGM7S.cjs} +30 -24
  4. package/dist/chunk-6GSIGM7S.cjs.map +1 -0
  5. package/dist/{chunk-VOMOC7YF.js → chunk-6TDWJ3L3.js} +3 -3
  6. package/dist/{chunk-UEI7A4N5.js → chunk-A35RAVW6.js} +2 -2
  7. package/dist/{chunk-6F6L63RG.js → chunk-AIJCO3QD.js} +10 -10
  8. package/dist/{chunk-QMQCFVTC.cjs → chunk-BDZUODUH.cjs} +3 -3
  9. package/dist/{chunk-QMQCFVTC.cjs.map → chunk-BDZUODUH.cjs.map} +1 -1
  10. package/dist/{chunk-BTMFVKL7.js → chunk-BXMW24VV.js} +2 -2
  11. package/dist/{chunk-Y4TO3GBF.cjs → chunk-CYGTZS4M.cjs} +2 -2
  12. package/dist/{chunk-Y4TO3GBF.cjs.map → chunk-CYGTZS4M.cjs.map} +1 -1
  13. package/dist/{chunk-TZU7PXV2.js → chunk-DVGX37KX.js} +2 -2
  14. package/dist/{chunk-7ASI3XKM.js → chunk-ES4VPZ3R.js} +3 -3
  15. package/dist/{chunk-OZW5RYGF.js → chunk-EUKY5YTO.js} +2 -2
  16. package/dist/{chunk-AJJLT6QJ.js → chunk-JBFZPYHH.js} +2 -2
  17. package/dist/{chunk-Z3OHMNYF.cjs → chunk-K5WKFUUK.cjs} +13 -13
  18. package/dist/{chunk-Z3OHMNYF.cjs.map → chunk-K5WKFUUK.cjs.map} +1 -1
  19. package/dist/{chunk-FWQHYJZ2.js → chunk-LS535RMK.js} +2 -2
  20. package/dist/{chunk-TUSREHO3.js → chunk-M3SJKVRX.js} +2 -2
  21. package/dist/{chunk-L3U6MKGV.cjs → chunk-NL5H3LN7.cjs} +3 -3
  22. package/dist/{chunk-L3U6MKGV.cjs.map → chunk-NL5H3LN7.cjs.map} +1 -1
  23. package/dist/{chunk-Q4GXF444.js → chunk-NV3HZV5U.js} +2 -2
  24. package/dist/{chunk-7NXHIM2I.js → chunk-OYFQ2PHZ.js} +2 -2
  25. package/dist/{chunk-J2FMAYNJ.js → chunk-P5UH7KV7.js} +2 -2
  26. package/dist/{chunk-QLL7VG6L.js → chunk-PIIW5A33.js} +2 -2
  27. package/dist/{chunk-3PYAUHWY.js → chunk-REWXXBWB.js} +2 -2
  28. package/dist/{chunk-PEQ5K2JO.js → chunk-RRQTQNEZ.js} +2 -2
  29. package/dist/{chunk-L3VCBSFW.js → chunk-RV6FN6H5.js} +2 -2
  30. package/dist/{chunk-GTSEPXAH.js → chunk-SL4GJOXD.js} +4 -4
  31. package/dist/{chunk-VVFNVMFM.cjs → chunk-TKFGJLFS.cjs} +6 -6
  32. package/dist/{chunk-VVFNVMFM.cjs.map → chunk-TKFGJLFS.cjs.map} +1 -1
  33. package/dist/{chunk-S27YQEPA.js → chunk-V6AEFU7P.js} +12 -6
  34. package/dist/chunk-V6AEFU7P.js.map +1 -0
  35. package/dist/{chunk-XBQ554QP.js → chunk-WDNGLRFG.js} +3 -3
  36. package/dist/{chunk-FMUBLLIZ.js → chunk-WKBQRD3C.js} +6 -6
  37. package/dist/{chunk-ORNPI5YF.js → chunk-YJSLC7EL.js} +2 -2
  38. package/dist/{chunk-I7TWFW4X.js → chunk-ZTTQQIIU.js} +11 -5
  39. package/dist/chunk-ZTTQQIIU.js.map +1 -0
  40. package/dist/chunks-6DQOG4DF.js +10 -0
  41. package/dist/cli.js +30 -30
  42. package/dist/{formula-JZXPEDK3.js → formula-5FJYWUCU.js} +4 -4
  43. package/dist/{formula-BCCH3T3Y.cjs → formula-HZLAXSXC.cjs} +9 -9
  44. package/dist/{formula-BCCH3T3Y.cjs.map → formula-HZLAXSXC.cjs.map} +1 -1
  45. package/dist/{formula-CJ5DGNGC.js → formula-TVCXNIK6.js} +3 -3
  46. package/dist/{image-ocr-HLEL6TED.js → image-ocr-7GO5TH5P.js} +9 -9
  47. package/dist/{image-ocr-5TZMNEGR.cjs → image-ocr-JXYHKOMK.cjs} +15 -15
  48. package/dist/{image-ocr-5TZMNEGR.cjs.map → image-ocr-JXYHKOMK.cjs.map} +1 -1
  49. package/dist/{image-ocr-2POAP5GL.js → image-ocr-V7I6PCZZ.js} +6 -6
  50. package/dist/index.cjs +276 -276
  51. package/dist/index.js +5 -5
  52. package/dist/mcp.js +22 -22
  53. package/dist/{model-bundle-7Z5HLNGX.js → model-bundle-WMRLFW4G.js} +5 -5
  54. package/dist/{models-IGPCMPQQ.js → models-W6FRSQGA.js} +5 -5
  55. package/dist/{parse-worker-v2-TS2JTIS2.js → parse-worker-v2-VQLZUE4K.js} +12 -12
  56. package/dist/{parser-KANGHQU4.cjs → parser-EYKIFP5L.cjs} +134 -134
  57. package/dist/{parser-KANGHQU4.cjs.map → parser-EYKIFP5L.cjs.map} +1 -1
  58. package/dist/{parser-VHZ2PZXG.js → parser-K6IJGGTN.js} +8 -8
  59. package/dist/{parser-WR6UBRI4.js → parser-K7EWKMGE.js} +11 -11
  60. package/dist/pdf-ocr-MGQOWUSS.js +18 -0
  61. package/dist/pdf-ocr-OLBZVGJY.js +22 -0
  62. package/dist/pdf-ocr-SWUPEUKF.cjs +19 -0
  63. package/dist/{pdf-ocr-SCLTCB2B.cjs.map → pdf-ocr-SWUPEUKF.cjs.map} +1 -1
  64. package/dist/{profile-io-KHEXVGDJ.js → profile-io-7Z7S6C4I.js} +3 -3
  65. package/dist/{rasterize-KHGMOS2F.js → rasterize-YIQ5U4YU.js} +3 -3
  66. package/dist/{redact-doc-DYWNTB2J.js → redact-doc-Q2G2VKBR.js} +11 -11
  67. package/dist/{render-JNMZ5ULA.js → render-AQ2QOWOL.js} +7 -7
  68. package/dist/seal-QDD5TY2C.js +10 -0
  69. package/dist/{setup-OQZS6I7X.js → setup-O7JRLVNI.js} +3 -3
  70. package/dist/visual-VPCGIMNA.js +20 -0
  71. package/dist/{watch-DPNIOMTV.js → watch-E4ZMMTRI.js} +12 -12
  72. package/package.json +1 -1
  73. package/dist/chunk-I43ZKTUM.cjs.map +0 -1
  74. package/dist/chunk-I7TWFW4X.js.map +0 -1
  75. package/dist/chunk-S27YQEPA.js.map +0 -1
  76. package/dist/chunks-RRV5535L.js +0 -10
  77. package/dist/pdf-ocr-BLT45T3Z.js +0 -22
  78. package/dist/pdf-ocr-DKYP5EKK.js +0 -18
  79. package/dist/pdf-ocr-SCLTCB2B.cjs +0 -19
  80. package/dist/seal-FDHX37MP.js +0 -10
  81. package/dist/visual-VZTQMICM.js +0 -20
  82. /package/dist/{-GS6LEDZ6.js.map → -AQAGPODO.js.map} +0 -0
  83. /package/dist/{chunk-VOMOC7YF.js.map → chunk-6TDWJ3L3.js.map} +0 -0
  84. /package/dist/{chunk-UEI7A4N5.js.map → chunk-A35RAVW6.js.map} +0 -0
  85. /package/dist/{chunk-6F6L63RG.js.map → chunk-AIJCO3QD.js.map} +0 -0
  86. /package/dist/{chunk-BTMFVKL7.js.map → chunk-BXMW24VV.js.map} +0 -0
  87. /package/dist/{chunk-TZU7PXV2.js.map → chunk-DVGX37KX.js.map} +0 -0
  88. /package/dist/{chunk-7ASI3XKM.js.map → chunk-ES4VPZ3R.js.map} +0 -0
  89. /package/dist/{chunk-OZW5RYGF.js.map → chunk-EUKY5YTO.js.map} +0 -0
  90. /package/dist/{chunk-AJJLT6QJ.js.map → chunk-JBFZPYHH.js.map} +0 -0
  91. /package/dist/{chunk-FWQHYJZ2.js.map → chunk-LS535RMK.js.map} +0 -0
  92. /package/dist/{chunk-TUSREHO3.js.map → chunk-M3SJKVRX.js.map} +0 -0
  93. /package/dist/{chunk-Q4GXF444.js.map → chunk-NV3HZV5U.js.map} +0 -0
  94. /package/dist/{chunk-7NXHIM2I.js.map → chunk-OYFQ2PHZ.js.map} +0 -0
  95. /package/dist/{chunk-J2FMAYNJ.js.map → chunk-P5UH7KV7.js.map} +0 -0
  96. /package/dist/{chunk-QLL7VG6L.js.map → chunk-PIIW5A33.js.map} +0 -0
  97. /package/dist/{chunk-3PYAUHWY.js.map → chunk-REWXXBWB.js.map} +0 -0
  98. /package/dist/{chunk-PEQ5K2JO.js.map → chunk-RRQTQNEZ.js.map} +0 -0
  99. /package/dist/{chunk-L3VCBSFW.js.map → chunk-RV6FN6H5.js.map} +0 -0
  100. /package/dist/{chunk-GTSEPXAH.js.map → chunk-SL4GJOXD.js.map} +0 -0
  101. /package/dist/{chunk-XBQ554QP.js.map → chunk-WDNGLRFG.js.map} +0 -0
  102. /package/dist/{chunk-FMUBLLIZ.js.map → chunk-WKBQRD3C.js.map} +0 -0
  103. /package/dist/{chunk-ORNPI5YF.js.map → chunk-YJSLC7EL.js.map} +0 -0
  104. /package/dist/{chunks-RRV5535L.js.map → chunks-6DQOG4DF.js.map} +0 -0
  105. /package/dist/{formula-JZXPEDK3.js.map → formula-5FJYWUCU.js.map} +0 -0
  106. /package/dist/{formula-CJ5DGNGC.js.map → formula-TVCXNIK6.js.map} +0 -0
  107. /package/dist/{image-ocr-HLEL6TED.js.map → image-ocr-7GO5TH5P.js.map} +0 -0
  108. /package/dist/{image-ocr-2POAP5GL.js.map → image-ocr-V7I6PCZZ.js.map} +0 -0
  109. /package/dist/{model-bundle-7Z5HLNGX.js.map → model-bundle-WMRLFW4G.js.map} +0 -0
  110. /package/dist/{models-IGPCMPQQ.js.map → models-W6FRSQGA.js.map} +0 -0
  111. /package/dist/{parse-worker-v2-TS2JTIS2.js.map → parse-worker-v2-VQLZUE4K.js.map} +0 -0
  112. /package/dist/{parser-VHZ2PZXG.js.map → parser-K6IJGGTN.js.map} +0 -0
  113. /package/dist/{parser-WR6UBRI4.js.map → parser-K7EWKMGE.js.map} +0 -0
  114. /package/dist/{pdf-ocr-BLT45T3Z.js.map → pdf-ocr-MGQOWUSS.js.map} +0 -0
  115. /package/dist/{pdf-ocr-DKYP5EKK.js.map → pdf-ocr-OLBZVGJY.js.map} +0 -0
  116. /package/dist/{profile-io-KHEXVGDJ.js.map → profile-io-7Z7S6C4I.js.map} +0 -0
  117. /package/dist/{rasterize-KHGMOS2F.js.map → rasterize-YIQ5U4YU.js.map} +0 -0
  118. /package/dist/{redact-doc-DYWNTB2J.js.map → redact-doc-Q2G2VKBR.js.map} +0 -0
  119. /package/dist/{render-JNMZ5ULA.js.map → render-AQ2QOWOL.js.map} +0 -0
  120. /package/dist/{seal-FDHX37MP.js.map → seal-QDD5TY2C.js.map} +0 -0
  121. /package/dist/{setup-OQZS6I7X.js.map → setup-O7JRLVNI.js.map} +0 -0
  122. /package/dist/{visual-VZTQMICM.js.map → visual-VPCGIMNA.js.map} +0 -0
  123. /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.17 검증](docs/benchmarks.md)
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.17 · 2026-10-11 배포 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
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.17 배포 측정에서 기본값 종합 **0.963**, OCR 끔 **0.939**입니다. [옵션별 결과와 재현 방법](docs/benchmarks.md#pdf--markdown--opendataloader-bench)
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.17](https://github.com/chrisryugj/kordoc/releases/tag/v4.21.17)** · 2026-10-11
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-6F6L63RG.js";
57
+ } from "./chunk-AIJCO3QD.js";
58
58
  import {
59
59
  blocksToPages
60
- } from "./chunk-L3VCBSFW.js";
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-7ASI3XKM.js";
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-FWQHYJZ2.js";
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-FMUBLLIZ.js";
100
+ } from "./chunk-WKBQRD3C.js";
101
101
  import "./chunk-7FCNOKOR.js";
102
- import "./chunk-TZU7PXV2.js";
102
+ import "./chunk-DVGX37KX.js";
103
103
  import "./chunk-VQFA55IC.js";
104
- import "./chunk-Q4GXF444.js";
104
+ import "./chunk-NV3HZV5U.js";
105
105
  import {
106
106
  blocksToMarkdown,
107
107
  flattenLayoutTables,
108
108
  hasStructuredCellContent
109
- } from "./chunk-QLL7VG6L.js";
110
- import "./chunk-TUSREHO3.js";
109
+ } from "./chunk-PIIW5A33.js";
110
+ import "./chunk-M3SJKVRX.js";
111
111
  import {
112
112
  VERSION
113
- } from "./chunk-PEQ5K2JO.js";
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=-GS6LEDZ6.js.map
207
+ //# sourceMappingURL=-AQAGPODO.js.map
@@ -4,15 +4,15 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkVVFNVMFMcjs = require('./chunk-VVFNVMFM.cjs');
7
+ var _chunkTKFGJLFScjs = require('./chunk-TKFGJLFS.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkL3U6MKGVcjs = require('./chunk-L3U6MKGV.cjs');
11
+ var _chunkNL5H3LN7cjs = require('./chunk-NL5H3LN7.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkY4TO3GBFcjs = require('./chunk-Y4TO3GBF.cjs');
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 _chunkL3U6MKGVcjs.getModelsDir.call(void 0, "ppocr");
43
+ return _chunkNL5H3LN7cjs.getModelsDir.call(void 0, "ppocr");
44
44
  }
45
45
  async function ensureOcrModels(onProgress) {
46
- return _chunkL3U6MKGVcjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
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 _chunkVVFNVMFMcjs.tidyScriptTags.call(void 0, out);
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 head = a.text, joiner = wrapJoiner(a.text, b.text, lex);
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, { right: geo[i].right, width: geo[i].right - geo[i].left, fontSize: geo[i].fontSize });
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 >= _chunkVVFNVMFMcjs.HEADING_RATIO_H1) level = 1;
5149
- else if (ratio >= _chunkVVFNVMFMcjs.HEADING_RATIO_H2) level = 2;
5150
- else if (ratio >= _chunkVVFNVMFMcjs.HEADING_RATIO_H3) level = 3;
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 * _chunkVVFNVMFMcjs.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;
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 = _chunkY4TO3GBFcjs.safeMax.call(void 0, gaps);
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 = _chunkY4TO3GBFcjs.safeMin.call(void 0, gaps);
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 = _chunkY4TO3GBFcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkY4TO3GBFcjs.safeMin.call(void 0, allItems.map((i) => i.x));
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) _chunkVVFNVMFMcjs.CELL_EDGES.set(to, e);
7095
+ if (e) _chunkTKFGJLFScjs.CELL_EDGES.set(to, e);
7090
7096
  }
7091
7097
  function joinCellEdges(a, b) {
7092
- const u = _chunkVVFNVMFMcjs.CELL_EDGES.get(a), d = _chunkVVFNVMFMcjs.CELL_EDGES.get(b);
7098
+ const u = _chunkTKFGJLFScjs.CELL_EDGES.get(a), d = _chunkTKFGJLFScjs.CELL_EDGES.get(b);
7093
7099
  if (!u || !d) return;
7094
- _chunkVVFNVMFMcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
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]) _chunkVVFNVMFMcjs.CELL_EDGES.set(cell, NO_EDGES);
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 = _chunkVVFNVMFMcjs.CELL_EDGES.get(c);
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 = _chunkY4TO3GBFcjs.safeMax.call(void 0, allY) - _chunkY4TO3GBFcjs.safeMin.call(void 0, allY);
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 = _chunkY4TO3GBFcjs.safeMax.call(void 0, allY) - _chunkY4TO3GBFcjs.safeMin.call(void 0, allY);
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 = _chunkY4TO3GBFcjs.safeMax.call(void 0, allY) - _chunkY4TO3GBFcjs.safeMin.call(void 0, allY);
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-I43ZKTUM.cjs.map
8860
+ //# sourceMappingURL=chunk-6GSIGM7S.cjs.map