kordoc 4.21.16 → 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 (126) hide show
  1. package/README.md +7 -5
  2. package/dist/{-UXYZMTS3.js → -AQAGPODO.js} +11 -11
  3. package/dist/{chunk-KZ7BA2OM.cjs → chunk-6GSIGM7S.cjs} +36 -27
  4. package/dist/chunk-6GSIGM7S.cjs.map +1 -0
  5. package/dist/{chunk-XUXC3BZ6.js → chunk-6TDWJ3L3.js} +3 -3
  6. package/dist/{chunk-N5RIWVIC.js → chunk-A35RAVW6.js} +2 -2
  7. package/dist/{chunk-3QH3YMYN.js → chunk-AIJCO3QD.js} +10 -10
  8. package/dist/{chunk-SEC3LWGT.cjs → chunk-BDZUODUH.cjs} +3 -3
  9. package/dist/{chunk-SEC3LWGT.cjs.map → chunk-BDZUODUH.cjs.map} +1 -1
  10. package/dist/{chunk-BH3YWFQ2.js → chunk-BXMW24VV.js} +2 -2
  11. package/dist/{chunk-LUU44ZTY.cjs → chunk-CYGTZS4M.cjs} +2 -2
  12. package/dist/{chunk-LUU44ZTY.cjs.map → chunk-CYGTZS4M.cjs.map} +1 -1
  13. package/dist/{chunk-6NKVRRRA.js → chunk-DVGX37KX.js} +2 -2
  14. package/dist/{chunk-RAZWJ3U7.js → chunk-ES4VPZ3R.js} +3 -3
  15. package/dist/{chunk-U7NXCGTB.js → chunk-EUKY5YTO.js} +2 -2
  16. package/dist/{chunk-P5QIWYVM.js → chunk-JBFZPYHH.js} +2 -2
  17. package/dist/{chunk-WKVTKR3B.cjs → chunk-K5WKFUUK.cjs} +13 -13
  18. package/dist/{chunk-WKVTKR3B.cjs.map → chunk-K5WKFUUK.cjs.map} +1 -1
  19. package/dist/{chunk-XWBPXHKP.js → chunk-LS535RMK.js} +2 -2
  20. package/dist/{chunk-EOFOH42T.js → chunk-M3SJKVRX.js} +2 -2
  21. package/dist/{chunk-MV5HIQHU.cjs → chunk-NL5H3LN7.cjs} +3 -3
  22. package/dist/{chunk-MV5HIQHU.cjs.map → chunk-NL5H3LN7.cjs.map} +1 -1
  23. package/dist/{chunk-SRE2WOSL.js → chunk-NV3HZV5U.js} +2 -2
  24. package/dist/{chunk-LVIKAUU4.js → chunk-OYFQ2PHZ.js} +2 -2
  25. package/dist/{chunk-IWVUM6HF.js → chunk-P5UH7KV7.js} +2 -2
  26. package/dist/{chunk-FCMPZH3C.js → chunk-PIIW5A33.js} +2 -2
  27. package/dist/{chunk-BDAZLHIX.js → chunk-REWXXBWB.js} +2 -2
  28. package/dist/{chunk-OWWX5UTD.js → chunk-RRQTQNEZ.js} +2 -2
  29. package/dist/{chunk-HU57WCBC.js → chunk-RV6FN6H5.js} +2 -2
  30. package/dist/{chunk-RMJJKX2G.js → chunk-SL4GJOXD.js} +4 -4
  31. package/dist/{chunk-ZKWQZOIL.cjs → chunk-TKFGJLFS.cjs} +6 -6
  32. package/dist/{chunk-ZKWQZOIL.cjs.map → chunk-TKFGJLFS.cjs.map} +1 -1
  33. package/dist/{chunk-VPTFJTYT.js → chunk-V6AEFU7P.js} +18 -9
  34. package/dist/chunk-V6AEFU7P.js.map +1 -0
  35. package/dist/{chunk-STTG6A4U.js → chunk-WDNGLRFG.js} +3 -3
  36. package/dist/{chunk-TQY3IMGY.js → chunk-WKBQRD3C.js} +6 -6
  37. package/dist/{chunk-23MZM3TB.js → chunk-YJSLC7EL.js} +2 -2
  38. package/dist/{chunk-DOMPCV2Y.js → chunk-ZTTQQIIU.js} +17 -8
  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-H5LADM66.js → formula-5FJYWUCU.js} +4 -4
  43. package/dist/{formula-VC5F4S7C.cjs → formula-HZLAXSXC.cjs} +9 -9
  44. package/dist/{formula-VC5F4S7C.cjs.map → formula-HZLAXSXC.cjs.map} +1 -1
  45. package/dist/{formula-I7EOO6S2.js → formula-TVCXNIK6.js} +3 -3
  46. package/dist/{image-ocr-UDTUNF63.js → image-ocr-7GO5TH5P.js} +9 -9
  47. package/dist/{image-ocr-VC3T6KFN.cjs → image-ocr-JXYHKOMK.cjs} +15 -15
  48. package/dist/{image-ocr-VC3T6KFN.cjs.map → image-ocr-JXYHKOMK.cjs.map} +1 -1
  49. package/dist/{image-ocr-2DT5BU34.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-Z37CFFMW.js → model-bundle-WMRLFW4G.js} +5 -5
  54. package/dist/{models-GS4DRBDG.js → models-W6FRSQGA.js} +5 -5
  55. package/dist/{parse-worker-v2-WH3CMHIN.js → parse-worker-v2-VQLZUE4K.js} +12 -12
  56. package/dist/{parser-DFVRE7YF.cjs → parser-EYKIFP5L.cjs} +143 -138
  57. package/dist/parser-EYKIFP5L.cjs.map +1 -0
  58. package/dist/{parser-SMPMTT77.js → parser-K6IJGGTN.js} +17 -12
  59. package/dist/parser-K6IJGGTN.js.map +1 -0
  60. package/dist/{parser-IKWLVTWU.js → parser-K7EWKMGE.js} +20 -15
  61. package/dist/parser-K7EWKMGE.js.map +1 -0
  62. package/dist/pdf-ocr-MGQOWUSS.js +18 -0
  63. package/dist/pdf-ocr-OLBZVGJY.js +22 -0
  64. package/dist/pdf-ocr-SWUPEUKF.cjs +19 -0
  65. package/dist/{pdf-ocr-QJ6TWDGK.cjs.map → pdf-ocr-SWUPEUKF.cjs.map} +1 -1
  66. package/dist/{profile-io-TVR55F6Z.js → profile-io-7Z7S6C4I.js} +3 -3
  67. package/dist/{rasterize-ZTYN7LUB.js → rasterize-YIQ5U4YU.js} +3 -3
  68. package/dist/{redact-doc-6RFML2CI.js → redact-doc-Q2G2VKBR.js} +11 -11
  69. package/dist/{render-YEB6SN2W.js → render-AQ2QOWOL.js} +7 -7
  70. package/dist/seal-QDD5TY2C.js +10 -0
  71. package/dist/{setup-MBNEN7OK.js → setup-O7JRLVNI.js} +3 -3
  72. package/dist/visual-VPCGIMNA.js +20 -0
  73. package/dist/{watch-GAZ3L6JO.js → watch-E4ZMMTRI.js} +12 -12
  74. package/package.json +1 -1
  75. package/dist/chunk-DOMPCV2Y.js.map +0 -1
  76. package/dist/chunk-KZ7BA2OM.cjs.map +0 -1
  77. package/dist/chunk-VPTFJTYT.js.map +0 -1
  78. package/dist/chunks-UPIVB4EW.js +0 -10
  79. package/dist/parser-DFVRE7YF.cjs.map +0 -1
  80. package/dist/parser-IKWLVTWU.js.map +0 -1
  81. package/dist/parser-SMPMTT77.js.map +0 -1
  82. package/dist/pdf-ocr-HMSF3BEC.js +0 -22
  83. package/dist/pdf-ocr-QJ6TWDGK.cjs +0 -19
  84. package/dist/pdf-ocr-VSDGQ5HT.js +0 -18
  85. package/dist/seal-35ET5BXB.js +0 -10
  86. package/dist/visual-GBJCSTDI.js +0 -20
  87. /package/dist/{-UXYZMTS3.js.map → -AQAGPODO.js.map} +0 -0
  88. /package/dist/{chunk-XUXC3BZ6.js.map → chunk-6TDWJ3L3.js.map} +0 -0
  89. /package/dist/{chunk-N5RIWVIC.js.map → chunk-A35RAVW6.js.map} +0 -0
  90. /package/dist/{chunk-3QH3YMYN.js.map → chunk-AIJCO3QD.js.map} +0 -0
  91. /package/dist/{chunk-BH3YWFQ2.js.map → chunk-BXMW24VV.js.map} +0 -0
  92. /package/dist/{chunk-6NKVRRRA.js.map → chunk-DVGX37KX.js.map} +0 -0
  93. /package/dist/{chunk-RAZWJ3U7.js.map → chunk-ES4VPZ3R.js.map} +0 -0
  94. /package/dist/{chunk-U7NXCGTB.js.map → chunk-EUKY5YTO.js.map} +0 -0
  95. /package/dist/{chunk-P5QIWYVM.js.map → chunk-JBFZPYHH.js.map} +0 -0
  96. /package/dist/{chunk-XWBPXHKP.js.map → chunk-LS535RMK.js.map} +0 -0
  97. /package/dist/{chunk-EOFOH42T.js.map → chunk-M3SJKVRX.js.map} +0 -0
  98. /package/dist/{chunk-SRE2WOSL.js.map → chunk-NV3HZV5U.js.map} +0 -0
  99. /package/dist/{chunk-LVIKAUU4.js.map → chunk-OYFQ2PHZ.js.map} +0 -0
  100. /package/dist/{chunk-IWVUM6HF.js.map → chunk-P5UH7KV7.js.map} +0 -0
  101. /package/dist/{chunk-FCMPZH3C.js.map → chunk-PIIW5A33.js.map} +0 -0
  102. /package/dist/{chunk-BDAZLHIX.js.map → chunk-REWXXBWB.js.map} +0 -0
  103. /package/dist/{chunk-OWWX5UTD.js.map → chunk-RRQTQNEZ.js.map} +0 -0
  104. /package/dist/{chunk-HU57WCBC.js.map → chunk-RV6FN6H5.js.map} +0 -0
  105. /package/dist/{chunk-RMJJKX2G.js.map → chunk-SL4GJOXD.js.map} +0 -0
  106. /package/dist/{chunk-STTG6A4U.js.map → chunk-WDNGLRFG.js.map} +0 -0
  107. /package/dist/{chunk-TQY3IMGY.js.map → chunk-WKBQRD3C.js.map} +0 -0
  108. /package/dist/{chunk-23MZM3TB.js.map → chunk-YJSLC7EL.js.map} +0 -0
  109. /package/dist/{chunks-UPIVB4EW.js.map → chunks-6DQOG4DF.js.map} +0 -0
  110. /package/dist/{formula-H5LADM66.js.map → formula-5FJYWUCU.js.map} +0 -0
  111. /package/dist/{formula-I7EOO6S2.js.map → formula-TVCXNIK6.js.map} +0 -0
  112. /package/dist/{image-ocr-UDTUNF63.js.map → image-ocr-7GO5TH5P.js.map} +0 -0
  113. /package/dist/{image-ocr-2DT5BU34.js.map → image-ocr-V7I6PCZZ.js.map} +0 -0
  114. /package/dist/{model-bundle-Z37CFFMW.js.map → model-bundle-WMRLFW4G.js.map} +0 -0
  115. /package/dist/{models-GS4DRBDG.js.map → models-W6FRSQGA.js.map} +0 -0
  116. /package/dist/{parse-worker-v2-WH3CMHIN.js.map → parse-worker-v2-VQLZUE4K.js.map} +0 -0
  117. /package/dist/{pdf-ocr-HMSF3BEC.js.map → pdf-ocr-MGQOWUSS.js.map} +0 -0
  118. /package/dist/{pdf-ocr-VSDGQ5HT.js.map → pdf-ocr-OLBZVGJY.js.map} +0 -0
  119. /package/dist/{profile-io-TVR55F6Z.js.map → profile-io-7Z7S6C4I.js.map} +0 -0
  120. /package/dist/{rasterize-ZTYN7LUB.js.map → rasterize-YIQ5U4YU.js.map} +0 -0
  121. /package/dist/{redact-doc-6RFML2CI.js.map → redact-doc-Q2G2VKBR.js.map} +0 -0
  122. /package/dist/{render-YEB6SN2W.js.map → render-AQ2QOWOL.js.map} +0 -0
  123. /package/dist/{seal-35ET5BXB.js.map → seal-QDD5TY2C.js.map} +0 -0
  124. /package/dist/{setup-MBNEN7OK.js.map → setup-O7JRLVNI.js.map} +0 -0
  125. /package/dist/{visual-GBJCSTDI.js.map → visual-VPCGIMNA.js.map} +0 -0
  126. /package/dist/{watch-GAZ3L6JO.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.16 검증](docs/benchmarks.md)
15
+ - 🇰🇷 **한국 공문서 표 구조 100%** — 원본 HWPX 2,424문서의 보이는 표 **10,342개 전부 구조 일치**. [4.21.18 검증](docs/benchmarks.md)
16
16
 
17
17
  쓸모 있었다면 GitHub ⭐ 하나 눌러주세요. 다른 사람이 이 도구를 찾는 데 도움이 됩니다.
18
18
 
@@ -100,27 +100,29 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
100
100
 
101
101
  ## 검증 결과
102
102
 
103
- **4.21.16 · 2026-10-11 배포 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
103
+ **4.21.18 · 2026-10-11 배포 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
104
104
 
105
105
  | 대상 | 규모 | 결과 |
106
106
  | --- | --- | --- |
107
107
  | HWPX | 2,424문서 · 10,342표 | 표 구조 일치 **10,342/10,342 · 100%** |
108
108
  | HWP 5.x ↔ HWPX | 1,130쌍 · 4,315표 | 짝 문서의 표 구조 일치 **100%** |
109
- | PDF 글 | 744쌍 | 글자 재현율 **99.84%** · 정확도 **99.64%** · 읽기 순서 **99.16%** · 어절 F1 **98.98%** |
109
+ | PDF 글 | 744쌍 | 글자 재현율 **99.84%** · 정확도 **99.64%** · 읽기 순서 **99.16%** · 어절 F1 **98.99%** |
110
110
  | PDF 표 | 708쌍 · 2,331표 | 표 탐지 **99.83%** · 구조 일치 **97.98%** · 칸 F1 **0.991** |
111
111
  | PDF 전체 | 1,911문서 중 1,729건 채점 | 글 커버리지 **99.80%** |
112
112
  | OCR | 53문서 · 102쪽 | CER **0.0412** · 글자 재현율 **99.02%** |
113
113
 
114
114
  표 구조 점수와 셀 내용·화면 재현은 별도 지표입니다. 채점 범위·제외 기준·전 벤치 문서별 비교는 [벤치마크 상세](docs/benchmarks.md)에 있습니다.
115
115
 
116
- 외부 PDF 벤치 **opendataloader-bench 200문서**는 4.21.16 배포 측정에서 기본값 종합 **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.16](https://github.com/chrisryugj/kordoc/releases/tag/v4.21.16)** · 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문서 상승) |
125
+ | 4.21.17 | PDF 공백 없는 꽉 찬 줄 끝 + 영문 괄호 — "공적개발원조⏎(ODA)"·"하네스⏎(safety …)" 를 붙여 씀 (PDF 어절 F1 98.98 → 98.99%) |
124
126
  | 4.21.16 | PDF 표 쪽 넘김 갈린 행의 수량 이어짐 — 머리 칸 "30%" / 다음 쪽 "미만" 을 한 칸으로; 공문서 autoFit.safety(다른 조판기용 한 줄 판정 여유) (법령 별표 PDF 표 97.40 → 97.69%) |
125
127
  | 4.21.15 | PDF 줄 끝 공백 글리프로 어절 경계 꺾임 가르기 — 원문이 띄운 줄 꺾임("이루어⏎진다면")을 붙이던 것 (PDF 어절 F1 98.89 → 98.98%) |
126
128
  | 4.21.14 | 한컴 PDF 유니코드 없는 기호 되살리기 — 자동 글머리표·괄호(U+F000)를 글꼴 윤곽 모양으로 "▸"·"□"·"《》"·"↓" 등으로; 텍스트층 커버리지 채점 기준 변경 (PDF 어절 F1 98.87 → 98.89%·글 재현율 99.83 → 99.84%) |
@@ -54,17 +54,17 @@ import {
54
54
  unknownFontWarnings,
55
55
  usesGaejosikMunche,
56
56
  validateHwpx
57
- } from "./chunk-3QH3YMYN.js";
57
+ } from "./chunk-AIJCO3QD.js";
58
58
  import {
59
59
  blocksToPages
60
- } from "./chunk-HU57WCBC.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-RAZWJ3U7.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-XWBPXHKP.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-TQY3IMGY.js";
100
+ } from "./chunk-WKBQRD3C.js";
101
101
  import "./chunk-7FCNOKOR.js";
102
- import "./chunk-6NKVRRRA.js";
102
+ import "./chunk-DVGX37KX.js";
103
103
  import "./chunk-VQFA55IC.js";
104
- import "./chunk-SRE2WOSL.js";
104
+ import "./chunk-NV3HZV5U.js";
105
105
  import {
106
106
  blocksToMarkdown,
107
107
  flattenLayoutTables,
108
108
  hasStructuredCellContent
109
- } from "./chunk-FCMPZH3C.js";
110
- import "./chunk-EOFOH42T.js";
109
+ } from "./chunk-PIIW5A33.js";
110
+ import "./chunk-M3SJKVRX.js";
111
111
  import {
112
112
  VERSION
113
- } from "./chunk-OWWX5UTD.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=-UXYZMTS3.js.map
207
+ //# sourceMappingURL=-AQAGPODO.js.map
@@ -4,15 +4,15 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkZKWQZOILcjs = require('./chunk-ZKWQZOIL.cjs');
7
+ var _chunkTKFGJLFScjs = require('./chunk-TKFGJLFS.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkMV5HIQHUcjs = require('./chunk-MV5HIQHU.cjs');
11
+ var _chunkNL5H3LN7cjs = require('./chunk-NL5H3LN7.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkLUU44ZTYcjs = require('./chunk-LUU44ZTY.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 _chunkMV5HIQHUcjs.getModelsDir.call(void 0, "ppocr");
43
+ return _chunkNL5H3LN7cjs.getModelsDir.call(void 0, "ppocr");
44
44
  }
45
45
  async function ensureOcrModels(onProgress) {
46
- return _chunkMV5HIQHUcjs.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 _chunkZKWQZOILcjs.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 }))]);
@@ -3010,7 +3011,7 @@ function normalizeItems(rawItems) {
3010
3011
  fontName: i.fontName || "",
3011
3012
  isHidden,
3012
3013
  seq: seq + k / 1e3,
3013
- ...spaceAfter && k === split.length - 1 ? { spaceAfter } : {}
3014
+ ...spaceAfter !== void 0 && k === split.length - 1 ? { spaceAfter } : {}
3014
3015
  });
3015
3016
  });
3016
3017
  } else {
@@ -3027,7 +3028,7 @@ function normalizeItems(rawItems) {
3027
3028
  fontName: i.fontName || "",
3028
3029
  isHidden,
3029
3030
  seq,
3030
- ...spaceAfter ? { spaceAfter } : {},
3031
+ ...spaceAfter !== void 0 ? { spaceAfter } : {},
3031
3032
  ...rotated ? { rotated: Math.max(1, w), ...i.transform[1] < 0 ? { rotatedDown: true } : {} } : {}
3032
3033
  });
3033
3034
  }
@@ -5086,8 +5087,11 @@ function pushLineParagraphs(out, yLines, pageNum, lex) {
5086
5087
  joins[i] = wrapJoiner(geo[i].text, geo[i + 1].text, lex);
5087
5088
  }
5088
5089
  }
5090
+ const blockRight = Math.max(...geo.map((g) => g.right));
5089
5091
  for (let i = 0; i + 1 < lines.length; i++) {
5090
- if (joins[i] === "" && lines[i].items.reduce((a, b) => b.x + b.w > a.x + a.w ? b : a).spaceAfter) joins[i] = " ";
5092
+ const last = lines[i].items.reduce((a, b) => b.x + b.w > a.x + a.w ? b : a);
5093
+ if (joins[i] === "" && last.spaceAfter) joins[i] = " ";
5094
+ else if (joins[i] === " " && last.spaceAfter === false && blockRight - geo[i].right < 0.2 * geo[i].fontSize && /[가-힣]$/.test(geo[i].text.replace(/<\/?u>|~~/g, "").trimEnd()) && /^\((?:[A-Za-z/]|[’'‘])/.test(geo[i + 1].text.replace(/<\/?u>|~~/g, "").trimStart())) joins[i] = "";
5091
5095
  }
5092
5096
  for (const i of tocRecordBoundaries(lines.map((line) => line.items))) joins[i] = "\n";
5093
5097
  for (let i = 0; i + 1 < geo.length; i++) {
@@ -5112,7 +5116,12 @@ function pushLineParagraphs(out, yLines, pageNum, lex) {
5112
5116
  const faces = /* @__PURE__ */ new Map();
5113
5117
  for (const it of items) faces.set(it.fontName, (_nullishCoalesce(faces.get(it.fontName), () => ( 0))) + it.text.length);
5114
5118
  FACE_CHARS.set(block, faces);
5115
- 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
+ });
5116
5125
  PARA_FIRST_LEFT.set(block.bbox, geo[first2].left);
5117
5126
  out.push(block);
5118
5127
  i++;
@@ -5142,9 +5151,9 @@ function detectHeadings(blocks, medianFontSize) {
5142
5151
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
5143
5152
  const ratio = block.style.fontSize / medianFontSize;
5144
5153
  let level = 0;
5145
- if (ratio >= _chunkZKWQZOILcjs.HEADING_RATIO_H1) level = 1;
5146
- else if (ratio >= _chunkZKWQZOILcjs.HEADING_RATIO_H2) level = 2;
5147
- else if (ratio >= _chunkZKWQZOILcjs.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;
5148
5157
  if (level > 0) {
5149
5158
  block.type = "heading";
5150
5159
  block.level = level;
@@ -5157,7 +5166,7 @@ function isChapterNumber(block, next, medianFontSize) {
5157
5166
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _143 => _143.style, 'optionalAccess', _144 => _144.fontSize]), () => ( 0));
5158
5167
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _145 => _145.text, 'optionalAccess', _146 => _146.trim, 'call', _147 => _147()]), () => ( ""));
5159
5168
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _148 => _148.bbox]);
5160
- 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 * _chunkZKWQZOILcjs.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;
5161
5170
  }
5162
5171
  function mergeStackedHeadingLines(blocks, medianFontSize) {
5163
5172
  for (let i = 0; i < blocks.length - 1; ) {
@@ -6530,16 +6539,16 @@ function isProseSpread(items) {
6530
6539
  for (let i = 1; i < sorted.length; i++) {
6531
6540
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
6532
6541
  }
6533
- const maxGap = _chunkLUU44ZTYcjs.safeMax.call(void 0, gaps);
6542
+ const maxGap = _chunkCYGTZS4Mcjs.safeMax.call(void 0, gaps);
6534
6543
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
6535
6544
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
6536
- const minGap = _chunkLUU44ZTYcjs.safeMin.call(void 0, gaps);
6545
+ const minGap = _chunkCYGTZS4Mcjs.safeMin.call(void 0, gaps);
6537
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;
6538
6547
  }
6539
6548
  function detectColumns(yLines) {
6540
6549
  const allItems = yLines.flat();
6541
6550
  if (allItems.length === 0) return null;
6542
- const pageWidth = _chunkLUU44ZTYcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkLUU44ZTYcjs.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));
6543
6552
  if (pageWidth < 100) return null;
6544
6553
  let bigoLineIdx = -1;
6545
6554
  for (let i = 0; i < yLines.length; i++) {
@@ -7083,12 +7092,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
7083
7092
  }
7084
7093
  function takeClipCellEdges(from, to) {
7085
7094
  const e = CLIP_CELL_EDGES.get(from);
7086
- if (e) _chunkZKWQZOILcjs.CELL_EDGES.set(to, e);
7095
+ if (e) _chunkTKFGJLFScjs.CELL_EDGES.set(to, e);
7087
7096
  }
7088
7097
  function joinCellEdges(a, b) {
7089
- const u = _chunkZKWQZOILcjs.CELL_EDGES.get(a), d = _chunkZKWQZOILcjs.CELL_EDGES.get(b);
7098
+ const u = _chunkTKFGJLFScjs.CELL_EDGES.get(a), d = _chunkTKFGJLFScjs.CELL_EDGES.get(b);
7090
7099
  if (!u || !d) return;
7091
- _chunkZKWQZOILcjs.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 });
7092
7101
  }
7093
7102
 
7094
7103
  // src/pdf/table-unit-row.ts
@@ -7104,7 +7113,7 @@ function rebuildUnitLine(items, grid) {
7104
7113
  function prependUnitRow(cells, cols, line, usedItems) {
7105
7114
  const text = cleanCellText(line.map((item) => item.text).join(""));
7106
7115
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
7107
- for (const cell of cells[0]) _chunkZKWQZOILcjs.CELL_EDGES.set(cell, NO_EDGES);
7116
+ for (const cell of cells[0]) _chunkTKFGJLFScjs.CELL_EDGES.set(cell, NO_EDGES);
7108
7117
  for (const item of line) usedItems.add(item);
7109
7118
  }
7110
7119
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -7634,7 +7643,7 @@ function recordFrameTitle(table, source, pageNum) {
7634
7643
  const [label, spacer, title] = cells;
7635
7644
  if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
7636
7645
  if (cells.some((c) => {
7637
- const e = _chunkZKWQZOILcjs.CELL_EDGES.get(c);
7646
+ const e = _chunkTKFGJLFScjs.CELL_EDGES.get(c);
7638
7647
  return !e || e.t || e.b || e.l || e.r;
7639
7648
  })) return;
7640
7649
  const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _344 => _344.fontSize]), () => ( 0));
@@ -8293,7 +8302,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
8293
8302
  groupSizes.push(1);
8294
8303
  }
8295
8304
  const allY = remaining.map((i) => i.y);
8296
- const pageH = _chunkLUU44ZTYcjs.safeMax.call(void 0, allY) - _chunkLUU44ZTYcjs.safeMin.call(void 0, allY);
8305
+ const pageH = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
8297
8306
  const gapThreshold = Math.max(15, pageH * 0.03);
8298
8307
  const sides = frameColumnTextBands(remaining, spanning, gx);
8299
8308
  const textBlocks = [];
@@ -8309,7 +8318,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
8309
8318
  finalTextBlocks.push(...detectListBlocks(textBlocks));
8310
8319
  } else {
8311
8320
  const allY = remaining.map((i) => i.y);
8312
- const pageH = _chunkLUU44ZTYcjs.safeMax.call(void 0, allY) - _chunkLUU44ZTYcjs.safeMin.call(void 0, allY);
8321
+ const pageH = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
8313
8322
  const gapThreshold = Math.max(15, pageH * 0.03);
8314
8323
  const groups = xyCutOrder(remaining, gapThreshold);
8315
8324
  const textBlocks = [];
@@ -8637,7 +8646,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
8637
8646
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
8638
8647
  } else {
8639
8648
  const allY = items.map((i) => i.y);
8640
- const pageHeight = _chunkLUU44ZTYcjs.safeMax.call(void 0, allY) - _chunkLUU44ZTYcjs.safeMin.call(void 0, allY);
8649
+ const pageHeight = _chunkCYGTZS4Mcjs.safeMax.call(void 0, allY) - _chunkCYGTZS4Mcjs.safeMin.call(void 0, allY);
8641
8650
  const gapThreshold = Math.max(15, pageHeight * 0.03);
8642
8651
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
8643
8652
  for (const group of orderedGroups) {
@@ -8848,4 +8857,4 @@ function rowParagraphs(block) {
8848
8857
 
8849
8858
 
8850
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;
8851
- //# sourceMappingURL=chunk-KZ7BA2OM.cjs.map
8860
+ //# sourceMappingURL=chunk-6GSIGM7S.cjs.map