kordoc 4.24.32 → 4.24.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{-LUXUXRRP.js → -VJMJHJUV.js} +21 -21
- package/dist/{chunk-SUXMLHGD.js → chunk-2GQYZDWL.js} +5 -5
- package/dist/{chunk-WSLTEGNZ.cjs → chunk-2OAYTOGK.cjs} +53 -46
- package/dist/chunk-2OAYTOGK.cjs.map +1 -0
- package/dist/{chunk-LC7UADO4.js → chunk-4AEB4N4I.js} +2 -2
- package/dist/{chunk-BYMJHMCO.js → chunk-4BYEXK3A.js} +2 -2
- package/dist/{chunk-IXR4R6WY.js → chunk-4EF5VQJI.js} +2 -2
- package/dist/{chunk-F2MJ743H.cjs → chunk-5AJIIHVQ.cjs} +3 -3
- package/dist/{chunk-F2MJ743H.cjs.map → chunk-5AJIIHVQ.cjs.map} +1 -1
- package/dist/{chunk-AFKBT7U7.cjs → chunk-6FRVF6TG.cjs} +6 -6
- package/dist/{chunk-AFKBT7U7.cjs.map → chunk-6FRVF6TG.cjs.map} +1 -1
- package/dist/{chunk-43LXQDAF.js → chunk-6KCW5ERT.js} +2 -2
- package/dist/{chunk-UTG6ZMOQ.js → chunk-6N5OGJEG.js} +3 -3
- package/dist/{chunk-XAZ75O4F.js → chunk-7I3KYPEW.js} +3 -3
- package/dist/{chunk-MQT2KQPZ.js → chunk-AK5NG4UP.js} +11 -4
- package/dist/{chunk-MQT2KQPZ.js.map → chunk-AK5NG4UP.js.map} +1 -1
- package/dist/{chunk-XX4RPLJE.js → chunk-AVP26CQQ.js} +2 -2
- package/dist/{chunk-EJGNHZH4.js → chunk-B4SJHFLC.js} +2 -2
- package/dist/{chunk-CS5HJ33Q.js → chunk-BAEJLGWP.js} +4 -4
- package/dist/{chunk-5422GANH.js → chunk-BOQSI3W4.js} +5 -5
- package/dist/{chunk-KCGJYMT5.cjs → chunk-CGSPF3W4.cjs} +57 -57
- package/dist/{chunk-KCGJYMT5.cjs.map → chunk-CGSPF3W4.cjs.map} +1 -1
- package/dist/{chunk-5EL3BLQQ.js → chunk-FS6APRHE.js} +10 -10
- package/dist/{chunk-5VOP7CS4.js → chunk-H5WRN4SD.js} +2 -2
- package/dist/{chunk-CHTHOA5Q.js → chunk-JEELAVXP.js} +2 -2
- package/dist/{chunk-VNQNBAQR.js → chunk-K2XANWKB.js} +2 -2
- package/dist/{chunk-GQF5FWHC.js → chunk-K5KUCDJA.js} +6 -6
- package/dist/{chunk-IVWTLATP.js → chunk-KMX4TRB6.js} +11 -11
- package/dist/{chunk-NGWZKYCM.js → chunk-L37JFZ7K.js} +15 -15
- package/dist/{chunk-ZOJ4Y6FU.js → chunk-LRKYQPHL.js} +3 -3
- package/dist/{chunk-EQSZI34W.js → chunk-LSWSIFQK.js} +2 -2
- package/dist/{chunk-T76RA73M.js → chunk-QHP7K5RJ.js} +10 -3
- package/dist/{chunk-T76RA73M.js.map → chunk-QHP7K5RJ.js.map} +1 -1
- package/dist/{chunk-HAO3GCFN.js → chunk-ROEASSQ2.js} +2 -2
- package/dist/{chunk-VKALZCFP.cjs → chunk-RUXRC73V.cjs} +3 -3
- package/dist/{chunk-VKALZCFP.cjs.map → chunk-RUXRC73V.cjs.map} +1 -1
- package/dist/{chunk-HL2MKMAB.js → chunk-SKTD43V5.js} +2 -2
- package/dist/{chunk-2KT3O555.js → chunk-TOJ5ZM5Z.js} +2 -2
- package/dist/{chunk-ZSRU2NAN.js → chunk-ULKJRSSC.js} +6 -6
- package/dist/{chunk-NYJFLIIY.js → chunk-UOP6ET2G.js} +4 -4
- package/dist/{chunk-ACJ2RKB5.js → chunk-VOHJI7UA.js} +2 -2
- package/dist/{chunk-M47OMWZB.cjs → chunk-VPVRR7XM.cjs} +77 -77
- package/dist/{chunk-M47OMWZB.cjs.map → chunk-VPVRR7XM.cjs.map} +1 -1
- package/dist/{chunk-IHPVJVMY.js → chunk-VY5QRTK6.js} +2 -2
- package/dist/{chunk-H2QIVR7G.js → chunk-W44PZXHT.js} +2 -2
- package/dist/{chunk-3IYHSDWU.js → chunk-WHBUQLGW.js} +2 -2
- package/dist/{chunk-ILRK3SQE.cjs → chunk-WMPHXVVK.cjs} +98 -98
- package/dist/{chunk-ILRK3SQE.cjs.map → chunk-WMPHXVVK.cjs.map} +1 -1
- package/dist/{chunk-VC7RNGWI.js → chunk-XYPYA5YD.js} +2 -2
- package/dist/{chunk-GQ4QXT3L.cjs → chunk-Y62EQKFE.cjs} +2 -2
- package/dist/{chunk-GQ4QXT3L.cjs.map → chunk-Y62EQKFE.cjs.map} +1 -1
- package/dist/{chunk-6P3CSX22.js → chunk-ZBBWB5XE.js} +2 -2
- package/dist/{chunk-NDY5GTXO.js → chunk-ZQUITOTF.js} +6 -6
- package/dist/{chunk-7L6K647Z.js → chunk-ZU7JNP46.js} +3 -3
- package/dist/chunks-GMCNVH3S.js +11 -0
- package/dist/cli.js +43 -43
- package/dist/{formula-5EUTAHFF.js → formula-DPL6TFRL.js} +4 -4
- package/dist/{formula-YHE5IXHF.js → formula-HZBNTPCJ.js} +3 -3
- package/dist/{formula-KUW2TCLV.cjs → formula-ZK4LHS7C.cjs} +9 -9
- package/dist/{formula-KUW2TCLV.cjs.map → formula-ZK4LHS7C.cjs.map} +1 -1
- package/dist/generator-F5SA77Z2.js +10 -0
- package/dist/generator-IMLFUTZN.js +17 -0
- package/dist/generator-WGAZYMHC.cjs +11 -0
- package/dist/{generator-MVIHCXCO.cjs.map → generator-WGAZYMHC.cjs.map} +1 -1
- package/dist/{image-ocr-G75XSAG3.js → image-ocr-DHOYWKDL.js} +9 -9
- package/dist/{image-ocr-WXIPZM4K.js → image-ocr-EHNVJCJN.js} +6 -6
- package/dist/{image-ocr-T6SWDPCQ.cjs → image-ocr-O3RV6S7G.cjs} +17 -17
- package/dist/{image-ocr-T6SWDPCQ.cjs.map → image-ocr-O3RV6S7G.cjs.map} +1 -1
- package/dist/index.cjs +1105 -1105
- package/dist/index.js +9 -9
- package/dist/mcp.js +36 -36
- package/dist/memo-Q3MW3F6J.js +17 -0
- package/dist/{model-bundle-K7TMFTQG.js → model-bundle-KXMAD3IX.js} +5 -5
- package/dist/{models-FC2VFYTT.js → models-B3XXHYL7.js} +5 -5
- package/dist/{parse-worker-v2-XGYCMQX3.js → parse-worker-v2-4IOWCZOA.js} +22 -22
- package/dist/{parser-4NZS7RHU.js → parser-IWS3LL4K.js} +32 -12
- package/dist/parser-IWS3LL4K.js.map +1 -0
- package/dist/{parser-WY2TNR3F.cjs → parser-SCIK56OK.cjs} +177 -157
- package/dist/parser-SCIK56OK.cjs.map +1 -0
- package/dist/{parser-OF5RON3O.js → parser-SCMOUVJR.js} +29 -9
- package/dist/parser-SCMOUVJR.js.map +1 -0
- package/dist/{pdf-ocr-PHEITXPB.js → pdf-ocr-H6M26CCS.js} +9 -9
- package/dist/{pdf-ocr-GBAI4WPI.js → pdf-ocr-NCR5VGQ3.js} +6 -6
- package/dist/pdf-ocr-WSVG5I67.cjs +36 -0
- package/dist/{pdf-ocr-A2XZEFKU.cjs.map → pdf-ocr-WSVG5I67.cjs.map} +1 -1
- package/dist/{profile-io-KAWLYNZG.js → profile-io-TXZMEGIL.js} +3 -3
- package/dist/{rasterize-3T32WACR.js → rasterize-2XW5UTUO.js} +3 -3
- package/dist/{redact-doc-SESRIZDG.js → redact-doc-IIU4WLDJ.js} +21 -21
- package/dist/{render-F2Y24CIV.js → render-A6CJKG4A.js} +12 -12
- package/dist/{rewrite-fallback-PA77CDG2.js → rewrite-fallback-YQWV6PDM.js} +13 -13
- package/dist/seal-2H52WTQ7.js +16 -0
- package/dist/{setup-3V4TAVDL.js → setup-N6UAGEJB.js} +3 -3
- package/dist/to-hwpx-DJMFPB5P.cjs +16 -0
- package/dist/{to-hwpx-ZZ6MRK6J.cjs.map → to-hwpx-DJMFPB5P.cjs.map} +1 -1
- package/dist/{to-hwpx-ZKGWWYLW.js → to-hwpx-VDY3BBFQ.js} +4 -4
- package/dist/{to-hwpx-UYEHTR52.js → to-hwpx-WKAWPRU3.js} +7 -7
- package/dist/visual-EQQIXRV2.js +37 -0
- package/dist/{watch-EVXHD7FG.js → watch-5344FJMU.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-WSLTEGNZ.cjs.map +0 -1
- package/dist/chunks-KM5LQBRQ.js +0 -11
- package/dist/generator-MVIHCXCO.cjs +0 -11
- package/dist/generator-PWHCWSNS.js +0 -10
- package/dist/generator-S7YCIZY5.js +0 -17
- package/dist/memo-F25NX6AO.js +0 -17
- package/dist/parser-4NZS7RHU.js.map +0 -1
- package/dist/parser-OF5RON3O.js.map +0 -1
- package/dist/parser-WY2TNR3F.cjs.map +0 -1
- package/dist/pdf-ocr-A2XZEFKU.cjs +0 -36
- package/dist/seal-RL3JRMDU.js +0 -16
- package/dist/to-hwpx-ZZ6MRK6J.cjs +0 -16
- package/dist/visual-CAR6NUV3.js +0 -37
- /package/dist/{-LUXUXRRP.js.map → -VJMJHJUV.js.map} +0 -0
- /package/dist/{chunk-SUXMLHGD.js.map → chunk-2GQYZDWL.js.map} +0 -0
- /package/dist/{chunk-LC7UADO4.js.map → chunk-4AEB4N4I.js.map} +0 -0
- /package/dist/{chunk-BYMJHMCO.js.map → chunk-4BYEXK3A.js.map} +0 -0
- /package/dist/{chunk-IXR4R6WY.js.map → chunk-4EF5VQJI.js.map} +0 -0
- /package/dist/{chunk-43LXQDAF.js.map → chunk-6KCW5ERT.js.map} +0 -0
- /package/dist/{chunk-UTG6ZMOQ.js.map → chunk-6N5OGJEG.js.map} +0 -0
- /package/dist/{chunk-XAZ75O4F.js.map → chunk-7I3KYPEW.js.map} +0 -0
- /package/dist/{chunk-XX4RPLJE.js.map → chunk-AVP26CQQ.js.map} +0 -0
- /package/dist/{chunk-EJGNHZH4.js.map → chunk-B4SJHFLC.js.map} +0 -0
- /package/dist/{chunk-CS5HJ33Q.js.map → chunk-BAEJLGWP.js.map} +0 -0
- /package/dist/{chunk-5422GANH.js.map → chunk-BOQSI3W4.js.map} +0 -0
- /package/dist/{chunk-5EL3BLQQ.js.map → chunk-FS6APRHE.js.map} +0 -0
- /package/dist/{chunk-5VOP7CS4.js.map → chunk-H5WRN4SD.js.map} +0 -0
- /package/dist/{chunk-CHTHOA5Q.js.map → chunk-JEELAVXP.js.map} +0 -0
- /package/dist/{chunk-VNQNBAQR.js.map → chunk-K2XANWKB.js.map} +0 -0
- /package/dist/{chunk-GQF5FWHC.js.map → chunk-K5KUCDJA.js.map} +0 -0
- /package/dist/{chunk-IVWTLATP.js.map → chunk-KMX4TRB6.js.map} +0 -0
- /package/dist/{chunk-NGWZKYCM.js.map → chunk-L37JFZ7K.js.map} +0 -0
- /package/dist/{chunk-ZOJ4Y6FU.js.map → chunk-LRKYQPHL.js.map} +0 -0
- /package/dist/{chunk-EQSZI34W.js.map → chunk-LSWSIFQK.js.map} +0 -0
- /package/dist/{chunk-HAO3GCFN.js.map → chunk-ROEASSQ2.js.map} +0 -0
- /package/dist/{chunk-HL2MKMAB.js.map → chunk-SKTD43V5.js.map} +0 -0
- /package/dist/{chunk-2KT3O555.js.map → chunk-TOJ5ZM5Z.js.map} +0 -0
- /package/dist/{chunk-ZSRU2NAN.js.map → chunk-ULKJRSSC.js.map} +0 -0
- /package/dist/{chunk-NYJFLIIY.js.map → chunk-UOP6ET2G.js.map} +0 -0
- /package/dist/{chunk-ACJ2RKB5.js.map → chunk-VOHJI7UA.js.map} +0 -0
- /package/dist/{chunk-IHPVJVMY.js.map → chunk-VY5QRTK6.js.map} +0 -0
- /package/dist/{chunk-H2QIVR7G.js.map → chunk-W44PZXHT.js.map} +0 -0
- /package/dist/{chunk-3IYHSDWU.js.map → chunk-WHBUQLGW.js.map} +0 -0
- /package/dist/{chunk-VC7RNGWI.js.map → chunk-XYPYA5YD.js.map} +0 -0
- /package/dist/{chunk-6P3CSX22.js.map → chunk-ZBBWB5XE.js.map} +0 -0
- /package/dist/{chunk-NDY5GTXO.js.map → chunk-ZQUITOTF.js.map} +0 -0
- /package/dist/{chunk-7L6K647Z.js.map → chunk-ZU7JNP46.js.map} +0 -0
- /package/dist/{chunks-KM5LQBRQ.js.map → chunks-GMCNVH3S.js.map} +0 -0
- /package/dist/{formula-5EUTAHFF.js.map → formula-DPL6TFRL.js.map} +0 -0
- /package/dist/{formula-YHE5IXHF.js.map → formula-HZBNTPCJ.js.map} +0 -0
- /package/dist/{generator-PWHCWSNS.js.map → generator-F5SA77Z2.js.map} +0 -0
- /package/dist/{generator-S7YCIZY5.js.map → generator-IMLFUTZN.js.map} +0 -0
- /package/dist/{image-ocr-G75XSAG3.js.map → image-ocr-DHOYWKDL.js.map} +0 -0
- /package/dist/{image-ocr-WXIPZM4K.js.map → image-ocr-EHNVJCJN.js.map} +0 -0
- /package/dist/{memo-F25NX6AO.js.map → memo-Q3MW3F6J.js.map} +0 -0
- /package/dist/{model-bundle-K7TMFTQG.js.map → model-bundle-KXMAD3IX.js.map} +0 -0
- /package/dist/{models-FC2VFYTT.js.map → models-B3XXHYL7.js.map} +0 -0
- /package/dist/{parse-worker-v2-XGYCMQX3.js.map → parse-worker-v2-4IOWCZOA.js.map} +0 -0
- /package/dist/{pdf-ocr-GBAI4WPI.js.map → pdf-ocr-H6M26CCS.js.map} +0 -0
- /package/dist/{pdf-ocr-PHEITXPB.js.map → pdf-ocr-NCR5VGQ3.js.map} +0 -0
- /package/dist/{profile-io-KAWLYNZG.js.map → profile-io-TXZMEGIL.js.map} +0 -0
- /package/dist/{rasterize-3T32WACR.js.map → rasterize-2XW5UTUO.js.map} +0 -0
- /package/dist/{redact-doc-SESRIZDG.js.map → redact-doc-IIU4WLDJ.js.map} +0 -0
- /package/dist/{render-F2Y24CIV.js.map → render-A6CJKG4A.js.map} +0 -0
- /package/dist/{rewrite-fallback-PA77CDG2.js.map → rewrite-fallback-YQWV6PDM.js.map} +0 -0
- /package/dist/{seal-RL3JRMDU.js.map → seal-2H52WTQ7.js.map} +0 -0
- /package/dist/{setup-3V4TAVDL.js.map → setup-N6UAGEJB.js.map} +0 -0
- /package/dist/{to-hwpx-UYEHTR52.js.map → to-hwpx-VDY3BBFQ.js.map} +0 -0
- /package/dist/{to-hwpx-ZKGWWYLW.js.map → to-hwpx-WKAWPRU3.js.map} +0 -0
- /package/dist/{visual-CAR6NUV3.js.map → visual-EQQIXRV2.js.map} +0 -0
- /package/dist/{watch-EVXHD7FG.js.map → watch-5344FJMU.js.map} +0 -0
package/README.md
CHANGED
|
@@ -131,15 +131,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
131
131
|
|
|
132
132
|
## 최근 업데이트
|
|
133
133
|
|
|
134
|
-
최신 배포: **[4.24.
|
|
134
|
+
최신 배포: **[4.24.33](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.33)** · 2026-11-01
|
|
135
135
|
|
|
136
136
|
| 버전 | 주요 변경 | 수치 변화 |
|
|
137
137
|
| --- | --- | --- |
|
|
138
|
+
| 4.24.33 | PDF 표: 모아찍기 쪽 넘김에서 오른쪽 쪽 머리 상자로 넘어간 칸 글을 앞 칸에 잇기 · 칸을 한 겹 더 깐 1×1 클립(통계표 숫자 칸)을 중첩 표 대신 칸 글로 | PDF 표 칸 내용 일치 0.98794 → **0.98896** · 칸 완전 일치 0.99153 → **0.99221** · 그 밖 벤치 지표 그대로 |
|
|
138
139
|
| 4.24.32 | PDF·OCR 두 단: 같은 줄 격자 두 단(속기록·시험지)을 단으로 · 옆 단 머리 문항이 앞 선지 하위 목록이 되던 것 · 짝·홀 쪽에서 칸 순서가 뒤집히는 머리말 상자 걷기 | PDF 글 읽기 순서 99.348% → **99.356%** · 정확도 99.680% → **99.682%** · 어절 F1 99.069% → **99.071%** · OCR 정답(텍스트층) 회의록 두 단이 바로잡혀 CER 0.0237 → 0.0239(정답 변화, 채점 그대로) |
|
|
139
140
|
| 4.24.31 | PDF 읽기 순서: 그림 위주 2-up 쪽 · 결재문서 머리 나란한 표(문서번호 → 결재 칸) · PDF 가짜 표: 고시안 머리 "○○고시 제 호" 아래 본문 · HWP 3 기술 교재 고정폭 낱말 줄 | PDF 글 읽기 순서 99.312% → **99.348%** · 정확도 99.678% → **99.680%** · 표 순서 뒤바뀜 5 → **2** · 그 밖 벤치 지표 그대로 |
|
|
140
141
|
| 4.24.30 | 파서: 채운 누름틀·하이퍼링크가 든 문단의 굵게·밑줄 표지(보도자료 본문 누름틀 강조가 사라지던 것, HWPX·HWP) · PDF 표: 몇 칸에만 걸린 한컴 클립이 선 표 칸을 빼앗던 것 · to-hwpx: 그리기 선 투명도 | OCR 표 정답의 가짜 표가 빠져 34/67 → **34/66**·CER 0.0244 → **0.0237** · patch 굵은 낱말 넣기 잔차 HWPX 80 → **60**/489 · 벤치 지표 그대로 |
|
|
141
142
|
| 4.24.29 | to-hwpx: 한글이 저장한 꼴로 — 문단 글 방향(textDir)·같은 문단 모양 합치기·홀수 값 여백·탭의 글자 단위·OLE 이름·메모 확장·옛 판 테두리 0번 등 · patch: 새 글에 표시한 강조(원문에 없던 서식도), 한 문단 여러 곳 고칠 때 사이 글 서식 보존, HTML 표 칸 강조 표지가 글자로 박히던 것, HWP 칸 안 중첩 표 칸 · HWP 파서: 위첨자가 든 굵은 문단 강조 | 변환 속성 일치 0.99194 → **0.99214** · 완전 일치 14 → **69**/232 · patch 굵은 낱말 넣기 잔차 HWPX 241 → **121**/265 · HWP 표 칸 끝 붙이기 83 → **93**/93 · HWP·HWPX parse 대조 다른 단위 118 → **98** · 벤치 지표 그대로 |
|
|
142
|
-
| 4.24.28 | 메모 읽기·달기(`memos`·`kordoc memo`·MCP `add_memo`, #180) · patch: 굵은 글·위첨자 끝에 붙인 글이 서식을 물려받던 것(HWP·HWPX), 글머리표 문단(#179), HWPX 탭·엔티티·PUA 문단과 HWP PUA·강제 줄바꿈 문단·표 칸은 바뀐 자리만 · to-hwpx: 원·네모 겹치기 번호(#178) · HWP 파서: 굵게·기울임·취소선·밑줄 표지 | patch 검증 잔차 HWPX 45 → **3**/540 · HWP 24 → **4**/140·37 → **0**/605(파서 강조 반영 뒤 기준) · HWP 대체본 원본 서식 90 → **94**/98 · HWP·HWPX parse 대조 다른 단위 390 → **118** · 벤치 지표 그대로 |
|
|
143
143
|
|
|
144
144
|
이전 버전과 상세 내용은 [변경 이력](CHANGELOG.md)에 있습니다.
|
|
145
145
|
|
|
@@ -53,26 +53,26 @@ import {
|
|
|
53
53
|
usesGaejosikMunche,
|
|
54
54
|
usesLogicStructure,
|
|
55
55
|
validateHwpx
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-L37JFZ7K.js";
|
|
57
57
|
import {
|
|
58
58
|
blocksToPages
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-AVP26CQQ.js";
|
|
60
60
|
import {
|
|
61
61
|
extractClickHereFields,
|
|
62
62
|
patchHwp,
|
|
63
63
|
patchHwpx
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-KMX4TRB6.js";
|
|
65
65
|
import {
|
|
66
66
|
addMemoHwpx
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-K5KUCDJA.js";
|
|
68
68
|
import {
|
|
69
69
|
placeSealHwpx
|
|
70
|
-
} from "./chunk-
|
|
71
|
-
import "./chunk-
|
|
70
|
+
} from "./chunk-2GQYZDWL.js";
|
|
71
|
+
import "./chunk-6KCW5ERT.js";
|
|
72
72
|
import {
|
|
73
73
|
convertToHwpx,
|
|
74
74
|
hwpToHwpx
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-ZQUITOTF.js";
|
|
76
76
|
import {
|
|
77
77
|
DEFAULT_REDACT_RULES,
|
|
78
78
|
redactMarkdown,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
} from "./chunk-3WSNLH4B.js";
|
|
81
81
|
import {
|
|
82
82
|
blocksToChunks
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-SKTD43V5.js";
|
|
84
84
|
import {
|
|
85
85
|
blocksToPdf,
|
|
86
86
|
extractRenderedRegions,
|
|
@@ -91,13 +91,13 @@ import {
|
|
|
91
91
|
renderHwp5Pages,
|
|
92
92
|
renderHwpxToSvg,
|
|
93
93
|
renderSceneToHtml
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import "./chunk-
|
|
96
|
-
import "./chunk-
|
|
97
|
-
import "./chunk-
|
|
94
|
+
} from "./chunk-FS6APRHE.js";
|
|
95
|
+
import "./chunk-LRKYQPHL.js";
|
|
96
|
+
import "./chunk-XYPYA5YD.js";
|
|
97
|
+
import "./chunk-BOQSI3W4.js";
|
|
98
98
|
import "./chunk-VKVDMH7X.js";
|
|
99
|
-
import "./chunk-
|
|
100
|
-
import "./chunk-
|
|
99
|
+
import "./chunk-K2XANWKB.js";
|
|
100
|
+
import "./chunk-ZBBWB5XE.js";
|
|
101
101
|
import "./chunk-VQFA55IC.js";
|
|
102
102
|
import {
|
|
103
103
|
detectFormat,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
markdownToHwpx,
|
|
120
120
|
normalizeGongmunPreset,
|
|
121
121
|
placeTotalRow
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-ULKJRSSC.js";
|
|
123
123
|
import {
|
|
124
124
|
ValueCursor,
|
|
125
125
|
applySplices,
|
|
@@ -141,20 +141,20 @@ import {
|
|
|
141
141
|
measureTextWidth,
|
|
142
142
|
simulateWrap,
|
|
143
143
|
simulateWrapKeepWord
|
|
144
|
-
} from "./chunk-
|
|
145
|
-
import "./chunk-
|
|
144
|
+
} from "./chunk-VY5QRTK6.js";
|
|
145
|
+
import "./chunk-H5WRN4SD.js";
|
|
146
146
|
import "./chunk-OFVHQ2TZ.js";
|
|
147
147
|
import "./chunk-WFKFG2RT.js";
|
|
148
|
-
import "./chunk-
|
|
148
|
+
import "./chunk-4AEB4N4I.js";
|
|
149
149
|
import {
|
|
150
150
|
blocksToMarkdown,
|
|
151
151
|
flattenLayoutTables,
|
|
152
152
|
hasStructuredCellContent
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-4EF5VQJI.js";
|
|
154
154
|
import "./chunk-KFF47XZ7.js";
|
|
155
155
|
import {
|
|
156
156
|
VERSION
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-TOJ5ZM5Z.js";
|
|
158
158
|
export {
|
|
159
159
|
AGENCY_COMMON_NAME,
|
|
160
160
|
BUILTIN_TEMPLATES,
|
|
@@ -268,4 +268,4 @@ export {
|
|
|
268
268
|
usesLogicStructure,
|
|
269
269
|
validateHwpx
|
|
270
270
|
};
|
|
271
|
-
//# sourceMappingURL=-
|
|
271
|
+
//# sourceMappingURL=-VJMJHJUV.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
patchZipEntries
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6KCW5ERT.js";
|
|
5
5
|
import {
|
|
6
6
|
parseRenderStyles
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XYPYA5YD.js";
|
|
8
8
|
import {
|
|
9
9
|
applySplices,
|
|
10
10
|
scanSectionXml
|
|
11
11
|
} from "./chunk-3AHL6YEA.js";
|
|
12
12
|
import {
|
|
13
13
|
readZipEntry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H5WRN4SD.js";
|
|
15
15
|
import {
|
|
16
16
|
KordocError,
|
|
17
17
|
precheckZipSize
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TOJ5ZM5Z.js";
|
|
19
19
|
|
|
20
20
|
// src/form/seal.ts
|
|
21
21
|
import JSZip from "jszip";
|
|
@@ -321,4 +321,4 @@ export {
|
|
|
321
321
|
collectSites,
|
|
322
322
|
placeSealHwpx
|
|
323
323
|
};
|
|
324
|
-
//# sourceMappingURL=chunk-
|
|
324
|
+
//# sourceMappingURL=chunk-2GQYZDWL.js.map
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk6FRVF6TGcjs = require('./chunk-6FRVF6TG.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk5AJIIHVQcjs = require('./chunk-5AJIIHVQ.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkY62EQKFEcjs = require('./chunk-Y62EQKFE.cjs');
|
|
17
17
|
|
|
18
18
|
// src/ocr/models.ts
|
|
19
19
|
var _path = require('path');
|
|
@@ -65,7 +65,7 @@ var OCR_REC_DICT = {
|
|
|
65
65
|
sizeMb: 1
|
|
66
66
|
};
|
|
67
67
|
function getOcrModelsDir() {
|
|
68
|
-
return
|
|
68
|
+
return _chunk5AJIIHVQcjs.getModelsDir.call(void 0, "ppocr");
|
|
69
69
|
}
|
|
70
70
|
var DEFAULT_OCR_MODELS = Object.freeze({
|
|
71
71
|
det: { spec: OCR_DET_MODEL },
|
|
@@ -107,7 +107,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
|
|
|
107
107
|
if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
|
|
108
108
|
}
|
|
109
109
|
if (!todo.length) return;
|
|
110
|
-
await
|
|
110
|
+
await _chunk5AJIIHVQcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
|
|
111
111
|
for (const spec of todo) {
|
|
112
112
|
const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
|
|
113
113
|
if (stamp) verifiedInProcess.set(path, stamp);
|
|
@@ -3198,16 +3198,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
function takeClipCellEdges(from, to) {
|
|
3200
3200
|
const e = CLIP_CELL_EDGES.get(from);
|
|
3201
|
-
if (e)
|
|
3201
|
+
if (e) _chunk6FRVF6TGcjs.CELL_EDGES.set(to, e);
|
|
3202
3202
|
}
|
|
3203
3203
|
function hasOpenCellSeam(a, b) {
|
|
3204
|
-
const u =
|
|
3204
|
+
const u = _chunk6FRVF6TGcjs.CELL_EDGES.get(a), d = _chunk6FRVF6TGcjs.CELL_EDGES.get(b);
|
|
3205
3205
|
return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
|
|
3206
3206
|
}
|
|
3207
3207
|
function joinCellEdges(a, b) {
|
|
3208
|
-
const u =
|
|
3208
|
+
const u = _chunk6FRVF6TGcjs.CELL_EDGES.get(a), d = _chunk6FRVF6TGcjs.CELL_EDGES.get(b);
|
|
3209
3209
|
if (!u || !d) return;
|
|
3210
|
-
|
|
3210
|
+
_chunk6FRVF6TGcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
3211
3211
|
}
|
|
3212
3212
|
|
|
3213
3213
|
// src/pdf/cell-extract.ts
|
|
@@ -3383,7 +3383,7 @@ function tagScripts(text, lines) {
|
|
|
3383
3383
|
const [s, e, kind] = marks[m];
|
|
3384
3384
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
3385
3385
|
}
|
|
3386
|
-
return
|
|
3386
|
+
return _chunk6FRVF6TGcjs.tidyScriptTags.call(void 0, out);
|
|
3387
3387
|
}
|
|
3388
3388
|
|
|
3389
3389
|
// src/pdf/line-wrap.ts
|
|
@@ -6645,9 +6645,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
6645
6645
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
6646
6646
|
const ratio = block.style.fontSize / medianFontSize;
|
|
6647
6647
|
let level = 0;
|
|
6648
|
-
if (ratio >=
|
|
6649
|
-
else if (ratio >=
|
|
6650
|
-
else if (ratio >=
|
|
6648
|
+
if (ratio >= _chunk6FRVF6TGcjs.HEADING_RATIO_H1) level = 1;
|
|
6649
|
+
else if (ratio >= _chunk6FRVF6TGcjs.HEADING_RATIO_H2) level = 2;
|
|
6650
|
+
else if (ratio >= _chunk6FRVF6TGcjs.HEADING_RATIO_H3) level = 3;
|
|
6651
6651
|
if (level > 0) {
|
|
6652
6652
|
block.type = "heading";
|
|
6653
6653
|
block.level = level;
|
|
@@ -6660,7 +6660,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
6660
6660
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _178 => _178.style, 'optionalAccess', _179 => _179.fontSize]), () => ( 0));
|
|
6661
6661
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _180 => _180.text, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]), () => ( ""));
|
|
6662
6662
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _183 => _183.bbox]);
|
|
6663
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _184 => _184.text, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
6663
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _184 => _184.text, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunk6FRVF6TGcjs.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;
|
|
6664
6664
|
}
|
|
6665
6665
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
6666
6666
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -8224,16 +8224,16 @@ function isProseSpread(items) {
|
|
|
8224
8224
|
for (let i = 1; i < sorted.length; i++) {
|
|
8225
8225
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
8226
8226
|
}
|
|
8227
|
-
const maxGap =
|
|
8227
|
+
const maxGap = _chunkY62EQKFEcjs.safeMax.call(void 0, gaps);
|
|
8228
8228
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
8229
8229
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
8230
|
-
const minGap =
|
|
8230
|
+
const minGap = _chunkY62EQKFEcjs.safeMin.call(void 0, gaps);
|
|
8231
8231
|
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)));
|
|
8232
8232
|
}
|
|
8233
8233
|
function detectColumns(yLines) {
|
|
8234
8234
|
const allItems = yLines.flat();
|
|
8235
8235
|
if (allItems.length === 0) return null;
|
|
8236
|
-
const pageWidth =
|
|
8236
|
+
const pageWidth = _chunkY62EQKFEcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkY62EQKFEcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
8237
8237
|
if (pageWidth < 100) return null;
|
|
8238
8238
|
let bigoLineIdx = -1;
|
|
8239
8239
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -8631,13 +8631,13 @@ function partTex(group) {
|
|
|
8631
8631
|
const base = Math.min(...g.filter((i) => i.fontSize >= size * SCRIPT_SIZE_RATIO).map((i) => i.y));
|
|
8632
8632
|
let s = "", run = "";
|
|
8633
8633
|
const flush = () => {
|
|
8634
|
-
if (run) s +=
|
|
8634
|
+
if (run) s += _chunk6FRVF6TGcjs.toTex.call(void 0, run);
|
|
8635
8635
|
run = "";
|
|
8636
8636
|
};
|
|
8637
8637
|
g.forEach((it, k) => {
|
|
8638
8638
|
if (it.fontSize < size * SCRIPT_SIZE_RATIO && it.y - base >= size * SCRIPT_RISE_EM) {
|
|
8639
8639
|
flush();
|
|
8640
|
-
s += `^{${
|
|
8640
|
+
s += `^{${_chunk6FRVF6TGcjs.toTex.call(void 0, it.text)}}`;
|
|
8641
8641
|
return;
|
|
8642
8642
|
}
|
|
8643
8643
|
if (k && it.x - (g[k - 1].x + g[k - 1].w) > spaceGapThreshold(it.fontSize)) run += " ";
|
|
@@ -8810,7 +8810,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
8810
8810
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
8811
8811
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
8812
8812
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
8813
|
-
for (const cell of cells[0])
|
|
8813
|
+
for (const cell of cells[0]) _chunk6FRVF6TGcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
8814
8814
|
for (const item of line) usedItems.add(item);
|
|
8815
8815
|
}
|
|
8816
8816
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -9392,7 +9392,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
9392
9392
|
const [label, spacer, title] = cells;
|
|
9393
9393
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
9394
9394
|
if (cells.some((c) => {
|
|
9395
|
-
const e =
|
|
9395
|
+
const e = _chunk6FRVF6TGcjs.CELL_EDGES.get(c);
|
|
9396
9396
|
return !e || e.t || e.b || e.l || e.r;
|
|
9397
9397
|
})) return;
|
|
9398
9398
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _378 => _378.fontSize]), () => ( 0));
|
|
@@ -9740,6 +9740,13 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9740
9740
|
for (const cell of cells) {
|
|
9741
9741
|
const cellItems = cellTextMap.get(cell) || [];
|
|
9742
9742
|
const nested = pendingNested.length ? takePendingNested(pendingNested, cell.bbox, !!grid.cells) : [];
|
|
9743
|
+
const lone = nested.length === 1 && !cellItems.length ? nested[0] : null;
|
|
9744
|
+
const cw = cell.bbox.x2 - cell.bbox.x1;
|
|
9745
|
+
if (_optionalChain([lone, 'optionalAccess', _388 => _388.table]) && lone.bbox && lone.table.rows === 1 && lone.table.cols === 1 && CLIP_TABLES.has(lone.table) && !_optionalChain([lone, 'access', _389 => _389.table, 'access', _390 => _390.cells, 'access', _391 => _391[0], 'access', _392 => _392[0], 'access', _393 => _393.blocks, 'optionalAccess', _394 => _394.some, 'call', _395 => _395((b2) => b2.type === "table")]) && lone.bbox.width >= cw * 0.9 && /^[^\n]{1,30}$/.test(lone.table.cells[0][0].text.trim())) {
|
|
9746
|
+
irGrid[cell.row][cell.col] = { text: lone.table.cells[0][0].text, colSpan: cell.colSpan, rowSpan: cell.rowSpan };
|
|
9747
|
+
takeClipCellEdges(cell, irGrid[cell.row][cell.col]);
|
|
9748
|
+
continue;
|
|
9749
|
+
}
|
|
9743
9750
|
if (nested.length > 0) {
|
|
9744
9751
|
nestedAttached = true;
|
|
9745
9752
|
const built = buildFrameCellBlocks(cellItems, nested, pageNum, lex);
|
|
@@ -9793,14 +9800,14 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9793
9800
|
if (!assignedItems.has(textItems[ti])) usedItems.delete(owners[ti]);
|
|
9794
9801
|
}
|
|
9795
9802
|
}
|
|
9796
|
-
if (unitLine.length > 0 && rebuiltUsed && !/^\s*\(\s*단위\s*[::]/.test(_nullishCoalesce(_optionalChain([finalGrid, 'access',
|
|
9803
|
+
if (unitLine.length > 0 && rebuiltUsed && !/^\s*\(\s*단위\s*[::]/.test(_nullishCoalesce(_optionalChain([finalGrid, 'access', _396 => _396[0], 'optionalAccess', _397 => _397[0], 'optionalAccess', _398 => _398.text]), () => ( "")))) {
|
|
9797
9804
|
prependUnitRow(finalGrid, numCols, unitLine, usedItems);
|
|
9798
9805
|
finalRows++;
|
|
9799
9806
|
}
|
|
9800
9807
|
if (!rebuiltUsed && attachUnitRow(items, grid, finalGrid, numCols, usedItems)) finalRows++;
|
|
9801
9808
|
let semanticOneColumn = false;
|
|
9802
9809
|
if (!grid.cells && !nestedAttached && numCols === 1 && numGridRows >= 2) {
|
|
9803
|
-
const populatedRows = finalGrid.filter((row) => _optionalChain([row, 'access',
|
|
9810
|
+
const populatedRows = finalGrid.filter((row) => _optionalChain([row, 'access', _399 => _399[0], 'optionalAccess', _400 => _400.text, 'access', _401 => _401.trim, 'call', _402 => _402()]));
|
|
9804
9811
|
if (populatedRows.length >= 4) {
|
|
9805
9812
|
const fontSizes = tableItems.map((item) => item.fontSize).filter((size) => size > 0).sort((a, b) => a - b);
|
|
9806
9813
|
const medianFont = _nullishCoalesce(fontSizes[Math.floor(fontSizes.length / 2)], () => ( 0));
|
|
@@ -9896,7 +9903,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9896
9903
|
height: grid.bbox.y2 - grid.bbox.y1
|
|
9897
9904
|
};
|
|
9898
9905
|
if (numRows === 1 && numCols === 1 && gridW < pageWidth * 0.35) {
|
|
9899
|
-
const prose = _nullishCoalesce(_optionalChain([finalGrid, 'access',
|
|
9906
|
+
const prose = _nullishCoalesce(_optionalChain([finalGrid, 'access', _403 => _403[0], 'optionalAccess', _404 => _404[0], 'optionalAccess', _405 => _405.text]), () => ( ""));
|
|
9900
9907
|
const besideLines = (side) => new Set(side.map((it) => Math.round(it.y / 3))).size;
|
|
9901
9908
|
const rightLines = items.filter((it) => it.x >= grid.bbox.x2 + 3 && it.y >= grid.bbox.y1 && it.y <= grid.bbox.y2);
|
|
9902
9909
|
const leftLines = items.filter((it) => it.x + it.w <= grid.bbox.x1 - 3 && it.y >= grid.bbox.y1 && it.y <= grid.bbox.y2);
|
|
@@ -9915,8 +9922,8 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9915
9922
|
}
|
|
9916
9923
|
}
|
|
9917
9924
|
if (!grid.cells && !nestedAttached && shouldDemoteTable(irTable)) {
|
|
9918
|
-
const paragraphs = numRows === 1 && numCols === 1 ? _optionalChain([irTable, 'access',
|
|
9919
|
-
if (_optionalChain([paragraphs, 'optionalAccess',
|
|
9925
|
+
const paragraphs = numRows === 1 && numCols === 1 ? _optionalChain([irTable, 'access', _406 => _406.cells, 'access', _407 => _407[0], 'optionalAccess', _408 => _408[0], 'optionalAccess', _409 => _409.blocks]) : void 0;
|
|
9926
|
+
if (_optionalChain([paragraphs, 'optionalAccess', _410 => _410.length])) {
|
|
9920
9927
|
blocks.push(...paragraphs);
|
|
9921
9928
|
frameParagraphUnits.push(paragraphs);
|
|
9922
9929
|
recordFrameReadingUnit(paragraphs, tableBbox);
|
|
@@ -9963,7 +9970,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9963
9970
|
const clusterResults = (proseColumns ? [] : detectClusterTables(clusterItems, pageNum, void 0, lex)).filter((cr) => {
|
|
9964
9971
|
const b = cr.bbox;
|
|
9965
9972
|
const overlapX = (x) => Math.min(x.x + x.width, b.x + b.width) - Math.max(x.x, b.x);
|
|
9966
|
-
return !blocks.some((x) => x.bbox && x.bbox.y >= b.y - 2 && x.bbox.y + x.bbox.height <= b.y + b.height + 2 && (x.type === "paragraph" ? (_nullishCoalesce(_optionalChain([x, 'access',
|
|
9973
|
+
return !blocks.some((x) => x.bbox && x.bbox.y >= b.y - 2 && x.bbox.y + x.bbox.height <= b.y + b.height + 2 && (x.type === "paragraph" ? (_nullishCoalesce(_optionalChain([x, 'access', _411 => _411.text, 'optionalAccess', _412 => _412.match, 'call', _413 => _413(/\p{L}/gu), 'optionalAccess', _414 => _414.length]), () => ( 0))) >= 10 && overlapX(x.bbox) >= 0.8 * b.width : x.type === "table" && !ocrPage && _optionalChain([x, 'access', _415 => _415.table, 'optionalAccess', _416 => _416.cols]) === cr.table.cols && overlapX(x.bbox) >= 0.5 * Math.min(x.bbox.width, b.width)));
|
|
9967
9974
|
});
|
|
9968
9975
|
if (clusterResults.length > 0) {
|
|
9969
9976
|
const ciToIdx = /* @__PURE__ */ new Map();
|
|
@@ -10000,7 +10007,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10000
10007
|
groupSizes.push(1);
|
|
10001
10008
|
}
|
|
10002
10009
|
const allY = remaining.map((i) => i.y);
|
|
10003
|
-
const pageH =
|
|
10010
|
+
const pageH = _chunkY62EQKFEcjs.safeMax.call(void 0, allY) - _chunkY62EQKFEcjs.safeMin.call(void 0, allY);
|
|
10004
10011
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
10005
10012
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
10006
10013
|
const textBlocks = [];
|
|
@@ -10016,7 +10023,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10016
10023
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
10017
10024
|
} else {
|
|
10018
10025
|
const allY = remaining.map((i) => i.y);
|
|
10019
|
-
const pageH =
|
|
10026
|
+
const pageH = _chunkY62EQKFEcjs.safeMax.call(void 0, allY) - _chunkY62EQKFEcjs.safeMin.call(void 0, allY);
|
|
10020
10027
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
10021
10028
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
10022
10029
|
const textBlocks = [];
|
|
@@ -10348,7 +10355,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
10348
10355
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
10349
10356
|
} else {
|
|
10350
10357
|
const allY = items.map((i) => i.y);
|
|
10351
|
-
const pageHeight =
|
|
10358
|
+
const pageHeight = _chunkY62EQKFEcjs.safeMax.call(void 0, allY) - _chunkY62EQKFEcjs.safeMin.call(void 0, allY);
|
|
10352
10359
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
10353
10360
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
10354
10361
|
for (const group of orderedGroups) {
|
|
@@ -10380,19 +10387,19 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
|
|
|
10380
10387
|
const overlapH = Math.max(0, Math.min(b.y + b.height, region.y2) - Math.max(b.y, region.y1));
|
|
10381
10388
|
return overlapW * overlapH >= b.width * b.height * 0.8;
|
|
10382
10389
|
});
|
|
10383
|
-
const labels = candidates.filter((b) => b.type === "paragraph" && b.bbox.height <= 24 && (_nullishCoalesce(_optionalChain([b, 'access',
|
|
10390
|
+
const labels = candidates.filter((b) => b.type === "paragraph" && b.bbox.height <= 24 && (_nullishCoalesce(_optionalChain([b, 'access', _417 => _417.text, 'optionalAccess', _418 => _418.match, 'call', _419 => _419(/[\p{L}\p{N}]/gu), 'optionalAccess', _420 => _420.length]), () => ( 0))) >= 2);
|
|
10384
10391
|
const axisFragments = rotatedAxisFragments(candidates);
|
|
10385
10392
|
const accepted = candidates.filter((b) => {
|
|
10386
|
-
if (b.type === "paragraph") return (_nullishCoalesce(_optionalChain([b, 'access',
|
|
10393
|
+
if (b.type === "paragraph") return (_nullishCoalesce(_optionalChain([b, 'access', _421 => _421.text, 'optionalAccess', _422 => _422.match, 'call', _423 => _423(/[\p{L}\p{N}]/gu), 'optionalAccess', _424 => _424.length]), () => ( 0))) >= 2 || !axisFragments.has(b) && (supportedDiagramLabel(b, labels, region) || axisTick(b, candidates));
|
|
10387
10394
|
const t = b.table;
|
|
10388
10395
|
if (b.type !== "table" || !t || UNRULED_REGION_TABLES.has(b)) return false;
|
|
10389
10396
|
const lone = t.cells.filter((row) => row.filter((c) => c.text.trim()).length === 1 && row.some((c) => c.colSpan === t.cols)).length;
|
|
10390
10397
|
if (t.rows >= 2 && lone * 2 >= t.rows) return false;
|
|
10391
10398
|
if (t.rows === 1 && t.cols === 1) {
|
|
10392
|
-
const text = _nullishCoalesce(_optionalChain([t, 'access',
|
|
10393
|
-
return (_nullishCoalesce(_optionalChain([text, 'access',
|
|
10399
|
+
const text = _nullishCoalesce(_optionalChain([t, 'access', _425 => _425.cells, 'access', _426 => _426[0], 'optionalAccess', _427 => _427[0], 'optionalAccess', _428 => _428.text]), () => ( ""));
|
|
10400
|
+
return (_nullishCoalesce(_optionalChain([text, 'access', _429 => _429.match, 'call', _430 => _430(/\n/g), 'optionalAccess', _431 => _431.length]), () => ( 0))) >= 5 && (_nullishCoalesce(_optionalChain([text, 'access', _432 => _432.match, 'call', _433 => _433(/\d/g), 'optionalAccess', _434 => _434.length]), () => ( 0))) >= text.length * 0.25;
|
|
10394
10401
|
}
|
|
10395
|
-
const headerLabels = _nullishCoalesce(_optionalChain([t, 'access',
|
|
10402
|
+
const headerLabels = _nullishCoalesce(_optionalChain([t, 'access', _435 => _435.cells, 'access', _436 => _436[0], 'optionalAccess', _437 => _437.filter, 'call', _438 => _438((c) => c.text.replace(/[^A-Za-z가-힣]/g, "").length >= 2), 'access', _439 => _439.length]), () => ( 0));
|
|
10396
10403
|
return t.rows >= 2 && t.cols >= 2 && headerLabels >= t.cols * 0.75 && t.cells.slice(1).some((row) => row.filter((c) => c.text.trim()).length >= 2);
|
|
10397
10404
|
});
|
|
10398
10405
|
const selected = candidates.flatMap((b) => accepted.includes(b) ? [b] : b.type === "table" && b.table ? rowParagraphs(b).filter((p) => /[\p{L}\p{N}]{2}/u.test(_nullishCoalesce(p.text, () => ( "")))) : []);
|
|
@@ -10409,14 +10416,14 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
|
|
|
10409
10416
|
for (const block of selected) {
|
|
10410
10417
|
if (seen2.has(block)) continue;
|
|
10411
10418
|
const frame = FRAME_READING_UNITS.get(block);
|
|
10412
|
-
const source = _optionalChain([frame, 'optionalAccess',
|
|
10419
|
+
const source = _optionalChain([frame, 'optionalAccess', _440 => _440.blocks, 'access', _441 => _441.every, 'call', _442 => _442((member) => selectedSet.has(member))]) ? frame.blocks : [block];
|
|
10413
10420
|
source.forEach((member) => seen2.add(member));
|
|
10414
10421
|
const available = source.filter((member) => !hasOriginal(member));
|
|
10415
10422
|
const units = frame && available.length === source.length && source === frame.blocks ? [{ blocks: available, bbox: frame.bbox, atomic: true }] : available.map((member) => ({ blocks: [member], bbox: member.bbox, atomic: false }));
|
|
10416
10423
|
for (const unit of units) {
|
|
10417
10424
|
const b = unit.bbox;
|
|
10418
10425
|
const index = blocks.findIndex((existing) => {
|
|
10419
|
-
const e = _nullishCoalesce(_optionalChain([FRAME_READING_UNITS, 'access',
|
|
10426
|
+
const e = _nullishCoalesce(_optionalChain([FRAME_READING_UNITS, 'access', _443 => _443.get, 'call', _444 => _444(existing), 'optionalAccess', _445 => _445.bbox]), () => ( existing.bbox));
|
|
10420
10427
|
if (existing.pageNumber !== page || !e) return false;
|
|
10421
10428
|
const beside = e.y < region.y2 && e.y + e.height > region.y1 && e.x >= region.x2 - 1;
|
|
10422
10429
|
if (placedHere.has(existing) && Math.abs(e.y + e.height / 2 - b.y - b.height / 2) <= Math.min(e.height, b.height) * 0.25) return e.x > b.x;
|
|
@@ -10434,16 +10441,16 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
|
|
|
10434
10441
|
}
|
|
10435
10442
|
function axisTick(block, candidates) {
|
|
10436
10443
|
const b = block.bbox;
|
|
10437
|
-
if (!/^\d$/u.test(_nullishCoalesce(_optionalChain([block, 'access',
|
|
10438
|
-
const numeric = candidates.filter((o) => o !== block && o.type === "paragraph" && o.bbox && /^[\d\s.,%+−-]+$/u.test(_nullishCoalesce(_optionalChain([o, 'access',
|
|
10444
|
+
if (!/^\d$/u.test(_nullishCoalesce(_optionalChain([block, 'access', _446 => _446.text, 'optionalAccess', _447 => _447.trim, 'call', _448 => _448()]), () => ( "")))) return false;
|
|
10445
|
+
const numeric = candidates.filter((o) => o !== block && o.type === "paragraph" && o.bbox && /^[\d\s.,%+−-]+$/u.test(_nullishCoalesce(_optionalChain([o, 'access', _449 => _449.text, 'optionalAccess', _450 => _450.trim, 'call', _451 => _451()]), () => ( ""))) && /\d/u.test(_nullishCoalesce(o.text, () => ( ""))) && Math.max(o.bbox.height, b.height) <= Math.min(o.bbox.height, b.height) * 2);
|
|
10439
10446
|
const cy = b.y + b.height / 2, right = b.x + b.width;
|
|
10440
10447
|
const row = numeric.filter((o) => Math.abs(o.bbox.y + o.bbox.height / 2 - cy) <= Math.min(o.bbox.height, b.height) * 0.35);
|
|
10441
10448
|
const column = numeric.filter((o) => Math.abs(o.bbox.x + o.bbox.width - right) <= Math.max(o.bbox.height, b.height) * 0.5);
|
|
10442
10449
|
return row.length >= 2 || column.length >= 2;
|
|
10443
10450
|
}
|
|
10444
10451
|
function supportedDiagramLabel(block, labels, region) {
|
|
10445
|
-
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access',
|
|
10446
|
-
if (!b || !/^[\p{L}\p{N}]$/u.test(text) || b.height < 4 || b.width < 1 || b.width > b.height * 2 || b.x < region.x1 || b.y < region.y1 || b.x + b.width > region.x2 || b.y + b.height > region.y2 || b.width * b.height > (region.x2 - region.x1) * (region.y2 - region.y1) * 5e-3 || labels.length < 3 || !labels.some((l) => /\p{L}{3}/u.test(_nullishCoalesce(l.text, () => ( "")))) || labels.filter((l) => !/\p{L}/u.test(_nullishCoalesce(l.text, () => ( ""))) && (_nullishCoalesce(_optionalChain([l, 'access',
|
|
10452
|
+
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access', _452 => _452.text, 'optionalAccess', _453 => _453.trim, 'call', _454 => _454()]), () => ( ""));
|
|
10453
|
+
if (!b || !/^[\p{L}\p{N}]$/u.test(text) || b.height < 4 || b.width < 1 || b.width > b.height * 2 || b.x < region.x1 || b.y < region.y1 || b.x + b.width > region.x2 || b.y + b.height > region.y2 || b.width * b.height > (region.x2 - region.x1) * (region.y2 - region.y1) * 5e-3 || labels.length < 3 || !labels.some((l) => /\p{L}{3}/u.test(_nullishCoalesce(l.text, () => ( "")))) || labels.filter((l) => !/\p{L}/u.test(_nullishCoalesce(l.text, () => ( ""))) && (_nullishCoalesce(_optionalChain([l, 'access', _455 => _455.text, 'optionalAccess', _456 => _456.match, 'call', _457 => _457(/\p{N}/gu), 'optionalAccess', _458 => _458.length]), () => ( 0))) >= 2).length < 2) return false;
|
|
10447
10454
|
let above = false, below = false;
|
|
10448
10455
|
for (const label of labels) {
|
|
10449
10456
|
const a = label.bbox, em = Math.max(b.height, a.height);
|
|
@@ -10458,7 +10465,7 @@ function rotatedAxisFragments(candidates) {
|
|
|
10458
10465
|
const paragraphs = candidates.filter((b) => b.type === "paragraph" && b.bbox.height <= 24);
|
|
10459
10466
|
const axes = [];
|
|
10460
10467
|
for (const block of paragraphs) {
|
|
10461
|
-
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access',
|
|
10468
|
+
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access', _459 => _459.text, 'optionalAccess', _460 => _460.trim, 'call', _461 => _461()]), () => ( ""));
|
|
10462
10469
|
if (!/^[\d\s.,%+−-]+$/u.test(text) || !/\d/u.test(text) || b.width > b.height * 6) continue;
|
|
10463
10470
|
const axis = axes.find((a) => Math.abs(a[0].bbox.x + a[0].bbox.width - b.x - b.width) <= Math.max(a[0].bbox.height, b.height) * 0.5);
|
|
10464
10471
|
if (axis) axis.push(block);
|
|
@@ -10475,8 +10482,8 @@ function rotatedAxisFragments(candidates) {
|
|
|
10475
10482
|
const em = Math.max(...axis.map((a) => a.bbox.height)), right = axis[0].bbox.x + axis[0].bbox.width;
|
|
10476
10483
|
if (top - bottom < em * 6) continue;
|
|
10477
10484
|
const left = paragraphs.filter((block) => {
|
|
10478
|
-
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access',
|
|
10479
|
-
return /\p{Script=Latin}/u.test(text) && (_nullishCoalesce(_optionalChain([text, 'access',
|
|
10485
|
+
const b = block.bbox, text = _nullishCoalesce(_optionalChain([block, 'access', _462 => _462.text, 'optionalAccess', _463 => _463.trim, 'call', _464 => _464()]), () => ( ""));
|
|
10486
|
+
return /\p{Script=Latin}/u.test(text) && (_nullishCoalesce(_optionalChain([text, 'access', _465 => _465.match, 'call', _466 => _466(/[\p{L}\p{N}]/gu), 'optionalAccess', _467 => _467.length]), () => ( 0))) <= 3 && b.width <= b.height * 3 && b.x + b.width >= right - em * 6 && b.x + b.width <= right - Math.max(em, b.height) && b.y >= bottom && b.y + b.height <= top;
|
|
10480
10487
|
});
|
|
10481
10488
|
const stack = left.filter((a) => left.some((b) => {
|
|
10482
10489
|
if (a === b || !aligned(a, b)) return false;
|
|
@@ -10486,7 +10493,7 @@ function rotatedAxisFragments(candidates) {
|
|
|
10486
10493
|
if (stack.length < 2) continue;
|
|
10487
10494
|
for (const block of paragraphs) {
|
|
10488
10495
|
const b = block.bbox;
|
|
10489
|
-
if (b.y >= bottom && b.y + b.height <= top && b.x + b.width >= right - em * 6 && b.x + b.width <= right - Math.max(em, b.height) && /^[\p{L}\p{N}]$/u.test(_nullishCoalesce(_optionalChain([block, 'access',
|
|
10496
|
+
if (b.y >= bottom && b.y + b.height <= top && b.x + b.width >= right - em * 6 && b.x + b.width <= right - Math.max(em, b.height) && /^[\p{L}\p{N}]$/u.test(_nullishCoalesce(_optionalChain([block, 'access', _468 => _468.text, 'optionalAccess', _469 => _469.trim, 'call', _470 => _470()]), () => ( ""))) && stack.some((s) => aligned(s, block))) fragments.add(block);
|
|
10490
10497
|
}
|
|
10491
10498
|
}
|
|
10492
10499
|
return fragments;
|
|
@@ -10590,4 +10597,4 @@ function rowParagraphs(block) {
|
|
|
10590
10597
|
|
|
10591
10598
|
|
|
10592
10599
|
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.grayCrop = grayCrop; exports.inkStats = inkStats; exports.splitRowBands = splitRowBands; exports.leadingTriangle = leadingTriangle; exports.arrowGlyph = arrowGlyph; exports.leaderRuns = leaderRuns; exports.inkBounds = inkBounds; exports.bracketFeatures = bracketFeatures; exports.slantedPair = slantedPair; exports.romanStems = romanStems; exports.circledAt = circledAt; exports.quoteHead = quoteHead; exports.edgeTrim = edgeTrim; exports.tallInkCount = tallInkCount; exports.gapGlyphs = gapGlyphs; exports.ringBullet = ringBullet; exports.dashRatio = dashRatio; exports.leadingRing = leadingRing; exports.discAt = discAt; exports.serifOne = serifOne; exports.starRun = starRun; exports.bracketShape = bracketShape; exports.leadingBullet = leadingBullet; exports.rememberOcrTextGaps = rememberOcrTextGaps; exports.copyOcrTextGaps = copyOcrTextGaps; exports.findOcrTextGaps = findOcrTextGaps; 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;
|
|
10593
|
-
//# sourceMappingURL=chunk-
|
|
10600
|
+
//# sourceMappingURL=chunk-2OAYTOGK.cjs.map
|