kordoc 4.24.37 → 4.24.39
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 +4 -4
- package/dist/{-HX3RWDQF.js → -7VE547IT.js} +60 -60
- package/dist/{chunk-4MWGWS3B.js → chunk-2XXTL4S4.js} +2 -2
- package/dist/{chunk-J26TNCL7.js → chunk-346W5O2J.js} +2 -2
- package/dist/{chunk-LM7LYH54.js → chunk-3MHRL3OO.js} +2 -2
- package/dist/{chunk-TQBNSAAS.js → chunk-4FWLCWNU.js} +2 -2
- package/dist/{chunk-6QK6ZQTF.js → chunk-7AYP2XO6.js} +3 -3
- package/dist/{chunk-YNIZLSM4.js → chunk-7BQWFZJO.js} +8 -8
- package/dist/{chunk-OTB6UOIB.js → chunk-7ZRUR4TZ.js} +2 -2
- package/dist/{chunk-IWCWO3GP.js → chunk-BWBR5GWQ.js} +2 -2
- package/dist/{chunk-P3SZJJRK.js → chunk-COH7WXBK.js} +7 -7
- package/dist/{chunk-524MGRNW.js → chunk-CS76UPUC.js} +125 -21
- package/dist/chunk-CS76UPUC.js.map +1 -0
- package/dist/{chunk-LWSMZJLR.js → chunk-F2JYJ2SP.js} +2 -2
- package/dist/{chunk-MTSWWXSB.js → chunk-FRMJTW3C.js} +2 -2
- package/dist/{chunk-JRVZBYQ2.js → chunk-FZMZUX7B.js} +130 -21
- package/dist/chunk-FZMZUX7B.js.map +1 -0
- package/dist/{chunk-J42O5KBX.js → chunk-GXED6LJX.js} +2 -2
- package/dist/{chunk-E527FG6I.cjs → chunk-IM5SIGUN.cjs} +3 -3
- package/dist/{chunk-E527FG6I.cjs.map → chunk-IM5SIGUN.cjs.map} +1 -1
- package/dist/{chunk-RR2FKPFN.js → chunk-IZWZ3RQC.js} +2 -2
- package/dist/{chunk-RR2FKPFN.js.map → chunk-IZWZ3RQC.js.map} +1 -1
- package/dist/{chunk-BT5RPLV4.js → chunk-L23XOAKF.js} +19 -19
- package/dist/{chunk-WZUTLJP2.cjs → chunk-LE3733C2.cjs} +212 -108
- package/dist/chunk-LE3733C2.cjs.map +1 -0
- package/dist/{chunk-2LDFUVVF.js → chunk-LOJYJISM.js} +16 -7
- package/dist/chunk-LOJYJISM.js.map +1 -0
- package/dist/{chunk-KGX4TLBX.cjs → chunk-LU7X6LLW.cjs} +3 -3
- package/dist/{chunk-KGX4TLBX.cjs.map → chunk-LU7X6LLW.cjs.map} +1 -1
- package/dist/{chunk-DRDW5ULI.js → chunk-M2ZRTYQ5.js} +14 -14
- package/dist/{chunk-QWYIYVIZ.cjs → chunk-MANE7HAZ.cjs} +2 -2
- package/dist/{chunk-QWYIYVIZ.cjs.map → chunk-MANE7HAZ.cjs.map} +1 -1
- package/dist/{chunk-XCMDIXWE.js → chunk-NL5OTD2E.js} +32 -32
- package/dist/{chunk-ONCXLQV4.js → chunk-NQJL3664.js} +3 -3
- package/dist/{chunk-KFJKRST5.js → chunk-PFHMNNW7.js} +126 -17
- package/dist/chunk-PFHMNNW7.js.map +1 -0
- package/dist/{chunk-OHLJEWS6.js → chunk-PHVAJBHM.js} +2 -2
- package/dist/{chunk-7GN7O3K2.js → chunk-PQIIYKNL.js} +51 -51
- package/dist/{chunk-T7K3CLXM.js → chunk-QDPYTJ4Y.js} +2 -2
- package/dist/{chunk-7MGZWDO4.js → chunk-QDQPAC4L.js} +2 -2
- package/dist/{chunk-7MGZWDO4.js.map → chunk-QDQPAC4L.js.map} +1 -1
- package/dist/{chunk-LG4SU2D4.cjs → chunk-RJNHXCMP.cjs} +69 -60
- package/dist/chunk-RJNHXCMP.cjs.map +1 -0
- package/dist/{chunk-33BKUIIC.js → chunk-RPAEXGWZ.js} +2 -2
- package/dist/{chunk-VRCXXZHT.js → chunk-SFLHCRO6.js} +2 -2
- package/dist/{chunk-GCFG67SF.js → chunk-U5OV6D66.js} +50 -50
- package/dist/{chunk-RBCDHT55.cjs → chunk-UKTRLJII.cjs} +98 -98
- package/dist/{chunk-RBCDHT55.cjs.map → chunk-UKTRLJII.cjs.map} +1 -1
- package/dist/{chunk-BYOAA442.js → chunk-V2RIY72D.js} +2 -2
- package/dist/{chunk-EJKCEP3Q.cjs → chunk-V3IMDOZE.cjs} +6 -6
- package/dist/{chunk-EJKCEP3Q.cjs.map → chunk-V3IMDOZE.cjs.map} +1 -1
- package/dist/{chunk-4OWD6WRS.js → chunk-WPIG3KUV.js} +121 -17
- package/dist/chunk-WPIG3KUV.js.map +1 -0
- package/dist/{chunk-6XOJ6CEK.js → chunk-WVER4OWF.js} +3 -3
- package/dist/{chunk-IOABX3GR.cjs → chunk-XYVTCXAG.cjs} +265 -156
- package/dist/chunk-XYVTCXAG.cjs.map +1 -0
- package/dist/{chunk-6SVVVZLV.js → chunk-Y5O4DS56.js} +2 -2
- package/dist/{chunk-UMQADPM5.js → chunk-YXKU6UJD.js} +2 -2
- package/dist/{chunk-B2VRTOQZ.js → chunk-ZDMLZRS4.js} +18 -9
- package/dist/chunk-ZDMLZRS4.js.map +1 -0
- package/dist/{chunk-64MVXWS5.js → chunk-ZVAX6E63.js} +2 -2
- package/dist/chunks-WTYZ4KG2.js +11 -0
- package/dist/cli.js +61 -60
- package/dist/cli.js.map +1 -1
- package/dist/{formula-DLZUYM6F.js → formula-MMLDES2Z.js} +20 -17
- package/dist/{formula-DLZUYM6F.js.map → formula-MMLDES2Z.js.map} +1 -1
- package/dist/{formula-2MQWKUKR.js → formula-PFSZZNPP.js} +19 -16
- package/dist/{formula-2MQWKUKR.js.map → formula-PFSZZNPP.js.map} +1 -1
- package/dist/{formula-T2YY77JT.cjs → formula-UI2UR74M.cjs} +25 -22
- package/dist/formula-UI2UR74M.cjs.map +1 -0
- package/dist/generator-C3SCP3ZG.js +10 -0
- package/dist/generator-CHBOCLYX.cjs +11 -0
- package/dist/{generator-YBWCA6B5.cjs.map → generator-CHBOCLYX.cjs.map} +1 -1
- package/dist/generator-RTSNDZJB.js +17 -0
- package/dist/hancom-3V3USCW5.js +84 -0
- package/dist/hancom-3V3USCW5.js.map +1 -0
- package/dist/hancom-GV5TTF5H.cjs +85 -0
- package/dist/hancom-GV5TTF5H.cjs.map +1 -0
- package/dist/hancom-XO52GNC3.js +85 -0
- package/dist/hancom-XO52GNC3.js.map +1 -0
- package/dist/image-ocr-2WKCFABH.cjs +211 -0
- package/dist/image-ocr-2WKCFABH.cjs.map +1 -0
- package/dist/{image-ocr-3NF3QJM7.js → image-ocr-R2ASFKHX.js} +99 -15
- package/dist/image-ocr-R2ASFKHX.js.map +1 -0
- package/dist/{image-ocr-XRKFK7AA.js → image-ocr-SU4RPHBF.js} +94 -10
- package/dist/image-ocr-SU4RPHBF.js.map +1 -0
- package/dist/index.cjs +1110 -1110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +70 -70
- package/dist/mcp.js +57 -56
- package/dist/mcp.js.map +1 -1
- package/dist/memo-U4RZJRU2.js +17 -0
- package/dist/{model-bundle-MO5I26AO.js → model-bundle-JMSH2F4A.js} +5 -5
- package/dist/{models-IIP4GZ57.js → models-D5SATVOZ.js} +5 -5
- package/dist/{parse-worker-v2-GWOL3TTO.js → parse-worker-v2-WIIZQFRX.js} +28 -28
- package/dist/{parser-UCLUVQPA.js → parser-KCY43TBS.js} +16 -16
- package/dist/{parser-R6UJQ6CV.cjs → parser-MFBTEGJA.cjs} +162 -162
- package/dist/{parser-R6UJQ6CV.cjs.map → parser-MFBTEGJA.cjs.map} +1 -1
- package/dist/{parser-DJQFM6VE.js → parser-SBJKV5GS.js} +16 -16
- package/dist/{pdf-ocr-EWXGN4JB.js → pdf-ocr-I6GNQEFS.js} +8 -6
- package/dist/pdf-ocr-L2O4SQUK.cjs +40 -0
- package/dist/pdf-ocr-L2O4SQUK.cjs.map +1 -0
- package/dist/{pdf-ocr-7PSNKQOI.js → pdf-ocr-UU5PSZ7Z.js} +12 -10
- package/dist/{profile-io-NUU3VKNW.js → profile-io-HZK4ZZ2O.js} +3 -3
- package/dist/{rasterize-RARCMBJ3.js → rasterize-VNP4ULXM.js} +3 -3
- package/dist/{redact-doc-JKGDXGNJ.js → redact-doc-SPHSBCPN.js} +37 -37
- package/dist/{render-SGLKO3PG.js → render-CKTTIDU2.js} +14 -14
- package/dist/{rewrite-fallback-7YZXSR5K.js → rewrite-fallback-H2KMJV6G.js} +21 -21
- package/dist/seal-MSY5G3UR.js +16 -0
- package/dist/{setup-5IYW4FZ7.js → setup-GJVOXJN7.js} +3 -3
- package/dist/{to-hwpx-QMANIAWY.js → to-hwpx-5UIBNW3D.js} +9 -9
- package/dist/to-hwpx-6BQNMA6P.cjs +16 -0
- package/dist/{to-hwpx-DEBHREDM.cjs.map → to-hwpx-6BQNMA6P.cjs.map} +1 -1
- package/dist/{to-hwpx-4PM6XV2L.js → to-hwpx-JJHDCYER.js} +4 -4
- package/dist/visual-Q6PIMKSA.js +37 -0
- package/dist/{watch-YZS76EOS.js → watch-YZZES36Q.js} +27 -27
- package/package.json +1 -1
- package/dist/chunk-2LDFUVVF.js.map +0 -1
- package/dist/chunk-4OWD6WRS.js.map +0 -1
- package/dist/chunk-524MGRNW.js.map +0 -1
- package/dist/chunk-B2VRTOQZ.js.map +0 -1
- package/dist/chunk-IOABX3GR.cjs.map +0 -1
- package/dist/chunk-JRVZBYQ2.js.map +0 -1
- package/dist/chunk-KFJKRST5.js.map +0 -1
- package/dist/chunk-LG4SU2D4.cjs.map +0 -1
- package/dist/chunk-WZUTLJP2.cjs.map +0 -1
- package/dist/chunks-NRA4GFK2.js +0 -11
- package/dist/formula-T2YY77JT.cjs.map +0 -1
- package/dist/generator-2WFWLJFG.js +0 -10
- package/dist/generator-5NWKWLOO.js +0 -17
- package/dist/generator-YBWCA6B5.cjs +0 -11
- package/dist/image-ocr-3NF3QJM7.js.map +0 -1
- package/dist/image-ocr-N7UKGSRY.cjs +0 -127
- package/dist/image-ocr-N7UKGSRY.cjs.map +0 -1
- package/dist/image-ocr-XRKFK7AA.js.map +0 -1
- package/dist/memo-XJ4NBV4J.js +0 -17
- package/dist/pdf-ocr-HECUBUMU.cjs +0 -38
- package/dist/pdf-ocr-HECUBUMU.cjs.map +0 -1
- package/dist/seal-LSS7WY6Z.js +0 -16
- package/dist/to-hwpx-DEBHREDM.cjs +0 -16
- package/dist/visual-QXYBJJ5D.js +0 -37
- /package/dist/{-HX3RWDQF.js.map → -7VE547IT.js.map} +0 -0
- /package/dist/{chunk-4MWGWS3B.js.map → chunk-2XXTL4S4.js.map} +0 -0
- /package/dist/{chunk-J26TNCL7.js.map → chunk-346W5O2J.js.map} +0 -0
- /package/dist/{chunk-LM7LYH54.js.map → chunk-3MHRL3OO.js.map} +0 -0
- /package/dist/{chunk-TQBNSAAS.js.map → chunk-4FWLCWNU.js.map} +0 -0
- /package/dist/{chunk-6QK6ZQTF.js.map → chunk-7AYP2XO6.js.map} +0 -0
- /package/dist/{chunk-YNIZLSM4.js.map → chunk-7BQWFZJO.js.map} +0 -0
- /package/dist/{chunk-OTB6UOIB.js.map → chunk-7ZRUR4TZ.js.map} +0 -0
- /package/dist/{chunk-IWCWO3GP.js.map → chunk-BWBR5GWQ.js.map} +0 -0
- /package/dist/{chunk-P3SZJJRK.js.map → chunk-COH7WXBK.js.map} +0 -0
- /package/dist/{chunk-LWSMZJLR.js.map → chunk-F2JYJ2SP.js.map} +0 -0
- /package/dist/{chunk-MTSWWXSB.js.map → chunk-FRMJTW3C.js.map} +0 -0
- /package/dist/{chunk-J42O5KBX.js.map → chunk-GXED6LJX.js.map} +0 -0
- /package/dist/{chunk-BT5RPLV4.js.map → chunk-L23XOAKF.js.map} +0 -0
- /package/dist/{chunk-DRDW5ULI.js.map → chunk-M2ZRTYQ5.js.map} +0 -0
- /package/dist/{chunk-XCMDIXWE.js.map → chunk-NL5OTD2E.js.map} +0 -0
- /package/dist/{chunk-ONCXLQV4.js.map → chunk-NQJL3664.js.map} +0 -0
- /package/dist/{chunk-OHLJEWS6.js.map → chunk-PHVAJBHM.js.map} +0 -0
- /package/dist/{chunk-7GN7O3K2.js.map → chunk-PQIIYKNL.js.map} +0 -0
- /package/dist/{chunk-T7K3CLXM.js.map → chunk-QDPYTJ4Y.js.map} +0 -0
- /package/dist/{chunk-33BKUIIC.js.map → chunk-RPAEXGWZ.js.map} +0 -0
- /package/dist/{chunk-VRCXXZHT.js.map → chunk-SFLHCRO6.js.map} +0 -0
- /package/dist/{chunk-GCFG67SF.js.map → chunk-U5OV6D66.js.map} +0 -0
- /package/dist/{chunk-BYOAA442.js.map → chunk-V2RIY72D.js.map} +0 -0
- /package/dist/{chunk-6XOJ6CEK.js.map → chunk-WVER4OWF.js.map} +0 -0
- /package/dist/{chunk-6SVVVZLV.js.map → chunk-Y5O4DS56.js.map} +0 -0
- /package/dist/{chunk-UMQADPM5.js.map → chunk-YXKU6UJD.js.map} +0 -0
- /package/dist/{chunk-64MVXWS5.js.map → chunk-ZVAX6E63.js.map} +0 -0
- /package/dist/{chunks-NRA4GFK2.js.map → chunks-WTYZ4KG2.js.map} +0 -0
- /package/dist/{generator-2WFWLJFG.js.map → generator-C3SCP3ZG.js.map} +0 -0
- /package/dist/{generator-5NWKWLOO.js.map → generator-RTSNDZJB.js.map} +0 -0
- /package/dist/{memo-XJ4NBV4J.js.map → memo-U4RZJRU2.js.map} +0 -0
- /package/dist/{model-bundle-MO5I26AO.js.map → model-bundle-JMSH2F4A.js.map} +0 -0
- /package/dist/{models-IIP4GZ57.js.map → models-D5SATVOZ.js.map} +0 -0
- /package/dist/{parse-worker-v2-GWOL3TTO.js.map → parse-worker-v2-WIIZQFRX.js.map} +0 -0
- /package/dist/{parser-UCLUVQPA.js.map → parser-KCY43TBS.js.map} +0 -0
- /package/dist/{parser-DJQFM6VE.js.map → parser-SBJKV5GS.js.map} +0 -0
- /package/dist/{pdf-ocr-7PSNKQOI.js.map → pdf-ocr-I6GNQEFS.js.map} +0 -0
- /package/dist/{pdf-ocr-EWXGN4JB.js.map → pdf-ocr-UU5PSZ7Z.js.map} +0 -0
- /package/dist/{profile-io-NUU3VKNW.js.map → profile-io-HZK4ZZ2O.js.map} +0 -0
- /package/dist/{rasterize-RARCMBJ3.js.map → rasterize-VNP4ULXM.js.map} +0 -0
- /package/dist/{redact-doc-JKGDXGNJ.js.map → redact-doc-SPHSBCPN.js.map} +0 -0
- /package/dist/{render-SGLKO3PG.js.map → render-CKTTIDU2.js.map} +0 -0
- /package/dist/{rewrite-fallback-7YZXSR5K.js.map → rewrite-fallback-H2KMJV6G.js.map} +0 -0
- /package/dist/{seal-LSS7WY6Z.js.map → seal-MSY5G3UR.js.map} +0 -0
- /package/dist/{setup-5IYW4FZ7.js.map → setup-GJVOXJN7.js.map} +0 -0
- /package/dist/{to-hwpx-4PM6XV2L.js.map → to-hwpx-5UIBNW3D.js.map} +0 -0
- /package/dist/{to-hwpx-QMANIAWY.js.map → to-hwpx-JJHDCYER.js.map} +0 -0
- /package/dist/{visual-QXYBJJ5D.js.map → visual-Q6PIMKSA.js.map} +0 -0
- /package/dist/{watch-YZS76EOS.js.map → watch-YZZES36Q.js.map} +0 -0
package/README.md
CHANGED
|
@@ -125,7 +125,7 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
125
125
|
| 법령 별표 | 272건 · 346표 | HWP **346/346**, PDF **343/346 · 99.13%** |
|
|
126
126
|
| PDF 전체 | 1,911문서 중 1,729건 채점 | 글 커버리지 **99.80%** |
|
|
127
127
|
| OCR | 53문서 · 102쪽 · 66표 | CER **0.0239** · 글자 재현율 **99.32%** · 표 구조 일치 **34/66** |
|
|
128
|
-
| KoOCR-Bench v2.0c (외부) | 공개 877쪽 (표·글·손글씨·순서) | 종합 기본값 **0.
|
|
128
|
+
| KoOCR-Bench v2.0c (외부) | 공개 877쪽 (표·글·손글씨·순서) | 종합 기본값 **0.830** · `ocrRec: "auto"` **0.851** · 제목 재현율 0.798 (4.24.39) |
|
|
129
129
|
| opendataloader-bench | PDF 200문서 | 종합 기본값 **0.964** · OCR 끔 **0.939** |
|
|
130
130
|
| HWPX 렌더 배치 | 한컴 PDF 짝 1,565문서(쪽 수 일치 1,508) · 글 조각 111,480 · 그림 4,300 | 글 위치(±1.5pt) **106,904 · 95.9%** · 그림 위치(±2pt) **4,213 · 98.0%** |
|
|
131
131
|
|
|
@@ -133,15 +133,15 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
133
133
|
|
|
134
134
|
## 최근 업데이트
|
|
135
135
|
|
|
136
|
-
최신 배포: **[4.24.
|
|
136
|
+
최신 배포: **[4.24.39](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.39)** · 2026-11-03
|
|
137
137
|
|
|
138
138
|
| 버전 | 주요 변경 | 수치 변화 |
|
|
139
139
|
| --- | --- | --- |
|
|
140
|
+
| 4.24.39 | OCR: 눕혀 찍은 가로 표 세우기 · 쪽 가운데 단 구분선·두 단 본문으로 두 단 가르기 · 열린 통계표 바깥 이름표 열 · 큰 숫자 표 행 펼치기(띠 밖 글 유실 막음) · 표 품은 쪽 테두리 틀 · 머리 여러 행 통계표 차트 오판 | KoOCR-Bench 종합 0.810 → **0.830**(`auto` **0.851**) · 시험지 CER .416 → .302 · 자체 벤치 문서별 하락 0 |
|
|
141
|
+
| 4.24.38 | OCR: 스캔·이미지 쪽 제목 판정(위아래로 쌓인 장 제목 잇기) · 작은 1칸 상자 쪽 두 단 읽기 순서 · 문장 조각 가짜 표 · 겹친 상자 이음매 글자 · 이미지 수식 OCR(`formulaOcr`) · to-hwpx 한/글 자체 저장 엔진(`--engine hancom`, 팝업 없이) | KoOCR-Bench 종합 0.807 → **0.810**(`auto` **0.831**) · 제목 재현율 0 → .798 · 자체 벤치 문서별 그대로 |
|
|
140
142
|
| 4.24.37 | OCR 표: 통계표 묶음 안 빈칸 열·괘선 없는 본문 행 펼치기·행 합침 아래 행 가르기·이웃 칸 값 몰림·음영 머리 띠와 칠한 첫 열 경계 · 머리 행 있는 표를 차트로 풀던 것 · 시험지 문항 상자 풀기 · `ocrRec: "auto"`(손글씨 쪽만 손글씨 모델) | KoOCR-Bench v2.0c 공개 877쪽 종합 0.742 → **0.807**(`ocrRec: "auto"` **0.828**) · 자체 벤치 문서별 그대로 |
|
|
141
143
|
| 4.24.36 | PDF 띄어쓰기(한컴 PDF): 자간 줄인 글의 낱말 공백 되살림 · 공백 글리프 위에 덧찍은 쉼표("55만원,") · 날짜 "2026. 8. 28." 공백 유지 · 줄 끝에서 갈린 연도 "20⏎25년" | PDF 글 어절 F1 99.076 → **99.103%** · 그 밖 지표 그대로 |
|
|
142
144
|
| 4.24.35 | PDF: 자간 줄인 수치의 같은 숫자 둘("129.9") 지키기 · 글자마다 찍은 첨자 줄을 본문에 붙이기 · 수 가운데서 꺾인 줄("1,2⏎96억"·"(4.1⏎6.~5.16.)")과 칸 소수 잇기 · 표지 책등 외기둥 세로 글 | PDF 표 칸 완전 일치 0.99264 → **0.99267** · 칸 내용 0.98902 → **0.98905** · PDF 글 순서 99.359 → **99.360%** · 어절 F1 99.073 → **99.076%** · 그 밖 지표 그대로 |
|
|
143
|
-
| 4.24.34 | to-hwpx: 파일 여러 개·폴더 일괄 변환(하위 폴더, 이미 있는 .hwpx 건너뜀) · PDF: 기호 글꼴 작은 네모로 찍고 공백으로 적은 "·" 글머리 되살림 · 글자 단위로 나눈 줄 머리 어미("는데"·"졌다")·겹조사 잇기 | PDF 표 칸 완전 일치 0.99221 → **0.99264** · 칸 내용 0.98896 → **0.98902** · PDF 글 재현율 99.883 → **99.885%** · 순서 99.356 → **99.359%** · 어절 F1 99.071 → **99.073%** · 그 밖 지표 그대로 |
|
|
144
|
-
| 4.24.33 | PDF 표: 모아찍기 쪽 넘김에서 오른쪽 쪽 머리 상자로 넘어간 칸 글을 앞 칸에 잇기 · 칸을 한 겹 더 깐 1×1 클립(통계표 숫자 칸)을 중첩 표 대신 칸 글로 | PDF 표 칸 내용 일치 0.98794 → **0.98896** · 칸 완전 일치 0.99153 → **0.99221** · 그 밖 벤치 지표 그대로 |
|
|
145
145
|
|
|
146
146
|
이전 버전과 상세 내용은 [변경 이력](CHANGELOG.md)에 있습니다.
|
|
147
147
|
|
|
@@ -53,34 +53,7 @@ import {
|
|
|
53
53
|
usesGaejosikMunche,
|
|
54
54
|
usesLogicStructure,
|
|
55
55
|
validateHwpx
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import {
|
|
58
|
-
blocksToPages
|
|
59
|
-
} from "./chunk-J26TNCL7.js";
|
|
60
|
-
import {
|
|
61
|
-
extractClickHereFields,
|
|
62
|
-
patchHwp,
|
|
63
|
-
patchHwpx
|
|
64
|
-
} from "./chunk-7GN7O3K2.js";
|
|
65
|
-
import {
|
|
66
|
-
addMemoHwpx
|
|
67
|
-
} from "./chunk-YNIZLSM4.js";
|
|
68
|
-
import {
|
|
69
|
-
placeSealHwpx
|
|
70
|
-
} from "./chunk-P3SZJJRK.js";
|
|
71
|
-
import "./chunk-VRCXXZHT.js";
|
|
72
|
-
import {
|
|
73
|
-
convertToHwpx,
|
|
74
|
-
hwpToHwpx
|
|
75
|
-
} from "./chunk-B2VRTOQZ.js";
|
|
76
|
-
import {
|
|
77
|
-
DEFAULT_REDACT_RULES,
|
|
78
|
-
redactMarkdown,
|
|
79
|
-
redactText
|
|
80
|
-
} from "./chunk-3WSNLH4B.js";
|
|
81
|
-
import {
|
|
82
|
-
blocksToChunks
|
|
83
|
-
} from "./chunk-MTSWWXSB.js";
|
|
56
|
+
} from "./chunk-U5OV6D66.js";
|
|
84
57
|
import {
|
|
85
58
|
blocksToPdf,
|
|
86
59
|
extractRenderedRegions,
|
|
@@ -91,25 +64,16 @@ import {
|
|
|
91
64
|
renderHwp5Pages,
|
|
92
65
|
renderHwpxToSvg,
|
|
93
66
|
renderSceneToHtml
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import "./chunk-ONCXLQV4.js";
|
|
96
|
-
import "./chunk-T7K3CLXM.js";
|
|
97
|
-
import "./chunk-DRDW5ULI.js";
|
|
98
|
-
import "./chunk-VKVDMH7X.js";
|
|
99
|
-
import "./chunk-LM7LYH54.js";
|
|
100
|
-
import "./chunk-J42O5KBX.js";
|
|
101
|
-
import "./chunk-VQFA55IC.js";
|
|
67
|
+
} from "./chunk-NL5OTD2E.js";
|
|
102
68
|
import {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
import "./chunk-H7K5YHWQ.js";
|
|
112
|
-
import "./chunk-JIMG76FW.js";
|
|
69
|
+
blocksToPages
|
|
70
|
+
} from "./chunk-346W5O2J.js";
|
|
71
|
+
import {
|
|
72
|
+
extractClickHereFields,
|
|
73
|
+
patchHwp,
|
|
74
|
+
patchHwpx
|
|
75
|
+
} from "./chunk-PQIIYKNL.js";
|
|
76
|
+
import "./chunk-NQJL3664.js";
|
|
113
77
|
import {
|
|
114
78
|
AGENCY_COMMON_NAME,
|
|
115
79
|
PRESET_ALIAS,
|
|
@@ -119,7 +83,24 @@ import {
|
|
|
119
83
|
markdownToHwpx,
|
|
120
84
|
normalizeGongmunPreset,
|
|
121
85
|
placeTotalRow
|
|
122
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-L23XOAKF.js";
|
|
87
|
+
import {
|
|
88
|
+
SPACE_EM_FIXED,
|
|
89
|
+
SPACE_EM_FONT,
|
|
90
|
+
charWidthEm1000,
|
|
91
|
+
fitRatioForFewerLines,
|
|
92
|
+
measureTextWidth,
|
|
93
|
+
simulateWrap,
|
|
94
|
+
simulateWrapKeepWord
|
|
95
|
+
} from "./chunk-F2JYJ2SP.js";
|
|
96
|
+
import {
|
|
97
|
+
addMemoHwpx
|
|
98
|
+
} from "./chunk-7BQWFZJO.js";
|
|
99
|
+
import {
|
|
100
|
+
placeSealHwpx
|
|
101
|
+
} from "./chunk-COH7WXBK.js";
|
|
102
|
+
import "./chunk-QDPYTJ4Y.js";
|
|
103
|
+
import "./chunk-SFLHCRO6.js";
|
|
123
104
|
import {
|
|
124
105
|
ValueCursor,
|
|
125
106
|
applySplices,
|
|
@@ -133,28 +114,47 @@ import {
|
|
|
133
114
|
isLabelCell,
|
|
134
115
|
scanSectionXml
|
|
135
116
|
} from "./chunk-3AHL6YEA.js";
|
|
117
|
+
import "./chunk-4FWLCWNU.js";
|
|
136
118
|
import {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
simulateWrap,
|
|
143
|
-
simulateWrapKeepWord
|
|
144
|
-
} from "./chunk-LWSMZJLR.js";
|
|
145
|
-
import "./chunk-TQBNSAAS.js";
|
|
119
|
+
convertToHwpx,
|
|
120
|
+
hwpToHwpx
|
|
121
|
+
} from "./chunk-ZDMLZRS4.js";
|
|
122
|
+
import "./chunk-M2ZRTYQ5.js";
|
|
123
|
+
import "./chunk-VKVDMH7X.js";
|
|
146
124
|
import "./chunk-OFVHQ2TZ.js";
|
|
125
|
+
import "./chunk-3MHRL3OO.js";
|
|
147
126
|
import "./chunk-WFKFG2RT.js";
|
|
148
|
-
import
|
|
127
|
+
import {
|
|
128
|
+
DEFAULT_REDACT_RULES,
|
|
129
|
+
redactMarkdown,
|
|
130
|
+
redactText
|
|
131
|
+
} from "./chunk-3WSNLH4B.js";
|
|
132
|
+
import {
|
|
133
|
+
blocksToChunks
|
|
134
|
+
} from "./chunk-FRMJTW3C.js";
|
|
135
|
+
import "./chunk-GXED6LJX.js";
|
|
136
|
+
import "./chunk-VQFA55IC.js";
|
|
137
|
+
import {
|
|
138
|
+
detectFormat,
|
|
139
|
+
detectOle2Format,
|
|
140
|
+
detectZipFormat,
|
|
141
|
+
isHwpxFile,
|
|
142
|
+
isOldHwpFile,
|
|
143
|
+
isPdfFile,
|
|
144
|
+
isZipFile
|
|
145
|
+
} from "./chunk-GHHVT4Q5.js";
|
|
146
|
+
import "./chunk-H7K5YHWQ.js";
|
|
147
|
+
import "./chunk-JIMG76FW.js";
|
|
148
|
+
import "./chunk-QDQPAC4L.js";
|
|
149
149
|
import {
|
|
150
150
|
blocksToMarkdown,
|
|
151
151
|
flattenLayoutTables,
|
|
152
152
|
hasStructuredCellContent
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-RPAEXGWZ.js";
|
|
154
154
|
import "./chunk-KFF47XZ7.js";
|
|
155
155
|
import {
|
|
156
156
|
VERSION
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-V2RIY72D.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=-7VE547IT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KordocError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V2RIY72D.js";
|
|
5
5
|
|
|
6
6
|
// src/hwpx/profile-io.ts
|
|
7
7
|
import { z } from "zod";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
formatProfileSchema,
|
|
90
90
|
parseFormatProfileJson
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-2XXTL4S4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToMarkdown
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RPAEXGWZ.js";
|
|
5
5
|
|
|
6
6
|
// src/page-markdown.ts
|
|
7
7
|
function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
@@ -29,4 +29,4 @@ function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
|
29
29
|
export {
|
|
30
30
|
blocksToPages
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-346W5O2J.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-WFKFG2RT.js";
|
|
5
5
|
import {
|
|
6
6
|
KordocError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V2RIY72D.js";
|
|
8
8
|
|
|
9
9
|
// src/hwp5/record.ts
|
|
10
10
|
import { inflateRawSync, inflateSync } from "zlib";
|
|
@@ -402,4 +402,4 @@ export {
|
|
|
402
402
|
appendParaText,
|
|
403
403
|
extractEquationText
|
|
404
404
|
};
|
|
405
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-3MHRL3OO.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
KordocError,
|
|
4
4
|
unzipLimitBytes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-V2RIY72D.js";
|
|
6
6
|
|
|
7
7
|
// src/hwpx/parser-shared.ts
|
|
8
8
|
import { DOMParser } from "@xmldom/xmldom";
|
|
@@ -156,4 +156,4 @@ export {
|
|
|
156
156
|
createXmlParser,
|
|
157
157
|
applyPageText
|
|
158
158
|
};
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-4FWLCWNU.js.map
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
tidyScriptTags,
|
|
37
37
|
visibleText,
|
|
38
38
|
wrapScript
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-IZWZ3RQC.js";
|
|
40
40
|
import {
|
|
41
41
|
KordocError,
|
|
42
42
|
compareSectionPaths,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
stripDtd,
|
|
49
49
|
unescapeHtml,
|
|
50
50
|
unzipLimitBytes
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZVAX6E63.js";
|
|
52
52
|
|
|
53
53
|
// src/hwpx/generator.ts
|
|
54
54
|
import JSZip2 from "jszip";
|
|
@@ -23425,4 +23425,4 @@ export {
|
|
|
23425
23425
|
markdownToHwpxFromTemplate,
|
|
23426
23426
|
markdownToHwpx
|
|
23427
23427
|
};
|
|
23428
|
-
//# sourceMappingURL=chunk-
|
|
23428
|
+
//# sourceMappingURL=chunk-7AYP2XO6.js.map
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
collectSites
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-COH7WXBK.js";
|
|
5
5
|
import {
|
|
6
6
|
patchZipEntries
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
fileTimeText
|
|
10
|
-
} from "./chunk-LM7LYH54.js";
|
|
7
|
+
} from "./chunk-SFLHCRO6.js";
|
|
11
8
|
import {
|
|
12
9
|
applySplices,
|
|
13
10
|
changedLinesegRemovalSplices,
|
|
@@ -17,11 +14,14 @@ import {
|
|
|
17
14
|
} from "./chunk-3AHL6YEA.js";
|
|
18
15
|
import {
|
|
19
16
|
readZipEntry
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4FWLCWNU.js";
|
|
18
|
+
import {
|
|
19
|
+
fileTimeText
|
|
20
|
+
} from "./chunk-3MHRL3OO.js";
|
|
21
21
|
import {
|
|
22
22
|
KordocError,
|
|
23
23
|
precheckZipSize
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-V2RIY72D.js";
|
|
25
25
|
|
|
26
26
|
// src/form/memo.ts
|
|
27
27
|
import JSZip from "jszip";
|
|
@@ -128,4 +128,4 @@ async function addMemoHwpx(hwpxBuffer, ops, now = /* @__PURE__ */ new Date()) {
|
|
|
128
128
|
export {
|
|
129
129
|
addMemoHwpx
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-7BQWFZJO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KordocError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V2RIY72D.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-
|
|
52
|
+
//# sourceMappingURL=chunk-7ZRUR4TZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
blocksToMarkdown
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IZWZ3RQC.js";
|
|
4
4
|
|
|
5
5
|
// src/page-markdown.ts
|
|
6
6
|
function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
@@ -28,4 +28,4 @@ function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
|
28
28
|
export {
|
|
29
29
|
blocksToPages
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-BWBR5GWQ.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
patchZipEntries
|
|
4
|
-
} from "./chunk-VRCXXZHT.js";
|
|
5
2
|
import {
|
|
6
3
|
parseRenderStyles
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QDPYTJ4Y.js";
|
|
5
|
+
import {
|
|
6
|
+
patchZipEntries
|
|
7
|
+
} from "./chunk-SFLHCRO6.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-4FWLCWNU.js";
|
|
15
15
|
import {
|
|
16
16
|
KordocError,
|
|
17
17
|
precheckZipSize
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V2RIY72D.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-COH7WXBK.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
disableOrtTelemetry
|
|
4
|
-
} from "./chunk-6H25SXDI.js";
|
|
5
2
|
import {
|
|
6
3
|
UNRULED_REGION_TABLES,
|
|
7
4
|
arrowGlyph,
|
|
@@ -31,7 +28,7 @@ import {
|
|
|
31
28
|
splitRowBands,
|
|
32
29
|
starRun,
|
|
33
30
|
tallInkCount
|
|
34
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PFHMNNW7.js";
|
|
35
32
|
import {
|
|
36
33
|
validateOcrOptions
|
|
37
34
|
} from "./chunk-JIMG76FW.js";
|
|
@@ -43,11 +40,14 @@ import {
|
|
|
43
40
|
ocrSourcePath,
|
|
44
41
|
parseCharacterDict,
|
|
45
42
|
resolveOcrModels
|
|
46
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-Y5O4DS56.js";
|
|
44
|
+
import {
|
|
45
|
+
disableOrtTelemetry
|
|
46
|
+
} from "./chunk-6H25SXDI.js";
|
|
47
47
|
import {
|
|
48
48
|
KordocError,
|
|
49
49
|
OPTIONAL_DEP_INSTALL_HINT
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-V2RIY72D.js";
|
|
51
51
|
|
|
52
52
|
// src/ocr/ocr-stacked-rows.ts
|
|
53
53
|
var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—·∼~]$|^\([-+−△▲▽▼]?[\d.,]+\)$/;
|
|
@@ -1061,7 +1061,8 @@ var DEFAULT_OCR_TUNING = Object.freeze({
|
|
|
1061
1061
|
minInkContrast: 35,
|
|
1062
1062
|
postprocess: true,
|
|
1063
1063
|
tightBoxes: true,
|
|
1064
|
-
splitLeaders: true
|
|
1064
|
+
splitLeaders: true,
|
|
1065
|
+
orientPage: true
|
|
1065
1066
|
});
|
|
1066
1067
|
var DET_MIN_SIZE = 3;
|
|
1067
1068
|
var DET_MAX_BOXES = 3e3;
|
|
@@ -1069,6 +1070,11 @@ var REC_MIN_WIDTH = 320;
|
|
|
1069
1070
|
var REC_BATCH_MAX_PIXELS = 48 * 16e3;
|
|
1070
1071
|
var TALL_RATIO = 1.5;
|
|
1071
1072
|
var ROTATE_RATIO = 3;
|
|
1073
|
+
var ORIENT_MIN_BOXES = 20;
|
|
1074
|
+
var ORIENT_TALL_SHARE = 0.6;
|
|
1075
|
+
var ORIENT_SAMPLE = 12;
|
|
1076
|
+
var ORIENT_MIN_CONF = 0.7;
|
|
1077
|
+
var ORIENT_GAIN = 0.1;
|
|
1072
1078
|
var KEEP_MARGIN = 0.06;
|
|
1073
1079
|
var RETRY_SCORE = 0.9;
|
|
1074
1080
|
var LEADER_MIN_DOTS = 4;
|
|
@@ -1525,6 +1531,21 @@ var OcrEngine = class _OcrEngine {
|
|
|
1525
1531
|
async recognizePage(rgba, width, height, stats, tuning = DEFAULT_OCR_TUNING, cellRules = [], rowRules = []) {
|
|
1526
1532
|
if (width < DET_MIN_SIZE || height < DET_MIN_SIZE) return [];
|
|
1527
1533
|
const detected = await this.detect(rgba, width, height, tuning, stats);
|
|
1534
|
+
if (tuning.orientPage && stats && detected.length >= ORIENT_MIN_BOXES) {
|
|
1535
|
+
const tall = detected.filter((b) => b.h >= b.w * TALL_RATIO);
|
|
1536
|
+
if (tall.length >= detected.length * ORIENT_TALL_SHARE) {
|
|
1537
|
+
const sample = [...tall].sort((a, b) => b.h - a.h).slice(0, ORIENT_SAMPLE);
|
|
1538
|
+
const rots = [0, 90, 270];
|
|
1539
|
+
const probe = await this.recognizeJobs(rgba, width, sample.flatMap((box, group2) => rots.map((rot) => ({ box, rot, group: group2 }))), tuning.recBatch);
|
|
1540
|
+
const mean = (k) => sample.reduce((sum, _, i) => sum + (probe[i * rots.length + k]?.confidence ?? 0), 0) / sample.length;
|
|
1541
|
+
const [m0, m90, m270] = rots.map((_, k) => mean(k));
|
|
1542
|
+
const best2 = Math.max(m90, m270);
|
|
1543
|
+
if (best2 >= ORIENT_MIN_CONF && best2 >= m0 + ORIENT_GAIN) {
|
|
1544
|
+
stats.pageRotation = m90 >= m270 ? 90 : 270;
|
|
1545
|
+
return [];
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1528
1549
|
const rows = rowRules.length ? detected.flatMap((b) => splitBoxAtRowRules(b, rowRules)) : detected;
|
|
1529
1550
|
const boxes = cellRules.length ? rows.flatMap((b) => splitBoxAtCellRules(b, cellRules)) : rows;
|
|
1530
1551
|
const footer = tuning.postprocess ? footerInkBox(rgba, width, height, boxes) : null;
|
|
@@ -2018,6 +2039,20 @@ function deskewPage(rgba, width, height) {
|
|
|
2018
2039
|
if (Math.abs(est.angle) < MIN_APPLY_DEG || est.gain < MIN_GAIN) return { rgba, angle: 0 };
|
|
2019
2040
|
return { rgba: rotateRgba(rgba, width, height, est.angle), angle: est.angle };
|
|
2020
2041
|
}
|
|
2042
|
+
function rotateQuarter(rgba, width, height, rot) {
|
|
2043
|
+
const out = new Uint8Array(rgba.length);
|
|
2044
|
+
for (let v = 0; v < width; v++) {
|
|
2045
|
+
for (let u = 0; u < height; u++) {
|
|
2046
|
+
const px = rot === 90 ? width - 1 - v : v, py = rot === 90 ? u : height - 1 - u;
|
|
2047
|
+
const o = (v * height + u) * 4, i = (py * width + px) * 4;
|
|
2048
|
+
out[o] = rgba[i];
|
|
2049
|
+
out[o + 1] = rgba[i + 1];
|
|
2050
|
+
out[o + 2] = rgba[i + 2];
|
|
2051
|
+
out[o + 3] = rgba[i + 3];
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
return { rgba: out, width: height, height: width };
|
|
2055
|
+
}
|
|
2021
2056
|
function rotateRgba(rgba, width, height, deg) {
|
|
2022
2057
|
const out = new Uint8Array(rgba.length);
|
|
2023
2058
|
const t = deg * Math.PI / 180;
|
|
@@ -2071,7 +2106,7 @@ var AUTO_REC_PAGE_CONF = 0.9;
|
|
|
2071
2106
|
var AUTO_REC_GAIN = 0.06;
|
|
2072
2107
|
async function recognizeOcrPage(engine, config, tuning, rgba, width, height, stats, cellRules, rowRules) {
|
|
2073
2108
|
const items = await engine.recognizePage(rgba, width, height, stats, tuning, cellRules, rowRules);
|
|
2074
|
-
if (!config.handwriting) return items;
|
|
2109
|
+
if (!config.handwriting || stats.pageRotation) return items;
|
|
2075
2110
|
const base = meanConfidence(items);
|
|
2076
2111
|
if (base >= AUTO_REC_PAGE_CONF) return items;
|
|
2077
2112
|
const altStats = { droppedLowConf: 0, ...stats.dropped ? { dropped: [] } : {} };
|
|
@@ -2143,7 +2178,7 @@ async function runPdfOcr(buffer, targets, mode, warnings, onProgress, detectTabl
|
|
|
2143
2178
|
return result;
|
|
2144
2179
|
}
|
|
2145
2180
|
async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, vectorOps, regions, config = DEFAULT_BUILTIN_OCR) {
|
|
2146
|
-
|
|
2181
|
+
let { originalWidth: pdfW, originalHeight: pdfH } = page.getOriginalSize();
|
|
2147
2182
|
const renderScale = Math.min(OCR_RENDER_SCALE, Math.sqrt(MAX_OCR_PIXELS / Math.max(1, pdfW * pdfH)));
|
|
2148
2183
|
if (renderScale < OCR_RENDER_SCALE) {
|
|
2149
2184
|
warnings.push({ page: pageNo, code: "PARTIAL_PARSE", message: `OCR \uB798\uC2A4\uD130 \uD53D\uC140 \uC0C1\uD55C\uC73C\uB85C \uB80C\uB354 \uD574\uC0C1\uB3C4\uB97C \uCD95\uC18C\uD588\uC2B5\uB2C8\uB2E4 (\uC791\uC740 \uAE00\uC790 \uC778\uC2DD \uACB0\uC190 \uAC00\uB2A5)` });
|
|
@@ -2154,13 +2189,13 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
2154
2189
|
render: async ({ data }) => data
|
|
2155
2190
|
});
|
|
2156
2191
|
const hiRgba = closer ? bgraToRgba(rendered.data) : null;
|
|
2157
|
-
|
|
2192
|
+
let { rgba, width: rw, height: rh } = hiRgba ? halve(hiRgba, rendered.width, rendered.height) : { rgba: bgraToRgba(rendered.data), width: rendered.width, height: rendered.height };
|
|
2158
2193
|
if (mode === "builtin") {
|
|
2159
|
-
|
|
2194
|
+
let { rgba: upright, angle } = vectorOps || regions ? { rgba, angle: 0 } : deskewPage(rgba, rw, rh);
|
|
2160
2195
|
const stats = { droppedLowConf: 0, ...config.lines === "all" ? { dropped: [] } : {} };
|
|
2161
|
-
|
|
2162
|
-
const tuning = regions ? regionTuning(config.tuning) : config.tuning;
|
|
2163
|
-
|
|
2196
|
+
let ruling = vectorOps ? void 0 : detectRulingLines(upright, rw, rh, rh / pdfH);
|
|
2197
|
+
const tuning = regions ? regionTuning(config.tuning) : vectorOps ? { ...config.tuning, orientPage: false } : config.tuning;
|
|
2198
|
+
let items = await recognizeOcrPage(
|
|
2164
2199
|
engine,
|
|
2165
2200
|
config,
|
|
2166
2201
|
tuning,
|
|
@@ -2171,6 +2206,23 @@ async function ocrOnePage(page, pageNo, mode, engine, warnings, detectTables, ve
|
|
|
2171
2206
|
ruling ? [...ruling.cellDividers ?? [], ...cellEdgeVerticals(ruling)] : void 0,
|
|
2172
2207
|
ruling ? cellEdgeHorizontals(ruling) : void 0
|
|
2173
2208
|
);
|
|
2209
|
+
if (stats.pageRotation) {
|
|
2210
|
+
({ rgba: upright, width: rw, height: rh } = rotateQuarter(upright, rw, rh, stats.pageRotation));
|
|
2211
|
+
[pdfW, pdfH] = [pdfH, pdfW];
|
|
2212
|
+
delete stats.pageRotation;
|
|
2213
|
+
ruling = detectRulingLines(upright, rw, rh, rh / pdfH);
|
|
2214
|
+
items = await recognizeOcrPage(
|
|
2215
|
+
engine,
|
|
2216
|
+
config,
|
|
2217
|
+
{ ...tuning, orientPage: false },
|
|
2218
|
+
upright,
|
|
2219
|
+
rw,
|
|
2220
|
+
rh,
|
|
2221
|
+
stats,
|
|
2222
|
+
[...ruling.cellDividers ?? [], ...cellEdgeVerticals(ruling)],
|
|
2223
|
+
cellEdgeHorizontals(ruling)
|
|
2224
|
+
);
|
|
2225
|
+
}
|
|
2174
2226
|
if (stats.droppedLowConf > 0) {
|
|
2175
2227
|
warnings.push({
|
|
2176
2228
|
page: pageNo,
|
|
@@ -2238,8 +2290,8 @@ function halve(src, w, h) {
|
|
|
2238
2290
|
}
|
|
2239
2291
|
return { rgba: out, width: W, height: H };
|
|
2240
2292
|
}
|
|
2241
|
-
var REGION_TUNING = Object.freeze({ ...DEFAULT_OCR_TUNING, trimEdges: false });
|
|
2242
|
-
var regionTuning = (t) => t === DEFAULT_OCR_TUNING ? REGION_TUNING : { ...t, trimEdges: false };
|
|
2293
|
+
var REGION_TUNING = Object.freeze({ ...DEFAULT_OCR_TUNING, trimEdges: false, orientPage: false });
|
|
2294
|
+
var regionTuning = (t) => t === DEFAULT_OCR_TUNING ? REGION_TUNING : { ...t, trimEdges: false, orientPage: false };
|
|
2243
2295
|
function meanConfidence(items) {
|
|
2244
2296
|
let n = 0, sum = 0;
|
|
2245
2297
|
for (const it of items) {
|
|
@@ -2314,6 +2366,7 @@ function groupOcrLines(items, figureRegion = false) {
|
|
|
2314
2366
|
function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, detectTables = true, opList = { fnArray: [], argsArray: [] }, figureRegion = false) {
|
|
2315
2367
|
const bottoms = items.map((it) => it.y + it.h);
|
|
2316
2368
|
const xs = items.map((it) => ({ x: it.x, r: it.x + it.w, space: false }));
|
|
2369
|
+
const texts = items.map((it) => it.text);
|
|
2317
2370
|
for (const line of groupOcrLines(items, figureRegion)) {
|
|
2318
2371
|
if (line.length < 2) continue;
|
|
2319
2372
|
const sorted = line.map((j) => items[j].y + items[j].h).sort((a, b) => a - b);
|
|
@@ -2322,6 +2375,13 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
2322
2375
|
for (let k = 1; k < byX.length; k++) {
|
|
2323
2376
|
const L = xs[byX[k - 1]], R = xs[byX[k]];
|
|
2324
2377
|
if (R.x >= L.r) continue;
|
|
2378
|
+
const lt = [...texts[byX[k - 1]]], rt = [...texts[byX[k]]], per = items[byX[k]].w / Math.max(1, rt.length);
|
|
2379
|
+
for (let n = Math.min(3, rt.length, lt.length); n >= 1; n--) {
|
|
2380
|
+
if (lt.slice(-n).join("") === rt.slice(0, n).join("") && /[가-힣]/.test(rt[0]) && L.r - R.x >= per * n * 0.5) {
|
|
2381
|
+
texts[byX[k]] = rt.slice(n).join("");
|
|
2382
|
+
break;
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2325
2385
|
const mid = (R.x + L.r) / 2, half = Math.min(items[byX[k - 1]].h, items[byX[k]].h) * 0.15;
|
|
2326
2386
|
L.r = Math.max(L.x + 1, mid - half);
|
|
2327
2387
|
R.x = Math.min(R.r - 1, mid + half);
|
|
@@ -2331,7 +2391,7 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
2331
2391
|
const norm = items.map((it, i) => {
|
|
2332
2392
|
const h = (figureRegion ? Math.max(1, bottoms[i] - it.y) : it.h) / scale;
|
|
2333
2393
|
const normalized = {
|
|
2334
|
-
text:
|
|
2394
|
+
text: texts[i],
|
|
2335
2395
|
x: Math.round(xs[i].x / scale),
|
|
2336
2396
|
// NormItem.y 는 pdfjs transform[5] = 베이스라인 (bottom-up) — 잉크 하단으로 근사
|
|
2337
2397
|
y: Math.round(pdfH - bottoms[i] / scale),
|
|
@@ -2345,8 +2405,50 @@ function ocrItemsToBlocks(items, pageNumber, pdfW, pdfH, scale, extraLines, dete
|
|
|
2345
2405
|
};
|
|
2346
2406
|
copyOcrTextGaps(it, normalized, 1 / scale);
|
|
2347
2407
|
return normalized;
|
|
2348
|
-
});
|
|
2349
|
-
|
|
2408
|
+
}).filter((it) => it.text);
|
|
2409
|
+
const blocks = unframeOcrLayoutTables(splitStackedOcrRows(extractPageBlocksWithLines(norm, pageNumber, opList, pdfW, pdfH, extraLines, detectTables)), pdfH);
|
|
2410
|
+
if (!figureRegion) markOcrHeadings(blocks);
|
|
2411
|
+
return blocks;
|
|
2412
|
+
}
|
|
2413
|
+
function markOcrHeadings(blocks) {
|
|
2414
|
+
const sized = blocks.filter((b) => b.type === "paragraph" && b.text && b.style?.fontSize);
|
|
2415
|
+
const weights = sized.map((b) => [b.style.fontSize, b.text.length]);
|
|
2416
|
+
const total = weights.reduce((n, [, w]) => n + w, 0);
|
|
2417
|
+
if (total < 100) return;
|
|
2418
|
+
weights.sort((a, b) => a[0] - b[0]);
|
|
2419
|
+
let acc = 0, body = 0;
|
|
2420
|
+
for (const [size, w] of weights) {
|
|
2421
|
+
acc += w;
|
|
2422
|
+
if (acc >= total / 2) {
|
|
2423
|
+
body = size;
|
|
2424
|
+
break;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
if (!body) return;
|
|
2428
|
+
for (const b of sized) {
|
|
2429
|
+
const text = b.text.trim(), size = b.style.fontSize;
|
|
2430
|
+
const ratio = size / body;
|
|
2431
|
+
if (ratio < 1.3) continue;
|
|
2432
|
+
if (text.length < 2 || text.length > (ratio >= 1.5 ? 60 : 40) || /[.!?。]$|다\.?$/.test(text) || /^[\d\s.,%·-]+$/.test(text)) continue;
|
|
2433
|
+
if (b.bbox && b.bbox.height > size * (ratio >= 1.5 ? 3.2 : 1.6)) continue;
|
|
2434
|
+
b.type = "heading";
|
|
2435
|
+
b.level = ratio >= 1.5 ? 1 : 2;
|
|
2436
|
+
}
|
|
2437
|
+
for (let i = blocks.length - 1; i > 0; i--) {
|
|
2438
|
+
const a = blocks[i - 1], b = blocks[i];
|
|
2439
|
+
if (a.type !== "heading" || b.type !== "heading" || !a.bbox || !b.bbox) continue;
|
|
2440
|
+
const marker = /^(?:제\s*\d+\s*[장절편부]|chapter\s*\d+|part\s*\d+)$/i.test(a.text.trim());
|
|
2441
|
+
const sa = a.style?.fontSize ?? 0, sb = b.style?.fontSize ?? 0;
|
|
2442
|
+
if (!marker && (a.level !== b.level || Math.max(sa, sb) > Math.min(sa, sb) * 1.3)) continue;
|
|
2443
|
+
const gap = a.bbox.y - (b.bbox.y + b.bbox.height), size = Math.max(a.style?.fontSize ?? 0, b.style?.fontSize ?? 0);
|
|
2444
|
+
const across = Math.min(a.bbox.x + a.bbox.width, b.bbox.x + b.bbox.width) - Math.max(a.bbox.x, b.bbox.x);
|
|
2445
|
+
if (gap < 0 || gap > size * (marker ? 3 : 1.2) || across <= 0) continue;
|
|
2446
|
+
a.level = Math.min(a.level ?? 2, b.level ?? 2);
|
|
2447
|
+
a.text = `${a.text.trim()} ${b.text.trim()}`;
|
|
2448
|
+
const x = Math.min(a.bbox.x, b.bbox.x);
|
|
2449
|
+
a.bbox = { ...a.bbox, x, y: b.bbox.y, width: Math.max(a.bbox.x + a.bbox.width, b.bbox.x + b.bbox.width) - x, height: a.bbox.y + a.bbox.height - b.bbox.y };
|
|
2450
|
+
blocks.splice(i, 1);
|
|
2451
|
+
}
|
|
2350
2452
|
}
|
|
2351
2453
|
async function tryImport2(name, loader) {
|
|
2352
2454
|
try {
|
|
@@ -2388,6 +2490,7 @@ export {
|
|
|
2388
2490
|
detectRulingLines,
|
|
2389
2491
|
rulingToPdfLines,
|
|
2390
2492
|
deskewPage,
|
|
2493
|
+
rotateQuarter,
|
|
2391
2494
|
MAX_OCR_PIXELS,
|
|
2392
2495
|
DEFAULT_BUILTIN_OCR,
|
|
2393
2496
|
builtinOcrConfig,
|
|
@@ -2400,6 +2503,7 @@ export {
|
|
|
2400
2503
|
runPdfOcr,
|
|
2401
2504
|
ocrOnePage,
|
|
2402
2505
|
groupOcrLines,
|
|
2403
|
-
ocrItemsToBlocks
|
|
2506
|
+
ocrItemsToBlocks,
|
|
2507
|
+
markOcrHeadings
|
|
2404
2508
|
};
|
|
2405
|
-
//# sourceMappingURL=chunk-
|
|
2509
|
+
//# sourceMappingURL=chunk-CS76UPUC.js.map
|