kordoc 4.22.2 → 4.22.4

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 (128) hide show
  1. package/README.md +11 -6
  2. package/dist/{-C437ZARA.js → -HAK3YFWW.js} +11 -11
  3. package/dist/{chunk-UV2G6XFA.js → chunk-36DK6AOX.js} +2 -2
  4. package/dist/{chunk-CNMUT5YW.js → chunk-3TUJ34V7.js} +2 -2
  5. package/dist/{chunk-I4BS4BXE.cjs → chunk-4X7AR4EH.cjs} +34 -28
  6. package/dist/chunk-4X7AR4EH.cjs.map +1 -0
  7. package/dist/{chunk-4BJZGXNM.js → chunk-5ARHF54C.js} +2 -2
  8. package/dist/{chunk-56GBOIOE.js → chunk-A3SKXHAN.js} +2 -2
  9. package/dist/{chunk-GVBQVXXB.js → chunk-AYV5VRHL.js} +14 -4
  10. package/dist/chunk-AYV5VRHL.js.map +1 -0
  11. package/dist/{chunk-3LJ6QO53.js → chunk-C5J5LDWM.js} +14 -8
  12. package/dist/{chunk-3LJ6QO53.js.map → chunk-C5J5LDWM.js.map} +1 -1
  13. package/dist/{chunk-IRP6QS3K.js → chunk-CWBH66IQ.js} +3 -3
  14. package/dist/{chunk-YTEMFVZB.js → chunk-DEFT7Z3B.js} +2 -2
  15. package/dist/{chunk-L6N4OMKR.js → chunk-EVL6HZQL.js} +128 -70
  16. package/dist/chunk-EVL6HZQL.js.map +1 -0
  17. package/dist/{chunk-ZLFUZM7H.cjs → chunk-EYQLJ57Y.cjs} +3 -3
  18. package/dist/{chunk-ZLFUZM7H.cjs.map → chunk-EYQLJ57Y.cjs.map} +1 -1
  19. package/dist/{chunk-GFQIKYBV.js → chunk-F3AWNFMO.js} +3 -3
  20. package/dist/{chunk-S4KQUVBV.js → chunk-FAFSBCU2.js} +4 -4
  21. package/dist/{chunk-AXR7OKQY.js → chunk-G2325K2F.js} +2 -2
  22. package/dist/{chunk-FPUBEM3F.js → chunk-G4KNI7EO.js} +11 -11
  23. package/dist/{chunk-NGDMJICC.js → chunk-HN3QMHTT.js} +15 -9
  24. package/dist/{chunk-NGDMJICC.js.map → chunk-HN3QMHTT.js.map} +1 -1
  25. package/dist/{chunk-MED2MR6O.cjs → chunk-K2NWHLCD.cjs} +23 -13
  26. package/dist/chunk-K2NWHLCD.cjs.map +1 -0
  27. package/dist/{chunk-UMNKY2EZ.js → chunk-LVVSMYG4.js} +4 -4
  28. package/dist/{chunk-AUWO57ED.cjs → chunk-MJSHXESK.cjs} +2 -2
  29. package/dist/{chunk-AUWO57ED.cjs.map → chunk-MJSHXESK.cjs.map} +1 -1
  30. package/dist/{chunk-L6PFPBTK.js → chunk-MYTMZSQO.js} +2 -2
  31. package/dist/{chunk-DQXP3ELP.js → chunk-Q65HT2BL.js} +2 -2
  32. package/dist/{chunk-U3TZVR7A.js → chunk-Q6SVCBMK.js} +2 -2
  33. package/dist/{chunk-2X64TI7I.js → chunk-RPSILMQY.js} +2 -2
  34. package/dist/{chunk-ENV25MPM.cjs → chunk-S45M7IQH.cjs} +24 -24
  35. package/dist/{chunk-ENV25MPM.cjs.map → chunk-S45M7IQH.cjs.map} +1 -1
  36. package/dist/{chunk-4GCS7WJJ.js → chunk-SSL3TKJY.js} +2 -2
  37. package/dist/{chunk-QFJCEHY7.js → chunk-UJVVL6BI.js} +14 -4
  38. package/dist/chunk-UJVVL6BI.js.map +1 -0
  39. package/dist/{chunk-EKKZNKJD.cjs → chunk-VXQWAPC6.cjs} +3 -3
  40. package/dist/{chunk-EKKZNKJD.cjs.map → chunk-VXQWAPC6.cjs.map} +1 -1
  41. package/dist/{chunk-VUC4JJUM.js → chunk-WCTC3LSV.js} +2 -2
  42. package/dist/{chunk-YOFKJ7IM.js → chunk-WNW77CAY.js} +2 -2
  43. package/dist/chunks-3N7OFSA4.js +10 -0
  44. package/dist/cli.js +30 -30
  45. package/dist/{formula-3TVRNJ66.cjs → formula-JGFYGFYX.cjs} +9 -9
  46. package/dist/{formula-3TVRNJ66.cjs.map → formula-JGFYGFYX.cjs.map} +1 -1
  47. package/dist/{formula-HUENRCPJ.js → formula-KSTY73DQ.js} +3 -3
  48. package/dist/{formula-43QBPAL5.js → formula-PWAUR5PF.js} +4 -4
  49. package/dist/{image-ocr-BAHDLDV5.js → image-ocr-RASJHOAK.js} +6 -6
  50. package/dist/{image-ocr-HYAKWJGE.js → image-ocr-RPBPO3VT.js} +9 -9
  51. package/dist/{image-ocr-OC3TCXMV.cjs → image-ocr-UULNAC5Y.cjs} +17 -17
  52. package/dist/{image-ocr-OC3TCXMV.cjs.map → image-ocr-UULNAC5Y.cjs.map} +1 -1
  53. package/dist/index.cjs +536 -478
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.js +128 -70
  56. package/dist/index.js.map +1 -1
  57. package/dist/mcp.js +22 -22
  58. package/dist/{model-bundle-23WBSECG.js → model-bundle-ZPQ4IFT7.js} +5 -5
  59. package/dist/{models-NRZQY45P.js → models-YJQ5VHOR.js} +5 -5
  60. package/dist/{parse-worker-v2-DPNXGJ73.js → parse-worker-v2-7PNZYASF.js} +12 -12
  61. package/dist/{parser-XNOLC3MZ.js → parser-DR6ZHYEB.js} +121 -12
  62. package/dist/parser-DR6ZHYEB.js.map +1 -0
  63. package/dist/{parser-FNUQW2F3.js → parser-ER3VLB37.js} +124 -15
  64. package/dist/parser-ER3VLB37.js.map +1 -0
  65. package/dist/{parser-OKAQRZKM.cjs → parser-ZFXVZZKQ.cjs} +376 -267
  66. package/dist/parser-ZFXVZZKQ.cjs.map +1 -0
  67. package/dist/{pdf-ocr-FAGA3O6B.js → pdf-ocr-BYT7XVID.js} +6 -6
  68. package/dist/{pdf-ocr-N5LYC5LA.js → pdf-ocr-DRQN5BXA.js} +9 -9
  69. package/dist/pdf-ocr-QWTGWYQT.cjs +31 -0
  70. package/dist/{pdf-ocr-6UXBIQE6.cjs.map → pdf-ocr-QWTGWYQT.cjs.map} +1 -1
  71. package/dist/{profile-io-HC6FMYX4.js → profile-io-3QYTSPNH.js} +3 -3
  72. package/dist/{rasterize-QLTROEV2.js → rasterize-LPLWCBXV.js} +3 -3
  73. package/dist/{redact-doc-V4KMM2QV.js → redact-doc-HDA6ZG3N.js} +11 -11
  74. package/dist/{render-V4S3QLTR.js → render-MYZGD3SB.js} +7 -7
  75. package/dist/seal-XA5V6A6V.js +10 -0
  76. package/dist/{setup-HU7ZOQNM.js → setup-EF5TQVAI.js} +3 -3
  77. package/dist/visual-DB7NJOID.js +21 -0
  78. package/dist/{watch-NPIZ6DSJ.js → watch-PM5PRSFW.js} +12 -12
  79. package/package.json +1 -1
  80. package/dist/chunk-GVBQVXXB.js.map +0 -1
  81. package/dist/chunk-I4BS4BXE.cjs.map +0 -1
  82. package/dist/chunk-L6N4OMKR.js.map +0 -1
  83. package/dist/chunk-MED2MR6O.cjs.map +0 -1
  84. package/dist/chunk-QFJCEHY7.js.map +0 -1
  85. package/dist/chunks-MPOOHZVO.js +0 -10
  86. package/dist/parser-FNUQW2F3.js.map +0 -1
  87. package/dist/parser-OKAQRZKM.cjs.map +0 -1
  88. package/dist/parser-XNOLC3MZ.js.map +0 -1
  89. package/dist/pdf-ocr-6UXBIQE6.cjs +0 -31
  90. package/dist/seal-MQ5TB5YZ.js +0 -10
  91. package/dist/visual-RLIFC4XC.js +0 -21
  92. /package/dist/{-C437ZARA.js.map → -HAK3YFWW.js.map} +0 -0
  93. /package/dist/{chunk-UV2G6XFA.js.map → chunk-36DK6AOX.js.map} +0 -0
  94. /package/dist/{chunk-CNMUT5YW.js.map → chunk-3TUJ34V7.js.map} +0 -0
  95. /package/dist/{chunk-4BJZGXNM.js.map → chunk-5ARHF54C.js.map} +0 -0
  96. /package/dist/{chunk-56GBOIOE.js.map → chunk-A3SKXHAN.js.map} +0 -0
  97. /package/dist/{chunk-IRP6QS3K.js.map → chunk-CWBH66IQ.js.map} +0 -0
  98. /package/dist/{chunk-YTEMFVZB.js.map → chunk-DEFT7Z3B.js.map} +0 -0
  99. /package/dist/{chunk-GFQIKYBV.js.map → chunk-F3AWNFMO.js.map} +0 -0
  100. /package/dist/{chunk-S4KQUVBV.js.map → chunk-FAFSBCU2.js.map} +0 -0
  101. /package/dist/{chunk-AXR7OKQY.js.map → chunk-G2325K2F.js.map} +0 -0
  102. /package/dist/{chunk-FPUBEM3F.js.map → chunk-G4KNI7EO.js.map} +0 -0
  103. /package/dist/{chunk-UMNKY2EZ.js.map → chunk-LVVSMYG4.js.map} +0 -0
  104. /package/dist/{chunk-L6PFPBTK.js.map → chunk-MYTMZSQO.js.map} +0 -0
  105. /package/dist/{chunk-DQXP3ELP.js.map → chunk-Q65HT2BL.js.map} +0 -0
  106. /package/dist/{chunk-U3TZVR7A.js.map → chunk-Q6SVCBMK.js.map} +0 -0
  107. /package/dist/{chunk-2X64TI7I.js.map → chunk-RPSILMQY.js.map} +0 -0
  108. /package/dist/{chunk-4GCS7WJJ.js.map → chunk-SSL3TKJY.js.map} +0 -0
  109. /package/dist/{chunk-VUC4JJUM.js.map → chunk-WCTC3LSV.js.map} +0 -0
  110. /package/dist/{chunk-YOFKJ7IM.js.map → chunk-WNW77CAY.js.map} +0 -0
  111. /package/dist/{chunks-MPOOHZVO.js.map → chunks-3N7OFSA4.js.map} +0 -0
  112. /package/dist/{formula-HUENRCPJ.js.map → formula-KSTY73DQ.js.map} +0 -0
  113. /package/dist/{formula-43QBPAL5.js.map → formula-PWAUR5PF.js.map} +0 -0
  114. /package/dist/{image-ocr-BAHDLDV5.js.map → image-ocr-RASJHOAK.js.map} +0 -0
  115. /package/dist/{image-ocr-HYAKWJGE.js.map → image-ocr-RPBPO3VT.js.map} +0 -0
  116. /package/dist/{model-bundle-23WBSECG.js.map → model-bundle-ZPQ4IFT7.js.map} +0 -0
  117. /package/dist/{models-NRZQY45P.js.map → models-YJQ5VHOR.js.map} +0 -0
  118. /package/dist/{parse-worker-v2-DPNXGJ73.js.map → parse-worker-v2-7PNZYASF.js.map} +0 -0
  119. /package/dist/{pdf-ocr-FAGA3O6B.js.map → pdf-ocr-BYT7XVID.js.map} +0 -0
  120. /package/dist/{pdf-ocr-N5LYC5LA.js.map → pdf-ocr-DRQN5BXA.js.map} +0 -0
  121. /package/dist/{profile-io-HC6FMYX4.js.map → profile-io-3QYTSPNH.js.map} +0 -0
  122. /package/dist/{rasterize-QLTROEV2.js.map → rasterize-LPLWCBXV.js.map} +0 -0
  123. /package/dist/{redact-doc-V4KMM2QV.js.map → redact-doc-HDA6ZG3N.js.map} +0 -0
  124. /package/dist/{render-V4S3QLTR.js.map → render-MYZGD3SB.js.map} +0 -0
  125. /package/dist/{seal-MQ5TB5YZ.js.map → seal-XA5V6A6V.js.map} +0 -0
  126. /package/dist/{setup-HU7ZOQNM.js.map → setup-EF5TQVAI.js.map} +0 -0
  127. /package/dist/{visual-RLIFC4XC.js.map → visual-DB7NJOID.js.map} +0 -0
  128. /package/dist/{watch-NPIZ6DSJ.js.map → watch-PM5PRSFW.js.map} +0 -0
package/README.md CHANGED
@@ -100,14 +100,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
100
100
 
101
101
  ## 검증 결과
102
102
 
103
- **4.22.0 · 2026-10-16 배포 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
103
+ **4.22.4 · 2026-10-16 검증**. 고정 코퍼스와 참조 기준으로 측정한 결과입니다.
104
104
 
105
105
  | 대상 | 규모 | 결과 |
106
106
  | --- | --- | --- |
107
107
  | HWPX | 2,429문서 · 10,461표 | 표 구조 일치 **10,461/10,461 · 100%** |
108
108
  | HWP 5.x ↔ HWPX | 1,131쌍 · 4,317표 | 짝 문서의 표 구조 일치 **100%** |
109
- | PDF 글 | 744쌍 | 글자 재현율 **99.86%** · 정확도 **99.67%** · 읽기 순서 **99.23%** · 어절 F1 **99.02%** |
110
- | PDF 표 | 708쌍 · 2,331표 | 표 탐지 **99.83%** · 구조 일치 **98.03%** · 칸 F1 **0.991** |
109
+ | PDF 글 | 744쌍 | 글자 재현율 **99.865%** · 정확도 **99.670%** · 읽기 순서 **99.242%** · 어절 F1 **99.025%** |
110
+ | PDF 표 | 708쌍 · 2,331표 | 표 탐지 **99.87%** · 구조 일치 **98.16%** · 칸 F1 **0.9918** |
111
+ | HWPX 재조판 | 다중줄 25,581문단 | 모든 줄 시작 일치 **25,326/25,581 · 99.0032%** |
111
112
  | PDF 중첩표 (텍스트층) | 29문서 · 101표 | 구조·칸 내용 **101/101 · 100%** |
112
113
  | 법령 별표 | 272건 · 346표 | HWP **346/346**, PDF **342/346 · 98.84%** |
113
114
  | PDF 전체 | 2,070문서 중 1,888건 채점 | 글 커버리지 **99.80%** |
@@ -115,16 +116,20 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
115
116
 
116
117
  표 구조 점수와 셀 내용·화면 재현은 별도 지표입니다. 중첩표 100%는 위 101표에 한정하며 전체 PDF·조판의 완전 일치를 뜻하지 않습니다. 채점 범위·제외 기준·전 벤치 문서별 비교는 [벤치마크 상세](docs/benchmarks.md)에 있습니다.
117
118
 
118
- **4.22.2 개선 검증(2026-10-16)**: 조판과 PDF를 번갈아 5라운드 개선했습니다. 고정 모수에서 조판 줄 나눔 일치 **25,312→25,321/25,581문단**, PDF 표 구조 완전 일치 **2,285→2,287/2,331표**입니다. 부분 편집의 문단 위치, 그림 어울림, 고정폭 빈칸, PDF 제목 상자·번호 행 처리를 고쳤습니다. [라운드별 효과와 교차 비교](docs/quality-alternating-2026-10-16.md) · [앞선 PDF 셀 내용 개선](docs/quality-pdf-2026-10-16.md)
119
+ **4.22.4 개선 검증(2026-10-16)**: 두 묶음의 총 10라운드에서 조판 줄 나눔 일치 **25,323→25,326/25,581문단**, PDF 표 셀 내용 완전 일치 **0.989994→0.990311**, 글 재현율 **0.99858→0.99865**로 개선했습니다. 그림 원점·테두리·공백 글꼴·세로쓰기 기준선·신명조 따옴표 폭을 보정하고, PDF 글머리 칸·표 주석·양식 제목·계속표 행을 복원했습니다. 법령 PDF 별표의 셀 F1은 **0.99697→0.99739**이며 구조 완전 일치 **342/346**은 그대로입니다. [최종 5라운드와 남은 한계](docs/quality-alternating-4-2026-10-16.md) · [앞선 5라운드](docs/quality-alternating-3-2026-10-16.md)
119
120
 
120
- 외부 PDF 벤치 **opendataloader-bench 200문서**는 4.22.0 배포 후보의 동일 코퍼스 검증에서 기본값 종합 **0.963**, OCR 끔 **0.939**입니다. [옵션별 결과와 재현 방법](docs/benchmarks.md#pdf--markdown--opendataloader-bench)
121
+ 빈 행을 접을 때 기존 논리 격자 안의 병합 모서리 셀을 보존합니다. HTML 선 출력과 PDF 번호 기호 누락은 남은 과제로 [재현 문서](docs/parsing-loss-reproductions.md)에 기록했습니다.
122
+
123
+ 외부 PDF 벤치 **opendataloader-bench 200문서**는 4.22.4 배포 후보의 동일 코퍼스 재검증에서 기본값 종합 **0.963**, OCR 끔 **0.939**입니다. [옵션별 결과와 재현 방법](docs/benchmarks.md#pdf--markdown--opendataloader-bench)
121
124
 
122
125
  ## 최근 업데이트
123
126
 
124
- 최신 배포: **[4.22.2](https://github.com/chrisryugj/kordoc/releases/tag/v4.22.2)** · 2026-10-16
127
+ 최신 배포: **[4.22.4](https://github.com/chrisryugj/kordoc/releases/tag/v4.22.4)** · 2026-10-16
125
128
 
126
129
  | 버전 | 주요 변경 |
127
130
  | --- | --- |
131
+ | 4.22.4 | 그림·테두리·공백·세로쓰기 기준선·따옴표 조판 보정, PDF 글머리 칸·주석·양식 제목·쪽 경계 목록 행 복원 |
132
+ | 4.22.3 | 넘친 표 점유 높이·그림 옆 줄 조각·선택 하이픈 조판 개선, PDF 감싸개 안 표 이어짐과 반복 자료행 복원, 빈 행을 접을 때 병합 모서리 셀 보존 |
128
133
  | 4.22.2 | 부분 편집 문단 위치·그림 어울림·고정폭 빈칸 조판 개선, PDF 독립 제목·번호 행 보존 및 연락처·음영 행 내용 복원 |
129
134
  | 4.22.1 | 텍스트층 PDF의 그림 영역 OCR에서 회전 보정·고해상도 재인식 좌표 혼합 수정. 전체 스캔의 기울기 보정 유지 |
130
135
  | 4.22.0 | PDF 중첩표 94/101 → 101/101, 쪽 경계 셀·HWP 캡션·표 칸 안 각주 보존. OCR 줄 좌표·모델 선택 추가, 수식 OCR 설치 경량화 |
@@ -47,10 +47,10 @@ import {
47
47
  unknownFontWarnings,
48
48
  usesGaejosikMunche,
49
49
  validateHwpx
50
- } from "./chunk-FPUBEM3F.js";
50
+ } from "./chunk-G4KNI7EO.js";
51
51
  import {
52
52
  blocksToChunks
53
- } from "./chunk-56GBOIOE.js";
53
+ } from "./chunk-A3SKXHAN.js";
54
54
  import {
55
55
  SPACE_EM_FIXED,
56
56
  SPACE_EM_FONT,
@@ -75,20 +75,20 @@ import {
75
75
  renderSceneToHtml,
76
76
  simulateWrap,
77
77
  simulateWrapKeepWord
78
- } from "./chunk-L6N4OMKR.js";
79
- import "./chunk-2X64TI7I.js";
78
+ } from "./chunk-EVL6HZQL.js";
79
+ import "./chunk-RPSILMQY.js";
80
80
  import {
81
81
  blocksToPages
82
- } from "./chunk-AXR7OKQY.js";
82
+ } from "./chunk-G2325K2F.js";
83
83
  import "./chunk-VKVDMH7X.js";
84
84
  import "./chunk-VQFA55IC.js";
85
85
  import "./chunk-BHVOY6V4.js";
86
- import "./chunk-GVBQVXXB.js";
86
+ import "./chunk-AYV5VRHL.js";
87
87
  import {
88
88
  blocksToMarkdown,
89
89
  flattenLayoutTables,
90
90
  hasStructuredCellContent
91
- } from "./chunk-U3TZVR7A.js";
91
+ } from "./chunk-Q6SVCBMK.js";
92
92
  import {
93
93
  ValueCursor,
94
94
  applySplices,
@@ -102,11 +102,11 @@ import {
102
102
  isLabelCell,
103
103
  placeSealHwpx,
104
104
  scanSectionXml
105
- } from "./chunk-GFQIKYBV.js";
106
- import "./chunk-VUC4JJUM.js";
105
+ } from "./chunk-F3AWNFMO.js";
106
+ import "./chunk-WCTC3LSV.js";
107
107
  import {
108
108
  VERSION
109
- } from "./chunk-4BJZGXNM.js";
109
+ } from "./chunk-5ARHF54C.js";
110
110
  import {
111
111
  DEFAULT_REDACT_RULES,
112
112
  redactMarkdown,
@@ -205,4 +205,4 @@ export {
205
205
  usesGaejosikMunche,
206
206
  validateHwpx
207
207
  };
208
- //# sourceMappingURL=-C437ZARA.js.map
208
+ //# sourceMappingURL=-HAK3YFWW.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  assertNetworkAllowed
4
- } from "./chunk-CNMUT5YW.js";
4
+ } from "./chunk-3TUJ34V7.js";
5
5
 
6
6
  // src/pdf/formula/models.ts
7
7
  import { createHash as createHash2 } from "crypto";
@@ -296,4 +296,4 @@ export {
296
296
  ensureFormulaModels,
297
297
  ensureSingleModel
298
298
  };
299
- //# sourceMappingURL=chunk-UV2G6XFA.js.map
299
+ //# sourceMappingURL=chunk-36DK6AOX.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  KordocError
4
- } from "./chunk-4BJZGXNM.js";
4
+ } from "./chunk-5ARHF54C.js";
5
5
 
6
6
  // src/shared/offline.ts
7
7
  import { realpathSync } from "fs";
@@ -49,4 +49,4 @@ export {
49
49
  getAccessRoot,
50
50
  assertWithinRoot
51
51
  };
52
- //# sourceMappingURL=chunk-CNMUT5YW.js.map
52
+ //# sourceMappingURL=chunk-3TUJ34V7.js.map
@@ -4,15 +4,15 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkMED2MR6Ocjs = require('./chunk-MED2MR6O.cjs');
7
+ var _chunkK2NWHLCDcjs = require('./chunk-K2NWHLCD.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkZLFUZM7Hcjs = require('./chunk-ZLFUZM7H.cjs');
11
+ var _chunkEYQLJ57Ycjs = require('./chunk-EYQLJ57Y.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkAUWO57EDcjs = require('./chunk-AUWO57ED.cjs');
15
+ var _chunkMJSHXESKcjs = require('./chunk-MJSHXESK.cjs');
16
16
 
17
17
  // src/ocr/models.ts
18
18
  var _path = require('path');
@@ -48,7 +48,7 @@ var OCR_REC_DICT = {
48
48
  sizeMb: 1
49
49
  };
50
50
  function getOcrModelsDir() {
51
- return _chunkZLFUZM7Hcjs.getModelsDir.call(void 0, "ppocr");
51
+ return _chunkEYQLJ57Ycjs.getModelsDir.call(void 0, "ppocr");
52
52
  }
53
53
  var DEFAULT_OCR_MODELS = Object.freeze({
54
54
  det: { spec: OCR_DET_MODEL },
@@ -90,7 +90,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
90
90
  if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
91
91
  }
92
92
  if (!todo.length) return;
93
- await _chunkZLFUZM7Hcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
93
+ await _chunkEYQLJ57Ycjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
94
94
  for (const spec of todo) {
95
95
  const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
96
96
  if (stamp) verifiedInProcess.set(path, stamp);
@@ -2139,16 +2139,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
2139
2139
  }
2140
2140
  function takeClipCellEdges(from, to) {
2141
2141
  const e = CLIP_CELL_EDGES.get(from);
2142
- if (e) _chunkMED2MR6Ocjs.CELL_EDGES.set(to, e);
2142
+ if (e) _chunkK2NWHLCDcjs.CELL_EDGES.set(to, e);
2143
2143
  }
2144
2144
  function hasOpenCellSeam(a, b) {
2145
- const u = _chunkMED2MR6Ocjs.CELL_EDGES.get(a), d = _chunkMED2MR6Ocjs.CELL_EDGES.get(b);
2145
+ const u = _chunkK2NWHLCDcjs.CELL_EDGES.get(a), d = _chunkK2NWHLCDcjs.CELL_EDGES.get(b);
2146
2146
  return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
2147
2147
  }
2148
2148
  function joinCellEdges(a, b) {
2149
- const u = _chunkMED2MR6Ocjs.CELL_EDGES.get(a), d = _chunkMED2MR6Ocjs.CELL_EDGES.get(b);
2149
+ const u = _chunkK2NWHLCDcjs.CELL_EDGES.get(a), d = _chunkK2NWHLCDcjs.CELL_EDGES.get(b);
2150
2150
  if (!u || !d) return;
2151
- _chunkMED2MR6Ocjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
2151
+ _chunkK2NWHLCDcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
2152
2152
  }
2153
2153
 
2154
2154
  // src/pdf/cell-extract.ts
@@ -2324,7 +2324,7 @@ function tagScripts(text, lines) {
2324
2324
  const [s, e, kind] = marks[m];
2325
2325
  out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
2326
2326
  }
2327
- return _chunkMED2MR6Ocjs.tidyScriptTags.call(void 0, out);
2327
+ return _chunkK2NWHLCDcjs.tidyScriptTags.call(void 0, out);
2328
2328
  }
2329
2329
 
2330
2330
  // src/pdf/line-wrap.ts
@@ -2723,6 +2723,10 @@ function keepWordsInOneCell(result) {
2723
2723
  const owner = /* @__PURE__ */ new Map();
2724
2724
  for (const [cell, arr] of result) for (const it of arr) owner.set(it, cell);
2725
2725
  if (result.size < 2 || owner.size < 2) return;
2726
+ const separateMarker = (a, b) => {
2727
+ const ca = owner.get(a), cb = owner.get(b);
2728
+ return ca !== cb && /^[·•‧∙․ㆍ]$/.test(a.text) && ca.row === cb.row && ca.rowSpan === cb.rowSpan && ca.col + ca.colSpan === cb.col && Math.abs(ca.bbox.x2 - cb.bbox.x1) <= 1 && a.x >= ca.bbox.x1 - 1 && b.x >= cb.bbox.x1 - 1;
2729
+ };
2726
2730
  const all = [...owner.keys()].sort((a, b) => b.y - a.y || a.x - b.x);
2727
2731
  for (let i = 0; i < all.length; ) {
2728
2732
  let j = i + 1;
@@ -2730,7 +2734,7 @@ function keepWordsInOneCell(result) {
2730
2734
  const line = all.slice(i, j).sort((a, b) => a.x - b.x);
2731
2735
  for (let k = 0; k < line.length; ) {
2732
2736
  let e = k + 1;
2733
- while (e < line.length && !line[e].hasSpaceBefore && line[e].x - (line[e - 1].x + line[e - 1].w) <= spaceGapThreshold((line[e].fontSize + line[e - 1].fontSize) / 2)) e++;
2737
+ while (e < line.length && !line[e].hasSpaceBefore && !separateMarker(line[e - 1], line[e]) && line[e].x - (line[e - 1].x + line[e - 1].w) <= spaceGapThreshold((line[e].fontSize + line[e - 1].fontSize) / 2)) e++;
2734
2738
  const word = line.slice(k, e);
2735
2739
  const width = /* @__PURE__ */ new Map();
2736
2740
  for (const it of word) {
@@ -5379,9 +5383,9 @@ function detectHeadings(blocks, medianFontSize) {
5379
5383
  if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
5380
5384
  const ratio = block.style.fontSize / medianFontSize;
5381
5385
  let level = 0;
5382
- if (ratio >= _chunkMED2MR6Ocjs.HEADING_RATIO_H1) level = 1;
5383
- else if (ratio >= _chunkMED2MR6Ocjs.HEADING_RATIO_H2) level = 2;
5384
- else if (ratio >= _chunkMED2MR6Ocjs.HEADING_RATIO_H3) level = 3;
5386
+ if (ratio >= _chunkK2NWHLCDcjs.HEADING_RATIO_H1) level = 1;
5387
+ else if (ratio >= _chunkK2NWHLCDcjs.HEADING_RATIO_H2) level = 2;
5388
+ else if (ratio >= _chunkK2NWHLCDcjs.HEADING_RATIO_H3) level = 3;
5385
5389
  if (level > 0) {
5386
5390
  block.type = "heading";
5387
5391
  block.level = level;
@@ -5394,7 +5398,7 @@ function isChapterNumber(block, next, medianFontSize) {
5394
5398
  const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _158 => _158.style, 'optionalAccess', _159 => _159.fontSize]), () => ( 0));
5395
5399
  const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _160 => _160.text, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]), () => ( ""));
5396
5400
  const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _163 => _163.bbox]);
5397
- return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _164 => _164.text, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkMED2MR6Ocjs.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;
5401
+ return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _164 => _164.text, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkK2NWHLCDcjs.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;
5398
5402
  }
5399
5403
  function mergeStackedHeadingLines(blocks, medianFontSize) {
5400
5404
  for (let i = 0; i < blocks.length - 1; ) {
@@ -5938,7 +5942,9 @@ function tracksPages(occ) {
5938
5942
  if (!nums.length || nums.some((n) => n.length !== nums[0].length)) return false;
5939
5943
  return nums[0].some((_, j) => new Set(occ.map((o, k) => o.page - nums[k][j])).size === 1);
5940
5944
  }
5941
- function looseVaryingNumber(occ) {
5945
+ function looseVaryingNumber(occ, top = false) {
5946
+ const title = /^(?:【[^【】\n]*】|〔[^〔〕\n]*〕|\[[^\[\]\n]*\]|\([^()\n]*\)|〈[^〈〉\n]*〉|《[^《》\n]*》|「[^「」\n]*」|<[^<>\n]*>)$/;
5947
+ if (top && occ.every((o) => title.test(o.text) && /\p{L}/u.test(o.text))) return false;
5942
5948
  const nums = occ.map((o) => [...o.text.matchAll(/\d+/g)]);
5943
5949
  if (!nums.length || nums.some((n) => n.length !== nums[0].length)) return false;
5944
5950
  const loose = (text, m) => !/\p{L}/u.test(_nullishCoalesce(text[m.index - 1], () => ( " "))) && !/\p{L}/u.test(_nullishCoalesce(text[m.index + m[0].length], () => ( " ")));
@@ -5995,7 +6001,7 @@ function removeHeaderFooterBlocks(blocks, pageHeights, warnings, notes, tables =
5995
6001
  const varying = !tables && (_nullishCoalesce(_optionalChain([patternNumbers, 'access', _288 => _288.get, 'call', _289 => _289(p), 'optionalAccess', _290 => _290.size]), () => ( 0))) > 1;
5996
6002
  const occ = _nullishCoalesce(patternOcc.get(p), () => ( []));
5997
6003
  const dense = pages.length >= span2 * 0.4;
5998
- const loose = looseVaryingNumber(occ) && (entries === bottomEntries || dense || tracksPages(occ));
6004
+ const loose = looseVaryingNumber(occ, entries === topEntries) && (entries === bottomEntries || dense || tracksPages(occ));
5999
6005
  const pageNumbered = varying && (loose || dense && new Set(occ.map((o) => o.text)).size * 2 <= occ.length);
6000
6006
  if (count >= MIN_REPEAT2 && pages.length >= MIN_REPEAT2 && (varying ? pageNumbered : dense)) {
6001
6007
  repeatedPatterns.add(p);
@@ -6008,10 +6014,10 @@ function removeHeaderFooterBlocks(blocks, pageHeights, warnings, notes, tables =
6008
6014
  if (noteMark && _optionalChain([notes, 'optionalAccess', _295 => _295.get, 'call', _296 => _296(e.page), 'optionalAccess', _297 => _297.marks, 'access', _298 => _298.some, 'call', _299 => _299((m) => m.mark === noteMark)])) continue;
6009
6015
  const cand = blocks[e.blockIdx];
6010
6016
  const cb = cand.bbox;
6011
- const tableNote = /^(?:주\s*(?:\d+\s*[).:]|[::])|(?:자료|출처)\s*[::])/.test(e.text.replace(/ \| /g, " ")) && blocks.some((o) => {
6017
+ const tableNote = /^(?:주\s*(?:\d+\s*[).:]|[::])|(?:자료|출처)\s*[::]|\*\s+\S)/.test(e.text.replace(/ \| /g, " ")) && blocks.some((o) => {
6012
6018
  if (o.type !== "table" || !o.bbox || o.bbox.page !== cb.page) return false;
6013
6019
  const gap = o.bbox.y - (cb.y + cb.height);
6014
- return gap >= 0 && gap <= cb.height && cb.x >= o.bbox.x && cb.x + cb.width <= o.bbox.x + o.bbox.width;
6020
+ return gap >= 0 && gap <= cb.height && cb.x >= o.bbox.x - 2 && cb.x + cb.width <= o.bbox.x + o.bbox.width + 2;
6015
6021
  });
6016
6022
  if (tableNote) continue;
6017
6023
  let sharesLine = false;
@@ -6924,16 +6930,16 @@ function isProseSpread(items) {
6924
6930
  for (let i = 1; i < sorted.length; i++) {
6925
6931
  gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
6926
6932
  }
6927
- const maxGap = _chunkAUWO57EDcjs.safeMax.call(void 0, gaps);
6933
+ const maxGap = _chunkMJSHXESKcjs.safeMax.call(void 0, gaps);
6928
6934
  const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
6929
6935
  if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
6930
- const minGap = _chunkAUWO57EDcjs.safeMin.call(void 0, gaps);
6936
+ const minGap = _chunkMJSHXESKcjs.safeMin.call(void 0, gaps);
6931
6937
  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 || items.some((i) => /\p{L}[,.;:]["”’)]?$/u.test(i.text)));
6932
6938
  }
6933
6939
  function detectColumns(yLines) {
6934
6940
  const allItems = yLines.flat();
6935
6941
  if (allItems.length === 0) return null;
6936
- const pageWidth = _chunkAUWO57EDcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkAUWO57EDcjs.safeMin.call(void 0, allItems.map((i) => i.x));
6942
+ const pageWidth = _chunkMJSHXESKcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkMJSHXESKcjs.safeMin.call(void 0, allItems.map((i) => i.x));
6937
6943
  if (pageWidth < 100) return null;
6938
6944
  let bigoLineIdx = -1;
6939
6945
  for (let i = 0; i < yLines.length; i++) {
@@ -7425,7 +7431,7 @@ function rebuildUnitLine(items, grid) {
7425
7431
  function prependUnitRow(cells, cols, line, usedItems) {
7426
7432
  const text = cleanCellText(line.map((item) => item.text).join(""));
7427
7433
  cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
7428
- for (const cell of cells[0]) _chunkMED2MR6Ocjs.CELL_EDGES.set(cell, NO_EDGES);
7434
+ for (const cell of cells[0]) _chunkK2NWHLCDcjs.CELL_EDGES.set(cell, NO_EDGES);
7429
7435
  for (const item of line) usedItems.add(item);
7430
7436
  }
7431
7437
  function attachUnitRow(items, grid, cells, cols, usedItems) {
@@ -7957,7 +7963,7 @@ function recordFrameTitle(table, source, pageNum) {
7957
7963
  const [label, spacer, title] = cells;
7958
7964
  if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
7959
7965
  if (cells.some((c) => {
7960
- const e = _chunkMED2MR6Ocjs.CELL_EDGES.get(c);
7966
+ const e = _chunkK2NWHLCDcjs.CELL_EDGES.get(c);
7961
7967
  return !e || e.t || e.b || e.l || e.r;
7962
7968
  })) return;
7963
7969
  const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _357 => _357.fontSize]), () => ( 0));
@@ -8538,7 +8544,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
8538
8544
  groupSizes.push(1);
8539
8545
  }
8540
8546
  const allY = remaining.map((i) => i.y);
8541
- const pageH = _chunkAUWO57EDcjs.safeMax.call(void 0, allY) - _chunkAUWO57EDcjs.safeMin.call(void 0, allY);
8547
+ const pageH = _chunkMJSHXESKcjs.safeMax.call(void 0, allY) - _chunkMJSHXESKcjs.safeMin.call(void 0, allY);
8542
8548
  const gapThreshold = Math.max(15, pageH * 0.03);
8543
8549
  const sides = frameColumnTextBands(remaining, spanning, gx);
8544
8550
  const textBlocks = [];
@@ -8554,7 +8560,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
8554
8560
  finalTextBlocks.push(...detectListBlocks(textBlocks));
8555
8561
  } else {
8556
8562
  const allY = remaining.map((i) => i.y);
8557
- const pageH = _chunkAUWO57EDcjs.safeMax.call(void 0, allY) - _chunkAUWO57EDcjs.safeMin.call(void 0, allY);
8563
+ const pageH = _chunkMJSHXESKcjs.safeMax.call(void 0, allY) - _chunkMJSHXESKcjs.safeMin.call(void 0, allY);
8558
8564
  const gapThreshold = Math.max(15, pageH * 0.03);
8559
8565
  const groups = xyCutOrder(remaining, gapThreshold);
8560
8566
  const textBlocks = [];
@@ -8882,7 +8888,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
8882
8888
  blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
8883
8889
  } else {
8884
8890
  const allY = items.map((i) => i.y);
8885
- const pageHeight = _chunkAUWO57EDcjs.safeMax.call(void 0, allY) - _chunkAUWO57EDcjs.safeMin.call(void 0, allY);
8891
+ const pageHeight = _chunkMJSHXESKcjs.safeMax.call(void 0, allY) - _chunkMJSHXESKcjs.safeMin.call(void 0, allY);
8886
8892
  const gapThreshold = Math.max(15, pageHeight * 0.03);
8887
8893
  const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
8888
8894
  for (const group of orderedGroups) {
@@ -9096,4 +9102,4 @@ function rowParagraphs(block) {
9096
9102
 
9097
9103
 
9098
9104
  exports.DEFAULT_OCR_MODELS = DEFAULT_OCR_MODELS; exports.resolveOcrModels = resolveOcrModels; exports.ocrSelectionKey = ocrSelectionKey; exports.ocrSourcePath = ocrSourcePath; exports.ensureOcrModelsFor = ensureOcrModelsFor; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.NO_EDGES = NO_EDGES; exports.hasOpenCellSeam = hasOpenCellSeam; exports.joinCellEdges = joinCellEdges; 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.runningLinePatterns = runningLinePatterns; exports.stripAbsorbedRunningLines = stripAbsorbedRunningLines; 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.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines; exports.UNRULED_REGION_TABLES = UNRULED_REGION_TABLES; exports.mergeOcrImageRegions = mergeOcrImageRegions;
9099
- //# sourceMappingURL=chunk-I4BS4BXE.cjs.map
9105
+ //# sourceMappingURL=chunk-4X7AR4EH.cjs.map