kordoc 4.24.42 → 4.24.44
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/{-4FV4UFBP.js → -H334XSXO.js} +21 -21
- package/dist/{chunk-NQJCR4W6.js → chunk-2FDWBF47.js} +2 -2
- package/dist/{chunk-SHJFHRDG.js → chunk-2KHZVNCS.js} +3 -3
- package/dist/{chunk-FGTG4IIL.js → chunk-2TJ4E6MT.js} +2 -2
- package/dist/{chunk-L5ETE5GI.js → chunk-3EBWTFBT.js} +2 -2
- package/dist/{chunk-4CGVUHGB.js → chunk-4Y5KRSHV.js} +3 -3
- package/dist/{chunk-MXBFGNEJ.js → chunk-6M2Z6QDD.js} +2 -2
- package/dist/{chunk-BJ6CKAQL.js → chunk-6ZYOH3TZ.js} +2 -2
- package/dist/{chunk-6BKH6JOD.js → chunk-7VVBR5WX.js} +99 -8
- package/dist/chunk-7VVBR5WX.js.map +1 -0
- package/dist/{chunk-N6AEYYEV.js → chunk-7W6G4EC7.js} +2 -2
- package/dist/{chunk-US34K54L.js → chunk-ABJ5DR2C.js} +2 -2
- package/dist/{chunk-2RCML4RI.js → chunk-AMLNYJWV.js} +3 -3
- package/dist/{chunk-U4R7GNS3.js → chunk-AS6INVO3.js} +73 -9
- package/dist/chunk-AS6INVO3.js.map +1 -0
- package/dist/{chunk-YXBKSJXE.js → chunk-B3GHP32M.js} +6 -6
- package/dist/{chunk-2GJZMZKE.js → chunk-C2TMQUP4.js} +5 -5
- package/dist/{chunk-DDEOJIOC.js → chunk-FQMLFAEN.js} +10 -10
- package/dist/{chunk-SWJLFU2Y.js → chunk-GRY6ITVN.js} +2 -2
- package/dist/{chunk-RSZERVJO.cjs → chunk-HB3KLT7N.cjs} +58 -58
- package/dist/{chunk-RSZERVJO.cjs.map → chunk-HB3KLT7N.cjs.map} +1 -1
- package/dist/{chunk-3PMJMMYO.js → chunk-HD6RQDGW.js} +2 -2
- package/dist/{chunk-I4K5GVV5.js → chunk-HDP2NFYZ.js} +72 -8
- package/dist/chunk-HDP2NFYZ.js.map +1 -0
- package/dist/{chunk-BOFEAPZJ.cjs → chunk-HW6KA2HI.cjs} +3 -3
- package/dist/{chunk-BOFEAPZJ.cjs.map → chunk-HW6KA2HI.cjs.map} +1 -1
- package/dist/{chunk-7EKOJLJY.cjs → chunk-IT34DGXJ.cjs} +3 -3
- package/dist/{chunk-7EKOJLJY.cjs.map → chunk-IT34DGXJ.cjs.map} +1 -1
- package/dist/{chunk-SJOQYUWH.js → chunk-IV6GW3K7.js} +13 -6
- package/dist/chunk-IV6GW3K7.js.map +1 -0
- package/dist/{chunk-DEIHO5LT.js → chunk-JI3WWHN2.js} +6 -6
- package/dist/{chunk-QPQZUYIR.js → chunk-NJ2BJDHJ.js} +2 -2
- package/dist/{chunk-PSF2OWCU.js → chunk-NYQ6HNLA.js} +2 -2
- package/dist/{chunk-7JSL5CSQ.cjs → chunk-O7EDZT7I.cjs} +98 -98
- package/dist/{chunk-7JSL5CSQ.cjs.map → chunk-O7EDZT7I.cjs.map} +1 -1
- package/dist/{chunk-KMDRZIGO.cjs → chunk-OQCRVBB7.cjs} +51 -44
- package/dist/chunk-OQCRVBB7.cjs.map +1 -0
- package/dist/{chunk-RSY7TU4J.js → chunk-PSB3XI2U.js} +2 -2
- package/dist/{chunk-SL4UHGZV.js → chunk-QR5EL3EF.js} +2 -2
- package/dist/{chunk-VLHBQ2CA.js → chunk-RFSKHVLF.js} +2 -2
- package/dist/{chunk-GV3JHFAA.js → chunk-RUCMKRDE.js} +13 -6
- package/dist/chunk-RUCMKRDE.js.map +1 -0
- package/dist/{chunk-KOVWUN2F.cjs → chunk-SXULSPB6.cjs} +95 -31
- package/dist/chunk-SXULSPB6.cjs.map +1 -0
- package/dist/{chunk-2DK2NCNW.js → chunk-TRVRIIER.js} +2 -2
- package/dist/{chunk-ICF2GY2Q.js → chunk-UETXNBIQ.js} +7 -7
- package/dist/{chunk-G64OQCI2.js → chunk-UZTGIVEH.js} +5 -5
- package/dist/{chunk-N3MAZNY6.js → chunk-WF2GLWPA.js} +15 -15
- package/dist/{chunk-QZEPWIRV.js → chunk-WLBPDYAT.js} +11 -11
- package/dist/{chunk-INZHSNJP.js → chunk-WXTEM53O.js} +2 -2
- package/dist/{chunk-KGAV4N3R.js → chunk-XCRE5EMS.js} +2 -2
- package/dist/{chunk-3CMQ5PPW.js → chunk-YEKQTHWN.js} +5 -5
- package/dist/{chunk-RP2FGGAN.cjs → chunk-YN3C6T5M.cjs} +180 -89
- package/dist/chunk-YN3C6T5M.cjs.map +1 -0
- package/dist/{chunk-7VRDNOXF.js → chunk-YSRLHL2J.js} +100 -9
- package/dist/chunk-YSRLHL2J.js.map +1 -0
- package/dist/{chunk-BE62Y3BP.cjs → chunk-ZGYKWZJS.cjs} +2 -2
- package/dist/{chunk-BE62Y3BP.cjs.map → chunk-ZGYKWZJS.cjs.map} +1 -1
- package/dist/chunks-IBZZKRII.js +11 -0
- package/dist/cli.js +43 -43
- package/dist/{formula-3JFTK4RE.js → formula-2FOYPHV2.js} +3 -3
- package/dist/{formula-6ZNPMIO2.js → formula-DLJ44T7B.js} +4 -4
- package/dist/{formula-KSUG6YMF.cjs → formula-XAUTHBU5.cjs} +9 -9
- package/dist/{formula-KSUG6YMF.cjs.map → formula-XAUTHBU5.cjs.map} +1 -1
- package/dist/generator-5QCCBJM6.js +10 -0
- package/dist/generator-BIEVUOPW.cjs +11 -0
- package/dist/{generator-MZDOYDNL.cjs.map → generator-BIEVUOPW.cjs.map} +1 -1
- package/dist/generator-S373GIY7.js +17 -0
- package/dist/{hancom-7EP2RGN7.js → hancom-B5LZPM5Y.js} +2 -2
- package/dist/{hancom-5OKIXXYQ.cjs → hancom-TFYG5RGJ.cjs} +5 -5
- package/dist/{hancom-5OKIXXYQ.cjs.map → hancom-TFYG5RGJ.cjs.map} +1 -1
- package/dist/{hancom-FS3UV4XW.js → hancom-W6XQOGQY.js} +2 -2
- package/dist/{image-ocr-PWPS6GJO.cjs → image-ocr-6NMWKDT6.cjs} +27 -27
- package/dist/{image-ocr-PWPS6GJO.cjs.map → image-ocr-6NMWKDT6.cjs.map} +1 -1
- package/dist/{image-ocr-V2NFWERQ.js → image-ocr-BKFZMHFE.js} +7 -7
- package/dist/{image-ocr-CRSF47VX.js → image-ocr-XRXLPEBP.js} +10 -10
- package/dist/index.cjs +1105 -1105
- package/dist/index.js +9 -9
- package/dist/mcp.js +36 -36
- package/dist/memo-NMEJZR24.js +17 -0
- package/dist/{model-bundle-2SFOC7MN.js → model-bundle-R3AIXPVX.js} +5 -5
- package/dist/{models-PLU2EPT7.js → models-BLHI4JAU.js} +5 -5
- package/dist/{parse-worker-v2-WA23FJTR.js → parse-worker-v2-IB3KIORL.js} +22 -22
- package/dist/{parser-FPPPPFKG.cjs → parser-7VLNB7T6.cjs} +161 -160
- package/dist/parser-7VLNB7T6.cjs.map +1 -0
- package/dist/{parser-ZZ5J23BV.js → parser-QCPSCSGJ.js} +11 -10
- package/dist/{parser-ZZ5J23BV.js.map → parser-QCPSCSGJ.js.map} +1 -1
- package/dist/{parser-6STVLFXK.js → parser-QR2TG3WE.js} +14 -13
- package/dist/{parser-6STVLFXK.js.map → parser-QR2TG3WE.js.map} +1 -1
- package/dist/{pdf-ocr-ONVX6DOP.js → pdf-ocr-6PZ66I7G.js} +11 -9
- package/dist/{pdf-ocr-4HCIQNKN.js → pdf-ocr-TGXEFZB5.js} +8 -6
- package/dist/pdf-ocr-TUCEX4AY.cjs +42 -0
- package/dist/pdf-ocr-TUCEX4AY.cjs.map +1 -0
- package/dist/{profile-io-TZFFQUIK.js → profile-io-QL4XZ34F.js} +3 -3
- package/dist/{rasterize-MIMMMVE4.js → rasterize-PUG2V436.js} +3 -3
- package/dist/{redact-doc-ODRGSZR6.js → redact-doc-XDMXMF3A.js} +21 -21
- package/dist/{render-CAJOYHGB.js → render-IHE7XBO6.js} +12 -12
- package/dist/{rewrite-fallback-HFHVUJMY.js → rewrite-fallback-J2KE4JIC.js} +13 -13
- package/dist/seal-OXEZMJL4.js +16 -0
- package/dist/{setup-FNKZ44RB.js → setup-FAU3G7N3.js} +3 -3
- package/dist/{to-hwpx-2KBVGBZP.js → to-hwpx-B5CXJLNS.js} +4 -4
- package/dist/to-hwpx-KFQVO5YC.cjs +16 -0
- package/dist/{to-hwpx-MRHCQ535.cjs.map → to-hwpx-KFQVO5YC.cjs.map} +1 -1
- package/dist/{to-hwpx-U5ZI4SOL.js → to-hwpx-YLJE3AZW.js} +7 -7
- package/dist/visual-GJLFH23Q.js +37 -0
- package/dist/{watch-UAPAV4KE.js → watch-VKZVO6GV.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-6BKH6JOD.js.map +0 -1
- package/dist/chunk-7VRDNOXF.js.map +0 -1
- package/dist/chunk-GV3JHFAA.js.map +0 -1
- package/dist/chunk-I4K5GVV5.js.map +0 -1
- package/dist/chunk-KMDRZIGO.cjs.map +0 -1
- package/dist/chunk-KOVWUN2F.cjs.map +0 -1
- package/dist/chunk-RP2FGGAN.cjs.map +0 -1
- package/dist/chunk-SJOQYUWH.js.map +0 -1
- package/dist/chunk-U4R7GNS3.js.map +0 -1
- package/dist/chunks-456YDGK7.js +0 -11
- package/dist/generator-3XEJMYGP.js +0 -10
- package/dist/generator-HOFGOBUB.js +0 -17
- package/dist/generator-MZDOYDNL.cjs +0 -11
- package/dist/memo-5HCUFE7O.js +0 -17
- package/dist/parser-FPPPPFKG.cjs.map +0 -1
- package/dist/pdf-ocr-DEKAFNKL.cjs +0 -40
- package/dist/pdf-ocr-DEKAFNKL.cjs.map +0 -1
- package/dist/seal-WHIN7ENH.js +0 -16
- package/dist/to-hwpx-MRHCQ535.cjs +0 -16
- package/dist/visual-RMSREQRT.js +0 -37
- /package/dist/{-4FV4UFBP.js.map → -H334XSXO.js.map} +0 -0
- /package/dist/{chunk-NQJCR4W6.js.map → chunk-2FDWBF47.js.map} +0 -0
- /package/dist/{chunk-SHJFHRDG.js.map → chunk-2KHZVNCS.js.map} +0 -0
- /package/dist/{chunk-FGTG4IIL.js.map → chunk-2TJ4E6MT.js.map} +0 -0
- /package/dist/{chunk-L5ETE5GI.js.map → chunk-3EBWTFBT.js.map} +0 -0
- /package/dist/{chunk-4CGVUHGB.js.map → chunk-4Y5KRSHV.js.map} +0 -0
- /package/dist/{chunk-MXBFGNEJ.js.map → chunk-6M2Z6QDD.js.map} +0 -0
- /package/dist/{chunk-BJ6CKAQL.js.map → chunk-6ZYOH3TZ.js.map} +0 -0
- /package/dist/{chunk-N6AEYYEV.js.map → chunk-7W6G4EC7.js.map} +0 -0
- /package/dist/{chunk-US34K54L.js.map → chunk-ABJ5DR2C.js.map} +0 -0
- /package/dist/{chunk-2RCML4RI.js.map → chunk-AMLNYJWV.js.map} +0 -0
- /package/dist/{chunk-YXBKSJXE.js.map → chunk-B3GHP32M.js.map} +0 -0
- /package/dist/{chunk-2GJZMZKE.js.map → chunk-C2TMQUP4.js.map} +0 -0
- /package/dist/{chunk-DDEOJIOC.js.map → chunk-FQMLFAEN.js.map} +0 -0
- /package/dist/{chunk-SWJLFU2Y.js.map → chunk-GRY6ITVN.js.map} +0 -0
- /package/dist/{chunk-3PMJMMYO.js.map → chunk-HD6RQDGW.js.map} +0 -0
- /package/dist/{chunk-DEIHO5LT.js.map → chunk-JI3WWHN2.js.map} +0 -0
- /package/dist/{chunk-QPQZUYIR.js.map → chunk-NJ2BJDHJ.js.map} +0 -0
- /package/dist/{chunk-PSF2OWCU.js.map → chunk-NYQ6HNLA.js.map} +0 -0
- /package/dist/{chunk-RSY7TU4J.js.map → chunk-PSB3XI2U.js.map} +0 -0
- /package/dist/{chunk-SL4UHGZV.js.map → chunk-QR5EL3EF.js.map} +0 -0
- /package/dist/{chunk-VLHBQ2CA.js.map → chunk-RFSKHVLF.js.map} +0 -0
- /package/dist/{chunk-2DK2NCNW.js.map → chunk-TRVRIIER.js.map} +0 -0
- /package/dist/{chunk-ICF2GY2Q.js.map → chunk-UETXNBIQ.js.map} +0 -0
- /package/dist/{chunk-G64OQCI2.js.map → chunk-UZTGIVEH.js.map} +0 -0
- /package/dist/{chunk-N3MAZNY6.js.map → chunk-WF2GLWPA.js.map} +0 -0
- /package/dist/{chunk-QZEPWIRV.js.map → chunk-WLBPDYAT.js.map} +0 -0
- /package/dist/{chunk-INZHSNJP.js.map → chunk-WXTEM53O.js.map} +0 -0
- /package/dist/{chunk-KGAV4N3R.js.map → chunk-XCRE5EMS.js.map} +0 -0
- /package/dist/{chunk-3CMQ5PPW.js.map → chunk-YEKQTHWN.js.map} +0 -0
- /package/dist/{chunks-456YDGK7.js.map → chunks-IBZZKRII.js.map} +0 -0
- /package/dist/{formula-3JFTK4RE.js.map → formula-2FOYPHV2.js.map} +0 -0
- /package/dist/{formula-6ZNPMIO2.js.map → formula-DLJ44T7B.js.map} +0 -0
- /package/dist/{generator-3XEJMYGP.js.map → generator-5QCCBJM6.js.map} +0 -0
- /package/dist/{generator-HOFGOBUB.js.map → generator-S373GIY7.js.map} +0 -0
- /package/dist/{hancom-7EP2RGN7.js.map → hancom-B5LZPM5Y.js.map} +0 -0
- /package/dist/{hancom-FS3UV4XW.js.map → hancom-W6XQOGQY.js.map} +0 -0
- /package/dist/{image-ocr-V2NFWERQ.js.map → image-ocr-BKFZMHFE.js.map} +0 -0
- /package/dist/{image-ocr-CRSF47VX.js.map → image-ocr-XRXLPEBP.js.map} +0 -0
- /package/dist/{memo-5HCUFE7O.js.map → memo-NMEJZR24.js.map} +0 -0
- /package/dist/{model-bundle-2SFOC7MN.js.map → model-bundle-R3AIXPVX.js.map} +0 -0
- /package/dist/{models-PLU2EPT7.js.map → models-BLHI4JAU.js.map} +0 -0
- /package/dist/{parse-worker-v2-WA23FJTR.js.map → parse-worker-v2-IB3KIORL.js.map} +0 -0
- /package/dist/{pdf-ocr-4HCIQNKN.js.map → pdf-ocr-6PZ66I7G.js.map} +0 -0
- /package/dist/{pdf-ocr-ONVX6DOP.js.map → pdf-ocr-TGXEFZB5.js.map} +0 -0
- /package/dist/{profile-io-TZFFQUIK.js.map → profile-io-QL4XZ34F.js.map} +0 -0
- /package/dist/{rasterize-MIMMMVE4.js.map → rasterize-PUG2V436.js.map} +0 -0
- /package/dist/{redact-doc-ODRGSZR6.js.map → redact-doc-XDMXMF3A.js.map} +0 -0
- /package/dist/{render-CAJOYHGB.js.map → render-IHE7XBO6.js.map} +0 -0
- /package/dist/{rewrite-fallback-HFHVUJMY.js.map → rewrite-fallback-J2KE4JIC.js.map} +0 -0
- /package/dist/{seal-WHIN7ENH.js.map → seal-OXEZMJL4.js.map} +0 -0
- /package/dist/{setup-FNKZ44RB.js.map → setup-FAU3G7N3.js.map} +0 -0
- /package/dist/{to-hwpx-2KBVGBZP.js.map → to-hwpx-B5CXJLNS.js.map} +0 -0
- /package/dist/{to-hwpx-U5ZI4SOL.js.map → to-hwpx-YLJE3AZW.js.map} +0 -0
- /package/dist/{visual-RMSREQRT.js.map → visual-GJLFH23Q.js.map} +0 -0
- /package/dist/{watch-UAPAV4KE.js.map → watch-VKZVO6GV.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.878** · `ocrRec: "auto"` **0.879** · 손글씨 **0.901** · 제목 재현율 0.924 (4.24.44) |
|
|
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.44](https://github.com/chrisryugj/kordoc/releases/tag/v4.24.44)** · 2026-11-04
|
|
137
137
|
|
|
138
138
|
| 버전 | 주요 변경 | 수치 변화 |
|
|
139
139
|
| --- | --- | --- |
|
|
140
|
+
| 4.24.44 | OCR: 여러 단 본문(펼친 교재·용어 단)이 군집 표로 묶이던 것 · 그림 OCR(`ocr: true`)이 옅은 글 한 줄 띠 그림(각주)도 읽기 | KoOCR-Bench 종합 0.877 → **0.878**(`auto` **0.879**, 측정 변환기 수정 기준) · 사용자 실문서 CER .301 → .285 · ODL `ocr: true` .9665 → .9666 · 자체 벤치 문서별 하락 0 |
|
|
141
|
+
| 4.24.43 | OCR: 사전에 없는 원문자 자모·영문(㉠~㉭·ⓐ~ⓩ) 되살리기(고리 속 다시 읽기·홀자모 획 판정) · 번호 장·절 제목·영문 대문자 줄 제목 · PDF 특허 문단 번호 · 빈 중첩표만 든 후행 열 | KoOCR-Bench 종합 0.872 → **0.877**(`auto` **0.877**) · 수능 원문자 보존 .682 → **.947** · 제목 재현율 .798 → .924 · ODL 제목 .949 → .953 · 자체 벤치 문서별 하락 0 |
|
|
140
142
|
| 4.24.42 | OCR: 기본 설정도 뚜렷한 손글씨 쪽은 손글씨 모델로(`ocrRec: "printed"` 로 끔) · 납작한 한 줄 띠 검출 · 통계표 본문 펼치기(이름·값 줄·세로쓰기 이름표·두 줄 숫자 행·걸친 칸 글) · 부푼 상자 행 띠 · 구성비·증감률 열과 쌓인 구성비 행 · 세로선 너머 이웃 칸 글자 · 붙어 읽힌 쉼표 정수 | KoOCR-Bench 종합 0.835 → **0.872**(`auto` **0.873**) · 손글씨 .761 → **.901** · 통계표 .839 → .872 · 자체 벤치 문서별 하락 0 |
|
|
141
143
|
| 4.24.41 | HWP → HWPX: 배포용 문서도 변환(종전엔 거부) · 변경 추적 문서의 지운 구간·변경 목록 · 그림자 개체 바깥 여백 · 투명도 색 · 변경 추적 설정 기본값 · 겹친 쪽 번호 위치 · 형광펜 끝 · 메모 선 모양 | 공공 HWP 67개 한/글 저장본 대조: 변환 63 → **67**/67, 속성 완전 일치 38 → **52**/63 |
|
|
142
144
|
| 4.24.40 | OCR: 자간 좁은 숫자의 같은 숫자 합침("37,369,00")을 가로로 늘려 다시 읽기 · 이름표·값 표(대차대조표)의 쌓인 행을 이름표 줄에 맞춰 펼치기 | KoOCR-Bench 종합 0.830 → **0.835**(`auto` **0.856**) · 관보 CER .116 → .094 · 자체 벤치 문서별 하락 0 |
|
|
143
|
-
| 4.24.39 | OCR: 눕혀 찍은 가로 표 세우기 · 쪽 가운데 단 구분선·두 단 본문으로 두 단 가르기 · 열린 통계표 바깥 이름표 열 · 큰 숫자 표 행 펼치기(띠 밖 글 유실 막음) · 표 품은 쪽 테두리 틀 · 머리 여러 행 통계표 차트 오판 | KoOCR-Bench 종합 0.810 → **0.830**(`auto` **0.851**) · 시험지 CER .416 → .302 · 자체 벤치 문서별 하락 0 |
|
|
144
|
-
| 4.24.38 | OCR: 스캔·이미지 쪽 제목 판정(위아래로 쌓인 장 제목 잇기) · 작은 1칸 상자 쪽 두 단 읽기 순서 · 문장 조각 가짜 표 · 겹친 상자 이음매 글자 · 이미지 수식 OCR(`formulaOcr`) · to-hwpx 한/글 자체 저장 엔진(`--engine hancom`, 팝업 없이) | KoOCR-Bench 종합 0.807 → **0.810**(`auto` **0.831**) · 제목 재현율 0 → .798 · 자체 벤치 문서별 그대로 |
|
|
145
145
|
|
|
146
146
|
이전 버전과 상세 내용은 [변경 이력](CHANGELOG.md)에 있습니다.
|
|
147
147
|
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
usesGaejosikMunche,
|
|
54
54
|
usesLogicStructure,
|
|
55
55
|
validateHwpx
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-WF2GLWPA.js";
|
|
57
57
|
import {
|
|
58
58
|
blocksToPdf,
|
|
59
59
|
extractRenderedRegions,
|
|
@@ -64,16 +64,16 @@ import {
|
|
|
64
64
|
renderHwp5Pages,
|
|
65
65
|
renderHwpxToSvg,
|
|
66
66
|
renderSceneToHtml
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-FQMLFAEN.js";
|
|
68
68
|
import {
|
|
69
69
|
blocksToPages
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-RFSKHVLF.js";
|
|
71
71
|
import {
|
|
72
72
|
extractClickHereFields,
|
|
73
73
|
patchHwp,
|
|
74
74
|
patchHwpx
|
|
75
|
-
} from "./chunk-
|
|
76
|
-
import "./chunk-
|
|
75
|
+
} from "./chunk-WLBPDYAT.js";
|
|
76
|
+
import "./chunk-2KHZVNCS.js";
|
|
77
77
|
import {
|
|
78
78
|
AGENCY_COMMON_NAME,
|
|
79
79
|
PRESET_ALIAS,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
markdownToHwpx,
|
|
84
84
|
normalizeGongmunPreset,
|
|
85
85
|
placeTotalRow
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-B3GHP32M.js";
|
|
87
87
|
import {
|
|
88
88
|
SPACE_EM_FIXED,
|
|
89
89
|
SPACE_EM_FONT,
|
|
@@ -92,15 +92,15 @@ import {
|
|
|
92
92
|
measureTextWidth,
|
|
93
93
|
simulateWrap,
|
|
94
94
|
simulateWrapKeepWord
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-2FDWBF47.js";
|
|
96
96
|
import {
|
|
97
97
|
addMemoHwpx
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-JI3WWHN2.js";
|
|
99
99
|
import {
|
|
100
100
|
placeSealHwpx
|
|
101
|
-
} from "./chunk-
|
|
102
|
-
import "./chunk-
|
|
103
|
-
import "./chunk-
|
|
101
|
+
} from "./chunk-C2TMQUP4.js";
|
|
102
|
+
import "./chunk-WXTEM53O.js";
|
|
103
|
+
import "./chunk-PSB3XI2U.js";
|
|
104
104
|
import {
|
|
105
105
|
ValueCursor,
|
|
106
106
|
applySplices,
|
|
@@ -114,15 +114,15 @@ import {
|
|
|
114
114
|
isLabelCell,
|
|
115
115
|
scanSectionXml
|
|
116
116
|
} from "./chunk-3AHL6YEA.js";
|
|
117
|
-
import "./chunk-
|
|
117
|
+
import "./chunk-2TJ4E6MT.js";
|
|
118
118
|
import {
|
|
119
119
|
convertToHwpx,
|
|
120
120
|
hwpToHwpx
|
|
121
|
-
} from "./chunk-
|
|
122
|
-
import "./chunk-
|
|
121
|
+
} from "./chunk-UETXNBIQ.js";
|
|
122
|
+
import "./chunk-UZTGIVEH.js";
|
|
123
123
|
import "./chunk-VKVDMH7X.js";
|
|
124
124
|
import "./chunk-OFVHQ2TZ.js";
|
|
125
|
-
import "./chunk-
|
|
125
|
+
import "./chunk-3EBWTFBT.js";
|
|
126
126
|
import "./chunk-WFKFG2RT.js";
|
|
127
127
|
import {
|
|
128
128
|
DEFAULT_REDACT_RULES,
|
|
@@ -131,8 +131,8 @@ import {
|
|
|
131
131
|
} from "./chunk-3WSNLH4B.js";
|
|
132
132
|
import {
|
|
133
133
|
blocksToChunks
|
|
134
|
-
} from "./chunk-
|
|
135
|
-
import "./chunk-
|
|
134
|
+
} from "./chunk-ABJ5DR2C.js";
|
|
135
|
+
import "./chunk-6ZYOH3TZ.js";
|
|
136
136
|
import "./chunk-VQFA55IC.js";
|
|
137
137
|
import {
|
|
138
138
|
detectFormat,
|
|
@@ -145,16 +145,16 @@ import {
|
|
|
145
145
|
} from "./chunk-GHHVT4Q5.js";
|
|
146
146
|
import "./chunk-H7K5YHWQ.js";
|
|
147
147
|
import "./chunk-IIOBUTXH.js";
|
|
148
|
-
import "./chunk-
|
|
148
|
+
import "./chunk-7W6G4EC7.js";
|
|
149
149
|
import {
|
|
150
150
|
blocksToMarkdown,
|
|
151
151
|
flattenLayoutTables,
|
|
152
152
|
hasStructuredCellContent
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-RUCMKRDE.js";
|
|
154
154
|
import "./chunk-KFF47XZ7.js";
|
|
155
155
|
import {
|
|
156
156
|
VERSION
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-TRVRIIER.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=-H334XSXO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
findChildByLocalName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2TJ4E6MT.js";
|
|
5
5
|
import {
|
|
6
6
|
circledHangul,
|
|
7
7
|
circledNumber,
|
|
@@ -11038,4 +11038,4 @@ export {
|
|
|
11038
11038
|
simulateWrapKeepWord,
|
|
11039
11039
|
fitRatioForFewerLines
|
|
11040
11040
|
};
|
|
11041
|
-
//# sourceMappingURL=chunk-
|
|
11041
|
+
//# sourceMappingURL=chunk-2FDWBF47.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
MAX_DECOMPRESS_SIZE,
|
|
4
4
|
ZipBombError,
|
|
5
5
|
readZipEntry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2TJ4E6MT.js";
|
|
7
7
|
import {
|
|
8
8
|
KordocError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TRVRIIER.js";
|
|
10
10
|
|
|
11
11
|
// src/hwpx/crypto.ts
|
|
12
12
|
import { createDecipheriv, createHash, pbkdf2Sync, timingSafeEqual } from "crypto";
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
lockedHwpxError,
|
|
113
113
|
decryptHwpxInPlace
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-2KHZVNCS.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
KordocError,
|
|
4
4
|
unzipLimitBytes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TRVRIIER.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-2TJ4E6MT.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-TRVRIIER.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-3EBWTFBT.js.map
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
tidyScriptTags,
|
|
37
37
|
visibleText,
|
|
38
38
|
wrapScript
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-IV6GW3K7.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-HD6RQDGW.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-4Y5KRSHV.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
blocksToMarkdown
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IV6GW3K7.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-6M2Z6QDD.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
KordocError,
|
|
4
4
|
OPTIONAL_DEP_INSTALL_HINT
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TRVRIIER.js";
|
|
6
6
|
|
|
7
7
|
// src/render/rasterize.ts
|
|
8
8
|
var densityExponent = null;
|
|
@@ -88,4 +88,4 @@ export {
|
|
|
88
88
|
rasterizeSvg,
|
|
89
89
|
rasterizePageSvg
|
|
90
90
|
};
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-6ZYOH3TZ.js.map
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
quoteHead,
|
|
29
29
|
rememberOcrTextGaps,
|
|
30
30
|
resolveOcrModels,
|
|
31
|
+
ringBoxes,
|
|
31
32
|
ringBullet,
|
|
32
33
|
romanStems,
|
|
33
34
|
serifOne,
|
|
@@ -35,7 +36,7 @@ import {
|
|
|
35
36
|
splitRowBands,
|
|
36
37
|
starRun,
|
|
37
38
|
tallInkCount
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-AS6INVO3.js";
|
|
39
40
|
import {
|
|
40
41
|
validateOcrOptions
|
|
41
42
|
} from "./chunk-TBGGAR7W.js";
|
|
@@ -45,7 +46,7 @@ import {
|
|
|
45
46
|
import {
|
|
46
47
|
KordocError,
|
|
47
48
|
OPTIONAL_DEP_INSTALL_HINT
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-HD6RQDGW.js";
|
|
49
50
|
|
|
50
51
|
// src/ocr/ocr-stacked-rows.ts
|
|
51
52
|
var NUMERIC = /^[-+−△▲▽▼]?[\d.,]+[%p]?$|^[-–—·∼~]$|^\([-+−△▲▽▼]?[\d.,]+%?\)$/;
|
|
@@ -513,7 +514,48 @@ import { basename } from "path";
|
|
|
513
514
|
|
|
514
515
|
// src/ocr/glyph-restore.ts
|
|
515
516
|
var INKLESS_DELTA = 32;
|
|
516
|
-
function
|
|
517
|
+
function ringAsks(rgba, pageW, box, text, steps, stepPx) {
|
|
518
|
+
const chars = [...text];
|
|
519
|
+
if (chars.length !== steps.length || !/[가-힣]/.test(text)) return [];
|
|
520
|
+
const gray = grayCrop(rgba, pageW, box);
|
|
521
|
+
const rings = ringBoxes(gray, box.w, box.h, inkStats(gray));
|
|
522
|
+
const owner = ringOwners(chars, (i) => (steps[i] + 0.5) * stepPx, rings);
|
|
523
|
+
return rings.flatMap((r, k) => {
|
|
524
|
+
const at = owner.indexOf(k);
|
|
525
|
+
if (at >= 0 && !/^[\u2460-\u2468]$/.test(chars[at])) return [];
|
|
526
|
+
const { inner } = r;
|
|
527
|
+
return [{ x0: r.x0, x1: r.x1, jamo: r.jamo, box: { x: box.x + inner.x0 - 1, y: box.y + inner.y0 - 1, w: inner.x1 - inner.x0 + 2, h: inner.y1 - inner.y0 + 2 } }];
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function ringOwners(chars, cx, rings) {
|
|
531
|
+
return chars.map((c, i) => {
|
|
532
|
+
if (!c.trim()) return -1;
|
|
533
|
+
let best = -1, d = Infinity;
|
|
534
|
+
rings.forEach((r, k) => {
|
|
535
|
+
const e = Math.abs(cx(i) - (r.x0 + r.x1) / 2);
|
|
536
|
+
if (cx(i) >= r.x0 && cx(i) <= r.x1 && e < d) {
|
|
537
|
+
d = e;
|
|
538
|
+
best = k;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
return best;
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
var RING_JAMO = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
|
|
545
|
+
var RING_SYLLABLE = "\uAC00\uB098\uB2E4\uB77C\uB9C8\uBC14\uC0AC\uC544\uC790\uCC28\uCE74\uD0C0\uD30C\uD558";
|
|
546
|
+
function ringGlyph(read, jamo = null, confidence = 1) {
|
|
547
|
+
const t = read.trim();
|
|
548
|
+
if (jamo && /^[가-힣□口ㄱ-ㅎ]$/.test(t) && !RING_SYLLABLE.includes(t)) return String.fromCharCode(12896 + RING_JAMO.indexOf(jamo));
|
|
549
|
+
if (confidence < 0.5 || [...t].length !== 1 || /^[oO0ㅇ]$/.test(t)) return null;
|
|
550
|
+
if (/^[1-9]$/.test(t)) return String.fromCharCode(9311 + Number(t));
|
|
551
|
+
if (RING_JAMO.includes(t)) return String.fromCharCode(12896 + RING_JAMO.indexOf(t));
|
|
552
|
+
if (RING_SYLLABLE.includes(t)) return String.fromCharCode(12910 + RING_SYLLABLE.indexOf(t));
|
|
553
|
+
const l = /^[CSUVWXZ]$/.test(t) ? t.toLowerCase() : t;
|
|
554
|
+
if (/^[a-z]$/.test(l)) return String.fromCharCode(9424 + l.charCodeAt(0) - 97);
|
|
555
|
+
if (/^[A-Z]$/.test(l)) return String.fromCharCode(9398 + l.charCodeAt(0) - 65);
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
558
|
+
function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}, rings = []) {
|
|
517
559
|
const chars = [...text];
|
|
518
560
|
if (chars.length !== steps.length) return text;
|
|
519
561
|
const gray = grayCrop(rgba, pageW, box);
|
|
@@ -521,7 +563,7 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
|
521
563
|
if (/[[\]]/.test(text)) brackets(c);
|
|
522
564
|
if (text.includes("'")) cornerQuotes(c);
|
|
523
565
|
if (/['"]/.test(text)) quotes(c);
|
|
524
|
-
if (/(^|\D)[1-9](\D|$)/.test(text)) circled(c);
|
|
566
|
+
if (/(^|\D)[1-9](\D|$)|[ㄱ-ㅎa-zCSUVWXZ]/.test(text)) circled(c);
|
|
525
567
|
if (text.includes("*")) stars(c);
|
|
526
568
|
if (/[\u00b7\u2022]/.test(text)) discs(c);
|
|
527
569
|
if (/[-\u2013\u2014]/.test(text)) dashes(c);
|
|
@@ -530,6 +572,18 @@ function restoreGlyphs(rgba, pageW, box, text, steps, stepPx, note = {}) {
|
|
|
530
572
|
note.ringLead = ring(c);
|
|
531
573
|
if (/[I|]/.test(text)) parallels(c);
|
|
532
574
|
if (/[I1Ⅰ-Ⅲ|]|^\s*\./.test(text)) roman(c);
|
|
575
|
+
const owner = ringOwners(chars, c.cx, rings);
|
|
576
|
+
rings.forEach((r, k) => {
|
|
577
|
+
const live = chars.map((_, i) => i).filter((i) => chars[i].trim());
|
|
578
|
+
const at = owner.indexOf(k);
|
|
579
|
+
if (at >= 0) {
|
|
580
|
+
chars[at] = r.glyph + [...chars[at]].slice(1).join("");
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const prev = live.filter((i) => c.cx(i) < r.x0).pop();
|
|
584
|
+
if (prev !== void 0) chars[prev] += r.glyph;
|
|
585
|
+
else if (live.length) chars[live[0]] = r.glyph + chars[live[0]];
|
|
586
|
+
});
|
|
533
587
|
return chars.join("");
|
|
534
588
|
}
|
|
535
589
|
function trimInklessEnds(rgba, pageW, box, text, steps, stepPx) {
|
|
@@ -641,11 +695,15 @@ function dashes({ chars, cx, gray, w, h, ink }) {
|
|
|
641
695
|
}
|
|
642
696
|
}
|
|
643
697
|
function circled({ chars, cx, gray, w, h, ink }) {
|
|
644
|
-
const
|
|
698
|
+
const alone = (re, i) => re.test(chars[i]) && !re.test(chars[i - 1] ?? "") && !re.test(chars[i + 1] ?? "");
|
|
699
|
+
const at = chars.flatMap((_, i) => alone(/^\d$/, i) && chars[i] !== "0" || alone(/^[ㄱ-ㅎ]$/, i) || alone(/^[A-Za-z]$/, i) && /[a-zCSUVWXZ]/.test(chars[i]) ? [i] : []);
|
|
645
700
|
if (!at.length) return;
|
|
646
701
|
const hit = circledAt(gray, w, h, ink, at.map(cx));
|
|
702
|
+
const JAMO = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
|
|
647
703
|
at.forEach((i, k) => {
|
|
648
|
-
if (hit[k])
|
|
704
|
+
if (!hit[k]) return;
|
|
705
|
+
const ch = chars[i];
|
|
706
|
+
chars[i] = /\d/.test(ch) ? String.fromCharCode(9311 + Number(ch)) : /[a-zA-Z]/.test(ch) ? String.fromCharCode(9424 + ch.toLowerCase().charCodeAt(0) - 97) : JAMO.includes(ch) ? String.fromCharCode(12896 + JAMO.indexOf(ch)) : ch;
|
|
649
707
|
});
|
|
650
708
|
}
|
|
651
709
|
function stars({ chars, cx, gray, w, h, ink }) {
|
|
@@ -1627,11 +1685,20 @@ var OcrEngine = class _OcrEngine {
|
|
|
1627
1685
|
let items = [];
|
|
1628
1686
|
const boxOf = /* @__PURE__ */ new Map();
|
|
1629
1687
|
const retry = [];
|
|
1688
|
+
const ringReads = /* @__PURE__ */ new Map();
|
|
1689
|
+
if (tuning.postprocess) {
|
|
1690
|
+
const asks = [...best.values()].flatMap((r) => r.job.rot === 0 ? ringAsks(rgba, width, r.job.box, r.text, r.steps, r.stepPx).map((a) => ({ ...a, job: r.job })) : []);
|
|
1691
|
+
const res = asks.length ? await this.recognizeJobs(rgba, width, asks.map((a, k) => ({ box: a.box, rot: 0, group: k })), tuning.recBatch) : [];
|
|
1692
|
+
asks.forEach((a, k) => {
|
|
1693
|
+
const glyph = res[k] ? ringGlyph(res[k].text, a.jamo, res[k].confidence) : null;
|
|
1694
|
+
if (glyph) ringReads.set(a.job, [...ringReads.get(a.job) ?? [], { x0: a.x0, x1: a.x1, glyph }]);
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1630
1697
|
for (const r of best.values()) {
|
|
1631
1698
|
const { job, confidence, stepPx } = r;
|
|
1632
1699
|
const { text: read, steps } = tuning.postprocess && job.rot === 0 ? trimInklessEnds(rgba, width, job.box, r.text, r.steps, stepPx) : r;
|
|
1633
1700
|
const note = {};
|
|
1634
|
-
const raw = tuning.postprocess && job.rot === 0 ? restoreGlyphs(rgba, width, job.box, read, steps, stepPx, note) : read;
|
|
1701
|
+
const raw = tuning.postprocess && job.rot === 0 ? restoreGlyphs(rgba, width, job.box, read, steps, stepPx, note, ringReads.get(job)) : read;
|
|
1635
1702
|
let text = tuning.postprocess ? restoreSymbols(raw.trim(), note.ringLead) : raw;
|
|
1636
1703
|
if (!text.trim()) continue;
|
|
1637
1704
|
if (tuning.postprocess && job.rot === 0 && text !== "/" && /^[(:;/)]+$/.test(text) && text.includes("/")) {
|
|
@@ -2344,6 +2411,18 @@ function meanConfidence(items) {
|
|
|
2344
2411
|
}
|
|
2345
2412
|
return n ? sum / n : 0;
|
|
2346
2413
|
}
|
|
2414
|
+
function stretchFaintCrop(rgba) {
|
|
2415
|
+
const n = rgba.length >> 2;
|
|
2416
|
+
if (!n) return;
|
|
2417
|
+
const hist = new Uint32Array(256);
|
|
2418
|
+
for (let i = 0; i < n; i++) hist[rgba[i * 4] * 77 + rgba[i * 4 + 1] * 150 + rgba[i * 4 + 2] * 29 >> 8]++;
|
|
2419
|
+
let lo = 0, hi = 255;
|
|
2420
|
+
for (let acc = 0; lo < 255 && (acc += hist[lo]) < n * 0.01; ) lo++;
|
|
2421
|
+
for (let acc = 0; hi > 0 && (acc += hist[hi]) < n * 0.01; ) hi--;
|
|
2422
|
+
if (hi - lo >= 120 || hi - lo < 16) return;
|
|
2423
|
+
const k = 255 / (hi - lo);
|
|
2424
|
+
for (let i = 0; i < n * 4; i++) if ((i & 3) !== 3) rgba[i] = Math.max(0, Math.min(255, Math.round((rgba[i] - lo) * k)));
|
|
2425
|
+
}
|
|
2347
2426
|
async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REGION_TUNING) {
|
|
2348
2427
|
const out = [];
|
|
2349
2428
|
for (const r of regions) {
|
|
@@ -2355,6 +2434,7 @@ async function closerReads(rgba, rw, rh, pdfH, hi, regions, engine, tuning = REG
|
|
|
2355
2434
|
}
|
|
2356
2435
|
const crop = new Uint8Array(cw * ch * 4);
|
|
2357
2436
|
for (let y = 0; y < ch; y++) crop.set(rgba.subarray(((y0 + y) * rw + x0) * 4, ((y0 + y) * rw + x0 + cw) * 4), y * cw * 4);
|
|
2437
|
+
if (cw >= ch * 6) stretchFaintCrop(crop);
|
|
2358
2438
|
const items = await engine.recognizePage(crop, cw, ch, void 0, tuning);
|
|
2359
2439
|
out.push(items.map((it) => {
|
|
2360
2440
|
const placed = { ...it, x: (it.x + x0) / 2, y: (it.y + y0) / 2, w: it.w / 2, h: it.h / 2 };
|
|
@@ -2471,6 +2551,16 @@ function markOcrHeadings(blocks) {
|
|
|
2471
2551
|
for (const b of sized) {
|
|
2472
2552
|
const text = b.text.trim(), size = b.style.fontSize;
|
|
2473
2553
|
const ratio = size / body;
|
|
2554
|
+
if (ratio >= 1 && ratio < 1.3 && /^제\s*\d+\s*[장절편부]\s*(?![에의은는을를이가와과로도만\s])\S/.test(text) && text.length <= 30 && !/[.!?。,]$|다\.?$/.test(text) && (!b.bbox || b.bbox.height <= size * 1.6)) {
|
|
2555
|
+
b.type = "heading";
|
|
2556
|
+
b.level = /^제\s*\d+\s*절/.test(text) ? 2 : 1;
|
|
2557
|
+
continue;
|
|
2558
|
+
}
|
|
2559
|
+
if (text.length <= 60 && /^[A-Z0-9][A-Z0-9 '’&:!,-]*$/.test(text) && (text.match(/[A-Z]/g) ?? []).length >= 12 && /[A-Z]{2,}[,:]?\s+[A-Z]{2,}/.test(text) && !/[.,]$/.test(text) && (!b.bbox || b.bbox.height <= size * 3.2)) {
|
|
2560
|
+
b.type = "heading";
|
|
2561
|
+
b.level = ratio >= 1.5 ? 1 : 2;
|
|
2562
|
+
continue;
|
|
2563
|
+
}
|
|
2474
2564
|
if (ratio < 1.3) continue;
|
|
2475
2565
|
if (text.length < 2 || text.length > (ratio >= 1.5 ? 60 : 40) || /[.!?。]$|다\.?$/.test(text) || /^[\d\s.,%·-]+$/.test(text)) continue;
|
|
2476
2566
|
if (b.bbox && b.bbox.height > size * (ratio >= 1.5 ? 3.2 : 1.6)) continue;
|
|
@@ -2545,8 +2635,9 @@ export {
|
|
|
2545
2635
|
cellEdgeHorizontals,
|
|
2546
2636
|
runPdfOcr,
|
|
2547
2637
|
ocrOnePage,
|
|
2638
|
+
stretchFaintCrop,
|
|
2548
2639
|
groupOcrLines,
|
|
2549
2640
|
ocrItemsToBlocks,
|
|
2550
2641
|
markOcrHeadings
|
|
2551
2642
|
};
|
|
2552
|
-
//# sourceMappingURL=chunk-
|
|
2643
|
+
//# sourceMappingURL=chunk-7VVBR5WX.js.map
|