kordoc 4.24.70 → 4.24.72

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 (182) hide show
  1. package/README.md +4 -4
  2. package/dist/{-JPBHAOIR.js → -S32WDXC4.js} +21 -21
  3. package/dist/{chunk-TAATW772.js → chunk-2SUWIRWH.js} +10 -10
  4. package/dist/{chunk-G5YCISXC.js → chunk-4ECEC6FD.js} +80 -33
  5. package/dist/chunk-4ECEC6FD.js.map +1 -0
  6. package/dist/{chunk-JVVTJDJY.js → chunk-4GPZVPYG.js} +3 -3
  7. package/dist/{chunk-OHSTI6C3.js → chunk-4Q7L4IDD.js} +2 -2
  8. package/dist/{chunk-6T6VP4AQ.js → chunk-4QOTRR5Z.js} +6 -6
  9. package/dist/{chunk-UMVD6PRZ.js → chunk-4UL2KIOH.js} +3 -3
  10. package/dist/{chunk-JLMNWMZJ.cjs → chunk-5CYWVW3V.cjs} +88 -88
  11. package/dist/{chunk-JLMNWMZJ.cjs.map → chunk-5CYWVW3V.cjs.map} +1 -1
  12. package/dist/{chunk-LEITYWHM.js → chunk-6DIACQ3R.js} +2 -2
  13. package/dist/{chunk-KV5YT6L4.js → chunk-6GQGU57N.js} +3 -3
  14. package/dist/{chunk-O2RV2FMS.js → chunk-7N2L6FBB.js} +5 -5
  15. package/dist/{chunk-FPGY6TH2.js → chunk-BD75GPTM.js} +2 -2
  16. package/dist/{chunk-R6J7X4ND.js → chunk-BJCTFKEU.js} +2 -2
  17. package/dist/{chunk-6SQF5PAM.js → chunk-C3USRXCH.js} +2 -2
  18. package/dist/{chunk-G3UCY3T7.js → chunk-C4K2XCGX.js} +2 -2
  19. package/dist/{chunk-EESBEBUC.cjs → chunk-COG4POSK.cjs} +256 -209
  20. package/dist/chunk-COG4POSK.cjs.map +1 -0
  21. package/dist/{chunk-7CLI2Y6A.js → chunk-CQUOEZBJ.js} +2 -2
  22. package/dist/{chunk-YY54476T.js → chunk-DIHV6CDK.js} +2 -2
  23. package/dist/{chunk-VZ2J3654.js → chunk-FKCSNCWC.js} +5 -5
  24. package/dist/{chunk-KET32GPP.js → chunk-FTPYYLCR.js} +3 -3
  25. package/dist/{chunk-XHBJCOWB.js → chunk-G3TKEQZ3.js} +4 -4
  26. package/dist/{chunk-WVQDRZF5.js → chunk-GAZDWFRT.js} +11 -11
  27. package/dist/{chunk-QTRQ4KM3.js → chunk-GK4OHUV5.js} +2 -2
  28. package/dist/{chunk-ZMPNA2W7.js → chunk-GOQWCHX5.js} +7 -7
  29. package/dist/{chunk-RTQ2N6DG.js → chunk-IPYSZ2WD.js} +6 -6
  30. package/dist/{chunk-XRZERCPJ.cjs → chunk-JE4NCQIN.cjs} +3 -3
  31. package/dist/{chunk-XRZERCPJ.cjs.map → chunk-JE4NCQIN.cjs.map} +1 -1
  32. package/dist/{chunk-HUKGGV5M.js → chunk-JEPTA64I.js} +2 -2
  33. package/dist/{chunk-A5MTYCTO.cjs → chunk-L4GCUYDS.cjs} +8 -8
  34. package/dist/{chunk-A5MTYCTO.cjs.map → chunk-L4GCUYDS.cjs.map} +1 -1
  35. package/dist/{chunk-MIERFAOB.js → chunk-LINC7S3M.js} +2 -2
  36. package/dist/{chunk-N426QQP6.js → chunk-MCO77XJN.js} +2 -2
  37. package/dist/{chunk-Q4DDUA7U.js → chunk-MHYFBIS5.js} +2 -2
  38. package/dist/{chunk-6PVJCEF7.js → chunk-NHWWNRQT.js} +2 -2
  39. package/dist/{chunk-YG42FESS.js → chunk-O4MTW4JH.js} +18 -16
  40. package/dist/chunk-O4MTW4JH.js.map +1 -0
  41. package/dist/{chunk-N6XPJBIS.js → chunk-SGQC3BVV.js} +79 -32
  42. package/dist/chunk-SGQC3BVV.js.map +1 -0
  43. package/dist/{chunk-UD7DB4U3.js → chunk-SNNM4GFE.js} +2 -2
  44. package/dist/{chunk-OTIYXYOL.cjs → chunk-TDNYBCPC.cjs} +104 -104
  45. package/dist/{chunk-OTIYXYOL.cjs.map → chunk-TDNYBCPC.cjs.map} +1 -1
  46. package/dist/{chunk-NIFJSZR7.cjs → chunk-U2K3WVR5.cjs} +3 -3
  47. package/dist/{chunk-NIFJSZR7.cjs.map → chunk-U2K3WVR5.cjs.map} +1 -1
  48. package/dist/{chunk-MU7YOHDK.js → chunk-U6CZ5IGF.js} +2 -2
  49. package/dist/{chunk-ICK4R4HF.js → chunk-UOML7PVK.js} +2 -2
  50. package/dist/{chunk-CVH5PB65.js → chunk-VRJ3CABR.js} +2 -2
  51. package/dist/{chunk-7D6KEQNU.cjs → chunk-WWTG5JUI.cjs} +58 -58
  52. package/dist/{chunk-7D6KEQNU.cjs.map → chunk-WWTG5JUI.cjs.map} +1 -1
  53. package/dist/{chunk-VCRBRUCO.js → chunk-WXKUE2MU.js} +5 -5
  54. package/dist/{chunk-6UNCF3PJ.js → chunk-YZXGUJFI.js} +2 -2
  55. package/dist/{chunk-3EPX46NF.cjs → chunk-ZTVH2HQ5.cjs} +2 -2
  56. package/dist/{chunk-3EPX46NF.cjs.map → chunk-ZTVH2HQ5.cjs.map} +1 -1
  57. package/dist/chunks-XNCDYMWO.js +11 -0
  58. package/dist/cli.js +45 -45
  59. package/dist/{formula-BVDS6XNY.cjs → formula-BLK43PWB.cjs} +41 -11
  60. package/dist/formula-BLK43PWB.cjs.map +1 -0
  61. package/dist/{formula-BJU6ZM3X.js → formula-E5QNTLM3.js} +35 -5
  62. package/dist/formula-E5QNTLM3.js.map +1 -0
  63. package/dist/{formula-ESTBYQ67.js → formula-WVFBIXND.js} +36 -6
  64. package/dist/formula-WVFBIXND.js.map +1 -0
  65. package/dist/generator-5VFDO4CB.js +11 -0
  66. package/dist/generator-APR6DUTL.cjs +12 -0
  67. package/dist/{generator-JBGS3C5H.cjs.map → generator-APR6DUTL.cjs.map} +1 -1
  68. package/dist/generator-IOGPVCG2.js +18 -0
  69. package/dist/{hancom-FINYE4NT.js → hancom-BCYRSFDF.js} +2 -2
  70. package/dist/{hancom-YC2LGVBP.cjs → hancom-DJTR4HYI.cjs} +5 -5
  71. package/dist/{hancom-YC2LGVBP.cjs.map → hancom-DJTR4HYI.cjs.map} +1 -1
  72. package/dist/{hancom-TE4NLTFM.js → hancom-HLLJXF2H.js} +2 -2
  73. package/dist/{image-ocr-TB5QRYYM.js → image-ocr-B5SIBPET.js} +10 -10
  74. package/dist/{image-ocr-T77T2NQO.cjs → image-ocr-HCT57HQA.cjs} +28 -28
  75. package/dist/{image-ocr-T77T2NQO.cjs.map → image-ocr-HCT57HQA.cjs.map} +1 -1
  76. package/dist/{image-ocr-L256UYPI.js → image-ocr-QSSVO27L.js} +7 -7
  77. package/dist/index.cjs +1118 -1116
  78. package/dist/index.cjs.map +1 -1
  79. package/dist/index.js +12 -10
  80. package/dist/index.js.map +1 -1
  81. package/dist/mcp.js +36 -36
  82. package/dist/memo-R5CO35OZ.js +17 -0
  83. package/dist/{model-bundle-THGO5EUW.js → model-bundle-KB7GFS7J.js} +5 -5
  84. package/dist/{models-MKIZDK2U.js → models-A6PYBE2Q.js} +5 -5
  85. package/dist/{parse-worker-v2-MGNDWJDE.js → parse-worker-v2-OSOABIQB.js} +22 -22
  86. package/dist/{parser-C6EZWRQM.js → parser-E2ZCR6UV.js} +12 -12
  87. package/dist/{parser-EULDI5W6.js → parser-F7Q2ENVO.js} +9 -9
  88. package/dist/{parser-IC2X7P2S.cjs → parser-JQXLIKOT.cjs} +166 -166
  89. package/dist/{parser-IC2X7P2S.cjs.map → parser-JQXLIKOT.cjs.map} +1 -1
  90. package/dist/pdf-ocr-AV7FKNFZ.cjs +43 -0
  91. package/dist/{pdf-ocr-7SNY67NL.cjs.map → pdf-ocr-AV7FKNFZ.cjs.map} +1 -1
  92. package/dist/{pdf-ocr-LQ5SYFCE.js → pdf-ocr-B6QVPBMI.js} +6 -6
  93. package/dist/{pdf-ocr-4Y6VPEZC.js → pdf-ocr-RY6UZ5PG.js} +9 -9
  94. package/dist/{profile-io-SDJTSIFY.js → profile-io-FX2SDCMR.js} +3 -3
  95. package/dist/{rasterize-TGFUBV6B.js → rasterize-ZJAMZCQM.js} +3 -3
  96. package/dist/{redact-doc-X5WKER3O.js → redact-doc-DNXUF4WL.js} +21 -21
  97. package/dist/{render-6KIT7GYL.js → render-FQ2LMZIL.js} +12 -12
  98. package/dist/{rewrite-fallback-ARYCZKU6.js → rewrite-fallback-QNLQXJRS.js} +13 -13
  99. package/dist/seal-6LBVNZYX.js +16 -0
  100. package/dist/{setup-ZEMI2HI4.js → setup-2VMN6LBY.js} +3 -3
  101. package/dist/to-hwpx-2RENWAWF.cjs +16 -0
  102. package/dist/{to-hwpx-MVDTG25O.cjs.map → to-hwpx-2RENWAWF.cjs.map} +1 -1
  103. package/dist/{to-hwpx-QRVTR6VA.js → to-hwpx-DS6DH5WH.js} +4 -4
  104. package/dist/{to-hwpx-XCS6LSWE.js → to-hwpx-H7B6CEN5.js} +7 -7
  105. package/dist/visual-3H3HGNOW.js +38 -0
  106. package/dist/{watch-LFL26YPL.js → watch-53NVSD5Z.js} +22 -22
  107. package/package.json +1 -1
  108. package/dist/chunk-EESBEBUC.cjs.map +0 -1
  109. package/dist/chunk-G5YCISXC.js.map +0 -1
  110. package/dist/chunk-N6XPJBIS.js.map +0 -1
  111. package/dist/chunk-YG42FESS.js.map +0 -1
  112. package/dist/chunks-7ABYRV7K.js +0 -11
  113. package/dist/formula-BJU6ZM3X.js.map +0 -1
  114. package/dist/formula-BVDS6XNY.cjs.map +0 -1
  115. package/dist/formula-ESTBYQ67.js.map +0 -1
  116. package/dist/generator-B5RBQFEP.js +0 -18
  117. package/dist/generator-JBGS3C5H.cjs +0 -12
  118. package/dist/generator-NZFUFJL4.js +0 -11
  119. package/dist/memo-VDT6J2FA.js +0 -17
  120. package/dist/pdf-ocr-7SNY67NL.cjs +0 -43
  121. package/dist/seal-4IPGOMFX.js +0 -16
  122. package/dist/to-hwpx-MVDTG25O.cjs +0 -16
  123. package/dist/visual-4D32BQGS.js +0 -38
  124. /package/dist/{-JPBHAOIR.js.map → -S32WDXC4.js.map} +0 -0
  125. /package/dist/{chunk-TAATW772.js.map → chunk-2SUWIRWH.js.map} +0 -0
  126. /package/dist/{chunk-JVVTJDJY.js.map → chunk-4GPZVPYG.js.map} +0 -0
  127. /package/dist/{chunk-OHSTI6C3.js.map → chunk-4Q7L4IDD.js.map} +0 -0
  128. /package/dist/{chunk-6T6VP4AQ.js.map → chunk-4QOTRR5Z.js.map} +0 -0
  129. /package/dist/{chunk-UMVD6PRZ.js.map → chunk-4UL2KIOH.js.map} +0 -0
  130. /package/dist/{chunk-LEITYWHM.js.map → chunk-6DIACQ3R.js.map} +0 -0
  131. /package/dist/{chunk-KV5YT6L4.js.map → chunk-6GQGU57N.js.map} +0 -0
  132. /package/dist/{chunk-O2RV2FMS.js.map → chunk-7N2L6FBB.js.map} +0 -0
  133. /package/dist/{chunk-FPGY6TH2.js.map → chunk-BD75GPTM.js.map} +0 -0
  134. /package/dist/{chunk-R6J7X4ND.js.map → chunk-BJCTFKEU.js.map} +0 -0
  135. /package/dist/{chunk-6SQF5PAM.js.map → chunk-C3USRXCH.js.map} +0 -0
  136. /package/dist/{chunk-G3UCY3T7.js.map → chunk-C4K2XCGX.js.map} +0 -0
  137. /package/dist/{chunk-7CLI2Y6A.js.map → chunk-CQUOEZBJ.js.map} +0 -0
  138. /package/dist/{chunk-YY54476T.js.map → chunk-DIHV6CDK.js.map} +0 -0
  139. /package/dist/{chunk-VZ2J3654.js.map → chunk-FKCSNCWC.js.map} +0 -0
  140. /package/dist/{chunk-KET32GPP.js.map → chunk-FTPYYLCR.js.map} +0 -0
  141. /package/dist/{chunk-XHBJCOWB.js.map → chunk-G3TKEQZ3.js.map} +0 -0
  142. /package/dist/{chunk-WVQDRZF5.js.map → chunk-GAZDWFRT.js.map} +0 -0
  143. /package/dist/{chunk-QTRQ4KM3.js.map → chunk-GK4OHUV5.js.map} +0 -0
  144. /package/dist/{chunk-ZMPNA2W7.js.map → chunk-GOQWCHX5.js.map} +0 -0
  145. /package/dist/{chunk-RTQ2N6DG.js.map → chunk-IPYSZ2WD.js.map} +0 -0
  146. /package/dist/{chunk-HUKGGV5M.js.map → chunk-JEPTA64I.js.map} +0 -0
  147. /package/dist/{chunk-MIERFAOB.js.map → chunk-LINC7S3M.js.map} +0 -0
  148. /package/dist/{chunk-N426QQP6.js.map → chunk-MCO77XJN.js.map} +0 -0
  149. /package/dist/{chunk-Q4DDUA7U.js.map → chunk-MHYFBIS5.js.map} +0 -0
  150. /package/dist/{chunk-6PVJCEF7.js.map → chunk-NHWWNRQT.js.map} +0 -0
  151. /package/dist/{chunk-UD7DB4U3.js.map → chunk-SNNM4GFE.js.map} +0 -0
  152. /package/dist/{chunk-MU7YOHDK.js.map → chunk-U6CZ5IGF.js.map} +0 -0
  153. /package/dist/{chunk-ICK4R4HF.js.map → chunk-UOML7PVK.js.map} +0 -0
  154. /package/dist/{chunk-CVH5PB65.js.map → chunk-VRJ3CABR.js.map} +0 -0
  155. /package/dist/{chunk-VCRBRUCO.js.map → chunk-WXKUE2MU.js.map} +0 -0
  156. /package/dist/{chunk-6UNCF3PJ.js.map → chunk-YZXGUJFI.js.map} +0 -0
  157. /package/dist/{chunks-7ABYRV7K.js.map → chunks-XNCDYMWO.js.map} +0 -0
  158. /package/dist/{generator-B5RBQFEP.js.map → generator-5VFDO4CB.js.map} +0 -0
  159. /package/dist/{generator-NZFUFJL4.js.map → generator-IOGPVCG2.js.map} +0 -0
  160. /package/dist/{hancom-FINYE4NT.js.map → hancom-BCYRSFDF.js.map} +0 -0
  161. /package/dist/{hancom-TE4NLTFM.js.map → hancom-HLLJXF2H.js.map} +0 -0
  162. /package/dist/{image-ocr-TB5QRYYM.js.map → image-ocr-B5SIBPET.js.map} +0 -0
  163. /package/dist/{image-ocr-L256UYPI.js.map → image-ocr-QSSVO27L.js.map} +0 -0
  164. /package/dist/{memo-VDT6J2FA.js.map → memo-R5CO35OZ.js.map} +0 -0
  165. /package/dist/{model-bundle-THGO5EUW.js.map → model-bundle-KB7GFS7J.js.map} +0 -0
  166. /package/dist/{models-MKIZDK2U.js.map → models-A6PYBE2Q.js.map} +0 -0
  167. /package/dist/{parse-worker-v2-MGNDWJDE.js.map → parse-worker-v2-OSOABIQB.js.map} +0 -0
  168. /package/dist/{parser-C6EZWRQM.js.map → parser-E2ZCR6UV.js.map} +0 -0
  169. /package/dist/{parser-EULDI5W6.js.map → parser-F7Q2ENVO.js.map} +0 -0
  170. /package/dist/{pdf-ocr-4Y6VPEZC.js.map → pdf-ocr-B6QVPBMI.js.map} +0 -0
  171. /package/dist/{pdf-ocr-LQ5SYFCE.js.map → pdf-ocr-RY6UZ5PG.js.map} +0 -0
  172. /package/dist/{profile-io-SDJTSIFY.js.map → profile-io-FX2SDCMR.js.map} +0 -0
  173. /package/dist/{rasterize-TGFUBV6B.js.map → rasterize-ZJAMZCQM.js.map} +0 -0
  174. /package/dist/{redact-doc-X5WKER3O.js.map → redact-doc-DNXUF4WL.js.map} +0 -0
  175. /package/dist/{render-6KIT7GYL.js.map → render-FQ2LMZIL.js.map} +0 -0
  176. /package/dist/{rewrite-fallback-ARYCZKU6.js.map → rewrite-fallback-QNLQXJRS.js.map} +0 -0
  177. /package/dist/{seal-4IPGOMFX.js.map → seal-6LBVNZYX.js.map} +0 -0
  178. /package/dist/{setup-ZEMI2HI4.js.map → setup-2VMN6LBY.js.map} +0 -0
  179. /package/dist/{to-hwpx-QRVTR6VA.js.map → to-hwpx-DS6DH5WH.js.map} +0 -0
  180. /package/dist/{to-hwpx-XCS6LSWE.js.map → to-hwpx-H7B6CEN5.js.map} +0 -0
  181. /package/dist/{visual-4D32BQGS.js.map → visual-3H3HGNOW.js.map} +0 -0
  182. /package/dist/{watch-LFL26YPL.js.map → watch-53NVSD5Z.js.map} +0 -0
package/README.md CHANGED
@@ -119,7 +119,7 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
119
119
  | HWPX | 2,424문서 · 10,342표 | 표 구조 일치 **10,342/10,342 · 100%** |
120
120
  | HWP 5.x ↔ HWPX | 1,130쌍 · 4,315표 | 짝 문서의 표 구조 일치 **100%** |
121
121
  | HWP 5.x → HWPX 변환 | 한글 저장 짝 264쌍 (속성 대조 232쌍) | 속성 일치 **99.21%** · 완전 일치 **69/232** · 글 **264/264** · 한글 화면 대조 80문서 |
122
- | PDF 글 | 744쌍 | 글자 재현율 **99.886%** · 정확도 **99.683%** · 읽기 순서 **99.366%** · 어절 F1 **99.114%** |
122
+ | PDF 글 | 744쌍 | 글자 재현율 **99.887%** · 정확도 **99.685%** · 읽기 순서 **99.398%** · 어절 F1 **99.125%** |
123
123
  | PDF 표 | 708쌍 · 2,331표 | 표 탐지 **99.83%** · 구조 일치 **98.24%** · 칸 F1 **0.9919** |
124
124
  | HWPX 재조판 | 다중줄 25,187문단 (12개 폴더) | 모든 줄 시작 일치 **24,941/25,187 · 99.02%** |
125
125
  | PDF 중첩표 (텍스트층) | 29문서 · 101표 | 구조·칸 내용 **101/101 · 100%** |
@@ -134,15 +134,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
134
134
 
135
135
  ## 최근 업데이트
136
136
 
137
- 최신 배포: **[4.24.70](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.70)** · 2026-11-13
137
+ 최신 배포: **[4.24.72](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.72)** · 2026-11-13
138
138
 
139
139
  | 버전 | 주요 변경 | 수치 변화 |
140
140
  | --- | --- | --- |
141
+ | 4.24.72 | PDF 한글 뒤 괄호 꺾임(문서 표기 습관) · HWP3 그림 번호 · 수식 후처리(노름 막대·기울인 대문자 그리스·본문 명령) | PDF 글 어절 F1 99.117% → **99.125%** · 수식 정확 일치 0.617 → **0.627** · 자체 벤치 문서별 하락 0 |
142
+ | 4.24.71 | PDF 테두리 없는 이름표·값 2열 표(조각난 줄·꺾인 값 줄) · 중·일문 기입란 빈칸 꼬리·넓은 줄 간격 첫 줄 · 따로 선 괄호 자동 간격 · "# " 글머리 | PDF 글 읽기 순서 99.366% → **99.398%** · 어절 F1 99.114% → **99.117%** (일문 계약서 0.975 → **0.987**) · 자체 벤치 문서별 하락 0 |
141
143
  | 4.24.70 | PDF 중·일문 쪽 넘김 문단 사이 각주 · 중·일문 자동 간격(괄호·전각 부호) · 쪽 끝 빈칸 틈 세로 자르기 · HWP 5.x 그림·표 자동 번호 | PDF 글 어절 F1 99.113% → **99.114%** (중문 계약서 0.961 → **0.982**) · KoOCR-Bench 0.90633 → **0.90643** · 자체 벤치 문서별 하락 0 |
142
144
  | 4.24.69 | PDF 중·일문 본문이 기입 빈칸 때문에 표가 되던 것 · 중·일문 쪽 넘김 문단 · 번호 목록 하위 항목 번호 두 번 · OCR 2단·분수 판정 안정화(#209) | PDF 글 어절 F1 99.111% → **99.113%** (중문 계약서 0.940 → **0.961**) · 자체 벤치 문서별 하락 0(벤치 착시 1 — CHANGELOG) |
143
145
  | 4.24.68 | OCR 표 칸 짧은 두 줄 머리("연금 / 수급자")를 버리던 것 · 중·일문 기입란 표가 위 본문 줄을 삼키던 것 · 흰 문단 배경 격자가 표가 되던 것 | KoOCR-Bench 0.90623 → **0.90633** · PDF 글 일문 계약서 어절 F1 0.944 → **0.956** · 하락: KoOCR 2쪽(그림 속 이름표 — 정답 한계) |
144
- | 4.24.67 | 떨어진 닫힌 상자 표 둘이 한 표로 묶이던 것 · 중·일문 본문이 표가 되던 것 · 중·일문 자동 간격 | KoOCR-Bench 0.90590 → **0.90623** (표 0.915 → **0.916**) · PDF 글 어절 F1 99.108% → **99.111%** · 자체 벤치 문서별 하락 0 |
145
- | 4.24.66 | OCR 칠한 열에 붙은 행 괘선·옅은 열 괘선 · PDF 띄어쓰기(반올림 좌표 공백, "영 및 이", 조문 인용 꺾임 "제42조⏎제1항") | KoOCR-Bench 0.90568 → **0.90590** · PDF 글 어절 F1 99.103% → **99.108%** · 자체 벤치 문서별 하락 0 |
146
146
 
147
147
  이전 버전과 상세 내용은 [변경 이력](CHANGELOG.md)에 있습니다.
148
148
 
@@ -53,7 +53,7 @@ import {
53
53
  usesGaejosikMunche,
54
54
  usesLogicStructure,
55
55
  validateHwpx
56
- } from "./chunk-YG42FESS.js";
56
+ } from "./chunk-O4MTW4JH.js";
57
57
  import {
58
58
  blocksToPdf,
59
59
  extractRenderedRegions,
@@ -64,16 +64,16 @@ import {
64
64
  renderHwp5Pages,
65
65
  renderHwpxToSvg,
66
66
  renderSceneToHtml
67
- } from "./chunk-TAATW772.js";
67
+ } from "./chunk-2SUWIRWH.js";
68
68
  import {
69
69
  blocksToPages
70
- } from "./chunk-OHSTI6C3.js";
70
+ } from "./chunk-4Q7L4IDD.js";
71
71
  import {
72
72
  extractClickHereFields,
73
73
  patchHwp,
74
74
  patchHwpx
75
- } from "./chunk-WVQDRZF5.js";
76
- import "./chunk-KET32GPP.js";
75
+ } from "./chunk-GAZDWFRT.js";
76
+ import "./chunk-FTPYYLCR.js";
77
77
  import {
78
78
  AGENCY_COMMON_NAME,
79
79
  PRESET_ALIAS,
@@ -83,7 +83,7 @@ import {
83
83
  markdownToHwpx,
84
84
  normalizeGongmunPreset,
85
85
  placeTotalRow
86
- } from "./chunk-6T6VP4AQ.js";
86
+ } from "./chunk-4QOTRR5Z.js";
87
87
  import {
88
88
  SPACE_EM_FIXED,
89
89
  SPACE_EM_FONT,
@@ -92,15 +92,15 @@ import {
92
92
  measureTextWidth,
93
93
  simulateWrap,
94
94
  simulateWrapKeepWord
95
- } from "./chunk-UD7DB4U3.js";
95
+ } from "./chunk-SNNM4GFE.js";
96
96
  import {
97
97
  addMemoHwpx
98
- } from "./chunk-RTQ2N6DG.js";
98
+ } from "./chunk-IPYSZ2WD.js";
99
99
  import {
100
100
  placeSealHwpx
101
- } from "./chunk-VZ2J3654.js";
102
- import "./chunk-ICK4R4HF.js";
103
- import "./chunk-7CLI2Y6A.js";
101
+ } from "./chunk-FKCSNCWC.js";
102
+ import "./chunk-UOML7PVK.js";
103
+ import "./chunk-CQUOEZBJ.js";
104
104
  import {
105
105
  ValueCursor,
106
106
  applySplices,
@@ -114,15 +114,15 @@ import {
114
114
  isLabelCell,
115
115
  scanSectionXml
116
116
  } from "./chunk-3AHL6YEA.js";
117
- import "./chunk-MU7YOHDK.js";
117
+ import "./chunk-U6CZ5IGF.js";
118
118
  import {
119
119
  convertToHwpx,
120
120
  hwpToHwpx
121
- } from "./chunk-ZMPNA2W7.js";
122
- import "./chunk-O2RV2FMS.js";
121
+ } from "./chunk-GOQWCHX5.js";
122
+ import "./chunk-7N2L6FBB.js";
123
123
  import "./chunk-FU6ZDWCI.js";
124
124
  import "./chunk-OFVHQ2TZ.js";
125
- import "./chunk-HUKGGV5M.js";
125
+ import "./chunk-JEPTA64I.js";
126
126
  import "./chunk-WFKFG2RT.js";
127
127
  import {
128
128
  DEFAULT_REDACT_RULES,
@@ -131,8 +131,8 @@ import {
131
131
  } from "./chunk-3WSNLH4B.js";
132
132
  import {
133
133
  blocksToChunks
134
- } from "./chunk-FPGY6TH2.js";
135
- import "./chunk-QTRQ4KM3.js";
134
+ } from "./chunk-BD75GPTM.js";
135
+ import "./chunk-GK4OHUV5.js";
136
136
  import "./chunk-VQFA55IC.js";
137
137
  import {
138
138
  detectFormat,
@@ -146,16 +146,16 @@ import {
146
146
  import "./chunk-H7K5YHWQ.js";
147
147
  import "./chunk-IIOBUTXH.js";
148
148
  import "./chunk-QLZHIJWJ.js";
149
- import "./chunk-G3UCY3T7.js";
149
+ import "./chunk-C4K2XCGX.js";
150
150
  import {
151
151
  blocksToMarkdown,
152
152
  flattenLayoutTables,
153
153
  hasStructuredCellContent
154
- } from "./chunk-R6J7X4ND.js";
154
+ } from "./chunk-BJCTFKEU.js";
155
155
  import "./chunk-KFF47XZ7.js";
156
156
  import {
157
157
  VERSION
158
- } from "./chunk-CVH5PB65.js";
158
+ } from "./chunk-VRJ3CABR.js";
159
159
  export {
160
160
  AGENCY_COMMON_NAME,
161
161
  BUILTIN_TEMPLATES,
@@ -269,4 +269,4 @@ export {
269
269
  usesLogicStructure,
270
270
  validateHwpx
271
271
  };
272
- //# sourceMappingURL=-JPBHAOIR.js.map
272
+ //# sourceMappingURL=-S32WDXC4.js.map
@@ -3,7 +3,7 @@ import {
3
3
  decryptHwpxInPlace,
4
4
  isEncryptedManifest,
5
5
  lockedHwpxError
6
- } from "./chunk-KET32GPP.js";
6
+ } from "./chunk-FTPYYLCR.js";
7
7
  import {
8
8
  BEFORE_2024_WIDTH,
9
9
  faceClassForReflow,
@@ -20,7 +20,7 @@ import {
20
20
  readSectionNoteFormats,
21
21
  simulateWrap,
22
22
  syntheticBoldEm
23
- } from "./chunk-UD7DB4U3.js";
23
+ } from "./chunk-SNNM4GFE.js";
24
24
  import {
25
25
  DEFAULT_CHAR,
26
26
  DEFAULT_PARA_GEOM,
@@ -29,14 +29,14 @@ import {
29
29
  hwpxAppBuild,
30
30
  hwpxAppMajor,
31
31
  parseRenderStyles
32
- } from "./chunk-ICK4R4HF.js";
32
+ } from "./chunk-UOML7PVK.js";
33
33
  import {
34
34
  MAX_DECOMPRESS_SIZE,
35
35
  MAX_ZIP_ENTRIES,
36
36
  createXmlParser,
37
37
  findChildByLocalName,
38
38
  readZipEntry
39
- } from "./chunk-MU7YOHDK.js";
39
+ } from "./chunk-U6CZ5IGF.js";
40
40
  import {
41
41
  detectImageMime,
42
42
  hwpEquationToLatex,
@@ -46,7 +46,7 @@ import {
46
46
  readHwp5DocInfoRecords,
47
47
  readHwp5SectionRecords,
48
48
  readHwp5SectionStreams
49
- } from "./chunk-O2RV2FMS.js";
49
+ } from "./chunk-7N2L6FBB.js";
50
50
  import {
51
51
  TAG_CHAR_SHAPE,
52
52
  TAG_CTRL_HEADER,
@@ -63,11 +63,11 @@ import {
63
63
  TAG_TABLE,
64
64
  isExtendedOnlyCtrlChar,
65
65
  parseDocInfo
66
- } from "./chunk-HUKGGV5M.js";
66
+ } from "./chunk-JEPTA64I.js";
67
67
  import {
68
68
  loadSharp,
69
69
  rasterizePageSvg
70
- } from "./chunk-QTRQ4KM3.js";
70
+ } from "./chunk-GK4OHUV5.js";
71
71
  import {
72
72
  parsePageRange
73
73
  } from "./chunk-VQFA55IC.js";
@@ -77,7 +77,7 @@ import {
77
77
  } from "./chunk-GHHVT4Q5.js";
78
78
  import {
79
79
  blocksToMarkdown
80
- } from "./chunk-R6J7X4ND.js";
80
+ } from "./chunk-BJCTFKEU.js";
81
81
  import {
82
82
  mapPuaText
83
83
  } from "./chunk-KFF47XZ7.js";
@@ -88,7 +88,7 @@ import {
88
88
  precheckZipSize,
89
89
  stripDtd,
90
90
  toArrayBuffer
91
- } from "./chunk-CVH5PB65.js";
91
+ } from "./chunk-VRJ3CABR.js";
92
92
 
93
93
  // src/render/svg-render.ts
94
94
  import JSZip from "jszip";
@@ -5732,4 +5732,4 @@ export {
5732
5732
  cropRect,
5733
5733
  extractRenderedRegions
5734
5734
  };
5735
- //# sourceMappingURL=chunk-TAATW772.js.map
5735
+ //# sourceMappingURL=chunk-2SUWIRWH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ensureModelsIn,
3
3
  getModelsDir
4
- } from "./chunk-Q4DDUA7U.js";
4
+ } from "./chunk-MHYFBIS5.js";
5
5
  import {
6
6
  CELL_EDGES,
7
7
  HEADING_RATIO_H1,
@@ -9,11 +9,11 @@ import {
9
9
  HEADING_RATIO_H3,
10
10
  tidyScriptTags,
11
11
  toTex
12
- } from "./chunk-6SQF5PAM.js";
12
+ } from "./chunk-C3USRXCH.js";
13
13
  import {
14
14
  safeMax,
15
15
  safeMin
16
- } from "./chunk-YY54476T.js";
16
+ } from "./chunk-DIHV6CDK.js";
17
17
 
18
18
  // src/ocr/models.ts
19
19
  import { join } from "path";
@@ -3642,6 +3642,8 @@ var WrapLexicon = class {
3642
3642
  cites = /* @__PURE__ */ new Map();
3643
3643
  /** 쪽 줄 흐름에서 넓은 줄 사이 기준선 간격(글자 크기별) — 줄 둘뿐인 묶음은 묶음 안에 견줄 간격이 없어 넓은 줄 간격 본문을 문단 경계로 봤다 */
3644
3644
  pitches = [];
3645
+ /** 줄 안 한글 바로 뒤 여는 괄호 — 붙여 쓴 "주택(아파트)" 수와 띄운 "주택 (아파트)" 수 */
3646
+ parens = { joined: 0, spaced: 0 };
3645
3647
  /** 줄 흐름의 이웃한 넓은 두 줄(같은 글자 크기) 사이 간격 하나를 더한다 */
3646
3648
  addPitch(fontSize, pitch) {
3647
3649
  if (fontSize > 0 && pitch > 0 && pitch < 4 * fontSize) this.pitches.push({ fs: fontSize, pitch });
@@ -3654,6 +3656,8 @@ var WrapLexicon = class {
3654
3656
  /** 줄 글 한 줄을 증거로 더한다 — 탭(큰 갭)으로 나뉜 조각은 다른 칸·단이라 조각 사이는 어절 경계 증거로 쓰지 않는다 */
3655
3657
  addLine(text) {
3656
3658
  for (const seg of text.replace(MARKUP, "").split(" ")) {
3659
+ this.parens.joined += seg.match(/[가-힣]\(/g)?.length ?? 0;
3660
+ this.parens.spaced += seg.match(/[가-힣] \(/g)?.length ?? 0;
3657
3661
  for (const m of seg.matchAll(CITE_LINK)) {
3658
3662
  const c = this.cites.get(m[1]) ?? { joined: 0, spaced: 0 };
3659
3663
  if (m[2]) c.spaced++;
@@ -3691,6 +3695,13 @@ var WrapLexicon = class {
3691
3695
  const c = this.cites.get(unit);
3692
3696
  return !c || c.joined === c.spaced ? null : c.joined > c.spaced;
3693
3697
  }
3698
+ /** 한글 뒤 여는 괄호로 꺾인 줄을 붙일까 — 문서 줄 안에서 붙여 쓴 쪽이 셋 넘고 띄운 쪽의 네 배 넘으면 true, 거꾸로면 false, 그 밖 null */
3699
+ parenJoins() {
3700
+ const { joined, spaced } = this.parens;
3701
+ if (joined >= 3 && joined >= 4 * spaced) return true;
3702
+ if (spaced >= 3 && spaced >= 4 * joined) return false;
3703
+ return null;
3704
+ }
3694
3705
  /** 문서 줄 안에서 홀로 선 어절로 나온 적 있나 */
3695
3706
  isWord(word) {
3696
3707
  return (this.words.get(word) ?? 0) > 0;
@@ -3699,6 +3710,10 @@ var WrapLexicon = class {
3699
3710
  joinedWord(left, right) {
3700
3711
  return this.isWord(left + right) && !this.pairs.has(left + " " + right);
3701
3712
  }
3713
+ /** 두 어절을 줄 안에서 띄어 쓴 이웃으로 쓴 적 있나 */
3714
+ spacedPair(left, right) {
3715
+ return this.pairs.has(left + " " + right);
3716
+ }
3702
3717
  /** 줄 안 어절이 이 한글로 시작한 적 있나 */
3703
3718
  startsWord(head) {
3704
3719
  return this.heads.has(head);
@@ -3778,7 +3793,7 @@ function particleContinues(left, rightWord) {
3778
3793
  if (ADNOMINAL_HAN.test(right)) return h.length >= 2 && !auxBefore(h) && !/(?:는|은|한|다|어|년)$/.test(h);
3779
3794
  return VERB_FORM.test(right) && !auxBefore(h) && !((last === "\uC774" || last === "\uAC00" && h.length >= 3) && BECOME.test(right));
3780
3795
  }
3781
- var ITEM_HEAD = /^(?:[□■◆◇○●◎◦▪▫•※▶▷►❍❏❑✓✔➢➤☞]|[①-⑳]|[-–·∙ㆍ*](?=\s)|\(?\d{1,2}[.)](?!\d)|\(?[가-하][.)]|\([가-하\d]{1,2}\)|[ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ]|제\d+[조항호장절])/;
3796
+ var ITEM_HEAD = /^(?:[□■◆◇○●◎◦▪▫•※▶▷►❍❏❑✓✔➢➤☞]|[①-⑳]|[-–·∙ㆍ*#](?=\s)|\(?\d{1,2}[.)](?!\d)|\(?[가-하][.)]|\([가-하\d]{1,2}\)|[ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ]|제\d+[조항호장절])/;
3782
3797
  function startsNewItem(prevText, nextText) {
3783
3798
  const t = nextText.replace(MARKUP, "").trimStart();
3784
3799
  const prev = prevText.replace(MARKUP, "").trimEnd();
@@ -3810,6 +3825,10 @@ function wrapJoiner(prevText, nextText, lex, heads = true) {
3810
3825
  const joins = lex?.citationJoins(cite[1]);
3811
3826
  if (joins != null) return joins ? "" : " ";
3812
3827
  }
3828
+ if (heads && b === "(" && /[가-힣]$/.test(left) && !endsAsWord(left) && !/(?:함|음|됨|임|다)$/.test(left) && !/^\([^()]*\)\s*$/.test(next) && !/^\([^()]*\s[^()]*\)\s/.test(next) && !lex?.spacedPair(left, right)) {
3829
+ const joins = lex?.parenJoins();
3830
+ if (joins != null) return joins ? "" : " ";
3831
+ }
3813
3832
  const ev = lex?.evidence(left, right);
3814
3833
  if (ev != null) return ev;
3815
3834
  if (lex && /[가-힣A-Za-z0-9]$/.test(left) && /^[가-힣A-Za-z0-9]/.test(right) && lex.joinedWord(left, right.replace(/[.,)」』’”;:]+$/, ""))) return "";
@@ -3949,11 +3968,15 @@ function bodyLineJoins(lines, lex) {
3949
3968
  const others = Number.isFinite(own) ? own : lex?.bodyPitch(fs) ?? Infinity;
3950
3969
  const maxPitch = Number.isFinite(others) ? Math.min(BODY_MAX_PITCH_ABS_EM * fs, Math.max(BODY_MAX_PITCH_EM * fs, others * BODY_PITCH_REL)) : BODY_MAX_PITCH_EM * fs;
3951
3970
  const wordWrap = ragged && !full(a) && nextWordNoRoom(a, b) && !MULTI_LEVEL_NUMBER.test(b.text.trimStart());
3952
- const wraps = fs > 0 && (full(a) || wordWrap) && a.right - a.left >= BODY_MIN_WIDTH_EM * fs && a.y - b.y > 0 && a.y - b.y < maxPitch && Math.abs(b.fontSize - fs) <= 0.15 * fs && !startsNewItem(a.text, b.text) && !(SENTENCE_END.test(a.text.trimEnd()) && MULTI_LEVEL_NUMBER.test(b.text.trimStart()));
3971
+ const wraps = fs > 0 && (full(a) || wordWrap) && a.right - a.left >= BODY_MIN_WIDTH_EM * fs && a.y - b.y > 0 && (a.y - b.y < maxPitch || indentedCjkFirstLine(a, b, fs)) && Math.abs(b.fontSize - fs) <= 0.15 * fs && !startsNewItem(a.text, b.text) && !(SENTENCE_END.test(a.text.trimEnd()) && MULTI_LEVEL_NUMBER.test(b.text.trimStart()));
3953
3972
  out.push(!wraps ? "\n" : wordWrap ? unspacedCjkBoundary(a.text, b.text) ? "" : " " : wrapJoiner(a.text, b.text, lex));
3954
3973
  }
3955
3974
  return out;
3956
3975
  }
3976
+ function indentedCjkFirstLine(a, b, fs) {
3977
+ const cjk = (t) => !/[가-힣]/.test(t) && /[\u3040-\u30ff\u3400-\u9fff]/.test(t);
3978
+ return cjk(a.text) && cjk(b.text) && b.left < a.left - fs && a.y - b.y < BODY_MAX_PITCH_ABS_EM * fs && b.fontSize >= 0.95 * a.fontSize && !/^(?:\d{1,2}\)?\s|[*※])/.test(b.text.trimStart());
3979
+ }
3957
3980
  var CELL_PAD_MAX = 6;
3958
3981
  function cellLineWraps(box, contentLeft, prevRight, fontSize, nextFirstCharW) {
3959
3982
  const pad = Math.min(CELL_PAD_MAX, Math.max(0, contentLeft - box.x1));
@@ -4533,6 +4556,8 @@ function isCjkLatinAutospace(prevText, nextText, gap, fontSize, hangulLine = fal
4533
4556
  const a = prevText.replace(/(?:<\/?u>|~~)+$/, "").slice(-1), b = nextText.replace(/^(?:<\/?u>|~~)+/, "").replace(/^\(/, "")[0] ?? "";
4534
4557
  const cjk = /[\u3000-\u303f\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\uff00-\uffef]/, latin = /[A-Za-z0-9]/;
4535
4558
  const cjkOrQuote = /[\u3000-\u303f\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\uff00-\uffef\u2018-\u201f]/;
4559
+ const bare = nextText.replace(/^(?:<\/?u>|~~)+/, "")[0] ?? "";
4560
+ if (bare === "(" && cjk.test(a) || a === ")" && cjk.test(b)) return true;
4536
4561
  return cjk.test(a) && latin.test(b) || latin.test(a) && cjk.test(b) || cjkOrQuote.test(a) && cjkOrQuote.test(b) && (cjk.test(a) || cjk.test(b));
4537
4562
  }
4538
4563
  function filterHiddenText(items, pageWidth, pageHeight, originX = 0, originY = 0) {
@@ -5435,11 +5460,25 @@ function detectCompactStatisticalTables(rows, pageNum) {
5435
5460
  }
5436
5461
  return found;
5437
5462
  }
5463
+ function twoColumnCells(row) {
5464
+ const items = [...row.items].sort((a, b) => a.x - b.x);
5465
+ if (items.length <= 2) return items.map((c) => ({ x: c.x, y: c.y, fontSize: c.fontSize, text: c.text }));
5466
+ const out = [];
5467
+ for (const c of items) {
5468
+ const last = out.at(-1), gap = last ? c.x - last.end : Infinity;
5469
+ if (last && gap <= c.fontSize * 1.2) {
5470
+ last.text += (gap > c.fontSize * 0.2 || c.hasSpaceBefore ? " " : "") + c.text;
5471
+ last.end = Math.max(last.end, c.x + c.w);
5472
+ } else out.push({ x: c.x, y: c.y, fontSize: c.fontSize, text: c.text, end: c.x + c.w });
5473
+ }
5474
+ if (out.length === 2 && (out[0].text.length > 20 || out.some((c) => /^\s*[::]|[::]\s*$|\s[::]\s/.test(c.text)))) return [];
5475
+ return out.map(({ end: _end, ...cell }) => cell);
5476
+ }
5438
5477
  function detectAlignedTwoColumnTables(rows, pageNum) {
5439
5478
  const found = [];
5440
5479
  let i = 0;
5441
5480
  while (i < rows.length - 2) {
5442
- const first = [...rows[i].items].sort((a, b) => a.x - b.x);
5481
+ const first = twoColumnCells(rows[i]);
5443
5482
  if (first.length !== 2 || first.some((c) => !c.text.trim() || c.text.length > 48) || first[1].x - first[0].x < 45 || first[1].x - first[0].x > 260 || /[.!?]$/.test(first[0].text)) {
5444
5483
  i++;
5445
5484
  continue;
@@ -5447,23 +5486,28 @@ function detectAlignedTwoColumnTables(rows, pageNum) {
5447
5486
  const body = [];
5448
5487
  let j = i;
5449
5488
  for (; j < rows.length; j++) {
5450
- const cells2 = [...rows[j].items].sort((a, b) => a.x - b.x);
5489
+ const cells2 = twoColumnCells(rows[j]);
5451
5490
  const previous = body.at(-1);
5452
- if (cells2.length !== 2 || cells2.some((c) => !c.text.trim() || c.text.length > 48) || Math.abs(cells2[0].x - first[0].x) > 5 || Math.abs(cells2[1].x - first[1].x) > 5 || previous && previous.y - rows[j].y > Math.max(24, first[0].fontSize * 2.8)) break;
5453
- body.push(rows[j]);
5491
+ if (previous && previous.rows.at(-1).y - rows[j].y > Math.max(24, first[0].fontSize * 2.8)) break;
5492
+ if (previous && cells2.length === 1 && Math.abs(cells2[0].x - first[1].x) <= 5 && cells2[0].text.trim()) {
5493
+ previous.rows.push(rows[j]);
5494
+ previous.right.push(cells2[0].text);
5495
+ continue;
5496
+ }
5497
+ if (cells2.length !== 2 || cells2.some((c) => !c.text.trim() || c.text.length > 48) || Math.abs(cells2[0].x - first[0].x) > 5 || Math.abs(cells2[1].x - first[1].x) > 5) break;
5498
+ body.push({ rows: [rows[j]], left: cells2[0].text, right: [cells2[1].text] });
5454
5499
  }
5455
- if (body.length < 3) {
5500
+ if (body.length < 3 || body.filter((b) => !/[\p{L}\p{N}]/u.test(b.right.join(""))).length * 2 >= body.length) {
5456
5501
  i++;
5457
5502
  continue;
5458
5503
  }
5459
5504
  const top = rows[i - 1];
5460
5505
  const title = top?.items.length === 1 && Math.abs(top.items[0].x - first[0].x) <= 5 && top.items[0].text.length <= 65 && top.y - first[0].y <= Math.max(24, first[0].fontSize * 2.8) ? top : void 0;
5461
- const tableRows = title ? [title, ...body] : body;
5462
- const cells = tableRows.map((row, idx) => {
5463
- if (title && idx === 0) return [{ text: row.items[0].text, colSpan: 2, rowSpan: 1 }, { text: "", colSpan: 1, rowSpan: 1 }];
5464
- const [left, right] = [...row.items].sort((a, b) => a.x - b.x);
5465
- return [{ text: left.text, colSpan: 1, rowSpan: 1 }, { text: right.text, colSpan: 1, rowSpan: 1 }];
5466
- });
5506
+ const tableRows = [...title ? [title] : [], ...body.flatMap((b) => b.rows)];
5507
+ const cells = [
5508
+ ...title ? [[{ text: title.items[0].text, colSpan: 2, rowSpan: 1 }, { text: "", colSpan: 1, rowSpan: 1 }]] : [],
5509
+ ...body.map((b) => [{ text: b.left, colSpan: 1, rowSpan: 1 }, { text: b.right.join(" "), colSpan: 1, rowSpan: 1 }])
5510
+ ];
5467
5511
  const usedItems = new Set(tableRows.flatMap((row) => row.items));
5468
5512
  const all = [...usedItems];
5469
5513
  const minX = Math.min(...all.map((c) => c.x)), minY = Math.min(...all.map((c) => c.y));
@@ -6688,7 +6732,7 @@ function chartBandGap(group, gap, charts) {
6688
6732
  const top = Math.max(...group.map((i) => i.y + i.fontSize)), em = Math.max(...group.map((i) => i.fontSize));
6689
6733
  return charts.some((c) => x1 >= c.x1 - 2 && x2 <= c.x2 + 2 && top <= c.y1 + 2 && c.y1 - top <= 2 * em) ? gap : 0;
6690
6734
  }
6691
- function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6735
+ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0, lex) {
6692
6736
  if (items.length === 0) return [];
6693
6737
  const newRegion = wrapped === void 0;
6694
6738
  wrapped ??= inheritedWrapBands(items);
@@ -6696,7 +6740,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6696
6740
  if (items.length === 2 && depth < MAX_XYCUT_DEPTH) {
6697
6741
  const sortedY2 = [...items].sort((a, b) => b.y - a.y);
6698
6742
  if (findHorizontalCut(sortedY2, wrapped).gap >= farGap) {
6699
- if (newRegion) wrapped = wrappedLineBands(items, wrapped);
6743
+ if (newRegion) wrapped = wrappedLineBands(items, wrapped, lex);
6700
6744
  const cut = findHorizontalCut(sortedY2, wrapped);
6701
6745
  if (cut.gap >= farGap) return [...leaf([sortedY2[0]], wrapped), ...leaf([sortedY2[1]], wrapped)];
6702
6746
  }
@@ -6707,7 +6751,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6707
6751
  if (cross.size > 0 && cross.size <= items.length * CROSS_MAX_MASK_RATIO) {
6708
6752
  const rest = items.filter((i) => !cross.has(i));
6709
6753
  if (rest.length > 0) {
6710
- const groups = xyCutOrder(rest, gapThreshold, 1, void 0, columnGap);
6754
+ const groups = xyCutOrder(rest, gapThreshold, 1, void 0, columnGap, lex);
6711
6755
  return mergeCrossLayoutGroups(groups, [...cross]);
6712
6756
  }
6713
6757
  }
@@ -6716,7 +6760,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6716
6760
  const sortedY = [...items].sort((a, b) => b.y - a.y);
6717
6761
  let hCut = findHorizontalCut(sortedY, wrapped);
6718
6762
  if (newRegion && hCut.gap >= minGap) {
6719
- wrapped = wrappedLineBands(items, wrapped);
6763
+ wrapped = wrappedLineBands(items, wrapped, lex);
6720
6764
  hCut = findHorizontalCut(sortedY, wrapped);
6721
6765
  }
6722
6766
  const vMinGap = Math.max(minGap, columnGap);
@@ -6727,18 +6771,18 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0) {
6727
6771
  if (hValid && vValid) useHorizontal = (vCut.gap <= hCut.gap * 1.5 || staggeredSides(items, vCut.position)) && !gapInsideLongerColumn(items, hCut.position, hCut.gap, vCut.position);
6728
6772
  else if (hValid) useHorizontal = true;
6729
6773
  else if (vValid) useHorizontal = false;
6730
- else return splitEdgeSpannedColumns(items, gapThreshold, depth) ?? leaf(items, wrapped);
6774
+ else return splitEdgeSpannedColumns(items, gapThreshold, depth, lex) ?? leaf(items, wrapped);
6731
6775
  if (useHorizontal) {
6732
6776
  const upper = items.filter((i) => i.y > hCut.position);
6733
6777
  const lower = items.filter((i) => i.y <= hCut.position);
6734
6778
  if (upper.length > 0 && lower.length > 0 && upper.length < items.length) {
6735
- return [...xyCutOrder(upper, gapThreshold, depth + 1, wrapped, columnGap), ...xyCutOrder(lower, gapThreshold, depth + 1, wrapped, columnGap)];
6779
+ return [...xyCutOrder(upper, gapThreshold, depth + 1, wrapped, columnGap, lex), ...xyCutOrder(lower, gapThreshold, depth + 1, wrapped, columnGap, lex)];
6736
6780
  }
6737
6781
  } else {
6738
6782
  const left = items.filter((i) => i.x + i.w / 2 < vCut.position);
6739
6783
  const right = items.filter((i) => i.x + i.w / 2 >= vCut.position);
6740
6784
  if (left.length > 0 && right.length > 0 && left.length < items.length) {
6741
- return [...xyCutOrder(left, gapThreshold, depth + 1, void 0, columnGap), ...xyCutOrder(right, gapThreshold, depth + 1, void 0, columnGap)];
6785
+ return [...xyCutOrder(left, gapThreshold, depth + 1, void 0, columnGap, lex), ...xyCutOrder(right, gapThreshold, depth + 1, void 0, columnGap, lex)];
6742
6786
  }
6743
6787
  }
6744
6788
  return leaf(items, wrapped);
@@ -6884,9 +6928,12 @@ function splitsLoneRowTail(items, x) {
6884
6928
  const head = left.find((r) => Math.abs(r[0].y - tail[0].y) <= 2);
6885
6929
  if (!head) return false;
6886
6930
  const headBox = computeBBox(head, 0), fs = dominantStyle(tail)?.fontSize ?? 10;
6887
- return tailBox.x - (headBox.x + headBox.width) <= fs * 3 && tailBox.x + tailBox.width >= box.x + box.width - fs && headBox.width >= box.width / 2;
6931
+ const gap = tailBox.x - (headBox.x + headBox.width), fills = tailBox.x + tailBox.width >= box.x + box.width - fs;
6932
+ if (gap <= fs * 3 && fills && headBox.width >= box.width / 2) return true;
6933
+ const text = [...head, ...tail].map((i) => i.text).join("");
6934
+ return !/[가-힣]/.test(text) && /[\u3040-\u30ff\u3400-\u9fff]/.test(text) && gap <= fs * 4 && fills && headBox.x <= box.x + fs;
6888
6935
  }
6889
- function wrappedLineBands(items, inherited) {
6936
+ function wrappedLineBands(items, inherited, lex) {
6890
6937
  const rows = groupByY(items);
6891
6938
  const records = tocRecordBoundaries(rows);
6892
6939
  const lines = rows.map((row) => {
@@ -6900,7 +6947,7 @@ function wrappedLineBands(items, inherited) {
6900
6947
  sources: row.map((item) => ({ item, state: { ...item } }))
6901
6948
  };
6902
6949
  });
6903
- const joins = bodyLineJoins(lines);
6950
+ const joins = bodyLineJoins(lines, lex);
6904
6951
  const fresh = lines.slice(0, -1).flatMap((line, i) => joins[i] === "\n" || records.has(i) || line.text.trim() === lines[i + 1].text.trim() ? [] : [{ top: line.y, bottom: lines[i + 1].y, sources: [...line.sources, ...lines[i + 1].sources] }]);
6905
6952
  const freshKeys = new Set(fresh.map((b) => `${b.top}:${b.bottom}`));
6906
6953
  return [...inherited.filter((b) => !freshKeys.has(`${b.top}:${b.bottom}`)), ...fresh].sort((a, b) => b.top - a.top);
@@ -6994,7 +7041,7 @@ function isProseGutter(items, x) {
6994
7041
  const [l0, l1] = span2(left), [r0, r1] = span2(right);
6995
7042
  return Math.min(l1, r1) - Math.max(l0, r0) >= Math.min(l1 - l0, r1 - r0) * 0.5;
6996
7043
  }
6997
- function splitEdgeSpannedColumns(items, gapThreshold, depth) {
7044
+ function splitEdgeSpannedColumns(items, gapThreshold, depth, lex) {
6998
7045
  let minX = Infinity, maxX = -Infinity;
6999
7046
  for (const i of items) {
7000
7047
  minX = Math.min(minX, i.x);
@@ -7012,8 +7059,8 @@ function splitEdgeSpannedColumns(items, gapThreshold, depth) {
7012
7059
  const left = rest.filter((i) => i.x + i.w / 2 < cut.position), right = rest.filter((i) => i.x + i.w / 2 >= cut.position);
7013
7060
  return [
7014
7061
  ...above.length ? [above] : [],
7015
- ...xyCutOrder(left, gapThreshold, depth + 1),
7016
- ...xyCutOrder(right, gapThreshold, depth + 1),
7062
+ ...xyCutOrder(left, gapThreshold, depth + 1, void 0, 0, lex),
7063
+ ...xyCutOrder(right, gapThreshold, depth + 1, void 0, 0, lex),
7017
7064
  ...below.length ? [below] : []
7018
7065
  ];
7019
7066
  }
@@ -10844,7 +10891,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10844
10891
  const textBlocks = [];
10845
10892
  for (const side of sides) {
10846
10893
  if (side.length === 0) continue;
10847
- for (const group of xyCutOrder(side, gapThreshold)) {
10894
+ for (const group of xyCutOrder(side, gapThreshold, 0, void 0, 0, lex)) {
10848
10895
  if (group.length === 0) continue;
10849
10896
  const groupBlocks = extractPageBlocksFallback(group, pageNum, false, true, lex, [], chartBandGap(group, gapThreshold, charts));
10850
10897
  for (const b of groupBlocks) textBlocks.push(b);
@@ -10856,7 +10903,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10856
10903
  const allY = remaining.map((i) => i.y);
10857
10904
  const pageH = safeMax(allY) - safeMin(allY);
10858
10905
  const gapThreshold = Math.max(15, pageH * 0.03);
10859
- const groups = xyCutOrder(remaining, gapThreshold);
10906
+ const groups = xyCutOrder(remaining, gapThreshold, 0, void 0, 0, lex);
10860
10907
  const textBlocks = [];
10861
10908
  for (const group of groups) {
10862
10909
  if (group.length === 0) continue;
@@ -11218,7 +11265,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
11218
11265
  const allY = items.map((i) => i.y);
11219
11266
  const pageHeight = safeMax(allY) - safeMin(allY);
11220
11267
  const gapThreshold = Math.max(15, pageHeight * 0.03);
11221
- const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
11268
+ const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap, lex);
11222
11269
  for (const group of orderedGroups) {
11223
11270
  if (group.length === 0) continue;
11224
11271
  const yLines = mergeSuperscriptLines(groupByY(group));
@@ -11486,4 +11533,4 @@ export {
11486
11533
  UNRULED_REGION_TABLES,
11487
11534
  mergeOcrImageRegions
11488
11535
  };
11489
- //# sourceMappingURL=chunk-G5YCISXC.js.map
11536
+ //# sourceMappingURL=chunk-4ECEC6FD.js.map