kordoc 4.24.76 → 4.24.77
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/{-2LCJEMU4.js → -5UTN72IU.js} +22 -22
- package/dist/{chunk-43VUUMKV.cjs → chunk-3FCFBMS5.cjs} +6 -6
- package/dist/{chunk-43VUUMKV.cjs.map → chunk-3FCFBMS5.cjs.map} +1 -1
- package/dist/{chunk-J6RLB6KE.js → chunk-4MAW3JZO.js} +2 -2
- package/dist/{chunk-CWEB4XAH.js → chunk-5D25RVT5.js} +5 -5
- package/dist/{chunk-E2RQPNXX.js → chunk-5TM34VJ5.js} +2 -2
- package/dist/{chunk-RNBBMRKF.js → chunk-5XWGKCPA.js} +2 -2
- package/dist/{chunk-PE3XRCTM.js → chunk-67WGWE23.js} +4 -4
- package/dist/{chunk-T7YHAP4A.js → chunk-6P3XVII7.js} +3 -3
- package/dist/{chunk-DTKVCSRC.js → chunk-7AWQXTSU.js} +2 -2
- package/dist/{chunk-2ZQUSUDC.js → chunk-7Y2RNRWL.js} +5 -5
- package/dist/{chunk-IRCO55NY.js → chunk-A7VTEP5R.js} +2 -2
- package/dist/{chunk-TGM5V7UD.js → chunk-AMSLIVAC.js} +2 -2
- package/dist/{chunk-MHDVZBUV.js → chunk-AOBRIYGM.js} +2 -2
- package/dist/{chunk-MQ44UJN6.js → chunk-BFAGTWOT.js} +10 -6
- package/dist/chunk-BFAGTWOT.js.map +1 -0
- package/dist/{chunk-MRHLGVK5.js → chunk-BPMDM3JP.js} +2 -2
- package/dist/{chunk-PJ32UFPA.js → chunk-CG4BCYQ2.js} +2 -2
- package/dist/{chunk-2P5GYSEI.js → chunk-CNUWB5NK.js} +2 -2
- package/dist/{chunk-QDETIVPA.js → chunk-D4XGVKQV.js} +6 -6
- package/dist/{chunk-A7QRUXCJ.cjs → chunk-DGOTUUCW.cjs} +3 -3
- package/dist/{chunk-A7QRUXCJ.cjs.map → chunk-DGOTUUCW.cjs.map} +1 -1
- package/dist/{chunk-QIVOVMEC.cjs → chunk-DZX2B4CB.cjs} +2 -2
- package/dist/{chunk-QIVOVMEC.cjs.map → chunk-DZX2B4CB.cjs.map} +1 -1
- package/dist/{chunk-ODJRLTXE.js → chunk-EFLSK5JD.js} +2 -2
- package/dist/{chunk-DIUYXWT2.cjs → chunk-ENGSBT44.cjs} +3 -3
- package/dist/{chunk-DIUYXWT2.cjs.map → chunk-ENGSBT44.cjs.map} +1 -1
- package/dist/{chunk-4L3SF7EF.js → chunk-ERMTVALW.js} +2 -2
- package/dist/{chunk-PATC34WZ.js → chunk-F33LA2ET.js} +111 -12
- package/dist/chunk-F33LA2ET.js.map +1 -0
- package/dist/{chunk-V3MVGLWO.js → chunk-GCUP3CBW.js} +5 -5
- package/dist/{chunk-ZWA3MWAE.js → chunk-GUTZU7XE.js} +3 -3
- package/dist/{chunk-BUZLNJXB.js → chunk-H7HRVW32.js} +2 -2
- package/dist/{chunk-QCH63KBP.cjs → chunk-HDDU4LP5.cjs} +104 -104
- package/dist/{chunk-QCH63KBP.cjs.map → chunk-HDDU4LP5.cjs.map} +1 -1
- package/dist/{chunk-2P3SFHOF.cjs → chunk-JVM237XE.cjs} +88 -88
- package/dist/{chunk-2P3SFHOF.cjs.map → chunk-JVM237XE.cjs.map} +1 -1
- package/dist/{chunk-SABDVSQU.js → chunk-K6YLVT6X.js} +11 -11
- package/dist/{chunk-JYNG27VR.js → chunk-LGQ75OKH.js} +9 -5
- package/dist/chunk-LGQ75OKH.js.map +1 -0
- package/dist/{chunk-XM4VBVYH.cjs → chunk-LHHZZVRD.cjs} +8 -8
- package/dist/{chunk-XM4VBVYH.cjs.map → chunk-LHHZZVRD.cjs.map} +1 -1
- package/dist/{chunk-HHRQX733.cjs → chunk-O5IIMWXC.cjs} +31 -27
- package/dist/chunk-O5IIMWXC.cjs.map +1 -0
- package/dist/{chunk-SQ7BI34M.js → chunk-OLO76CMN.js} +3 -3
- package/dist/{chunk-XIUXBJHE.js → chunk-P6GTNKAA.js} +2 -2
- package/dist/{chunk-RZXJFM3A.js → chunk-QJ7MMZUI.js} +2 -2
- package/dist/{chunk-LFXIZHPE.js → chunk-QWK3DGUI.js} +16 -16
- package/dist/{chunk-U7EJ6QY7.js → chunk-SAUEKG7G.js} +3 -3
- package/dist/{chunk-XOC5PVAC.js → chunk-SKP4XXCB.js} +2 -2
- package/dist/{chunk-JT54JHR3.js → chunk-T424VUF7.js} +2 -2
- package/dist/{chunk-45AT4XJD.js → chunk-UFTF2BO7.js} +2 -2
- package/dist/{chunk-DKRKNL2X.cjs → chunk-UIHCY476.cjs} +58 -58
- package/dist/{chunk-DKRKNL2X.cjs.map → chunk-UIHCY476.cjs.map} +1 -1
- package/dist/{chunk-ODQJEBCB.js → chunk-UN3YZZNT.js} +2 -2
- package/dist/{chunk-HQXVNLH2.js → chunk-XY5BFX3H.js} +6 -6
- package/dist/{chunk-3X3ETOLW.js → chunk-Y2RWVFGG.js} +7 -7
- package/dist/{chunk-WTKISVEW.js → chunk-YSOXWADD.js} +2 -2
- package/dist/{chunk-4RB5OPUZ.js → chunk-ZZNZGQRX.js} +2 -2
- package/dist/chunks-QN364YXU.js +11 -0
- package/dist/cli.js +46 -46
- package/dist/{formula-3RUSZL2X.js → formula-37OIV2H3.js} +4 -4
- package/dist/{formula-UJKRUT4H.js → formula-P6EJMUKF.js} +3 -3
- package/dist/{formula-PNWIA2MN.cjs → formula-YN4NKDPV.cjs} +9 -9
- package/dist/{formula-PNWIA2MN.cjs.map → formula-YN4NKDPV.cjs.map} +1 -1
- package/dist/generator-6YDUW5RE.cjs +12 -0
- package/dist/{generator-3S2MTXHO.cjs.map → generator-6YDUW5RE.cjs.map} +1 -1
- package/dist/generator-C5FWPI6A.js +18 -0
- package/dist/generator-JX3OZYTO.js +11 -0
- package/dist/{hancom-VLS77NRS.js → hancom-547ZXYYE.js} +2 -2
- package/dist/{hancom-4LFQU2RS.js → hancom-GOOSRL7W.js} +2 -2
- package/dist/{hancom-35Z4YAJB.cjs → hancom-LKRD7PXX.cjs} +5 -5
- package/dist/{hancom-35Z4YAJB.cjs.map → hancom-LKRD7PXX.cjs.map} +1 -1
- package/dist/{image-ocr-CCLUXSWY.js → image-ocr-6HQTBMLN.js} +11 -11
- package/dist/{image-ocr-AGEB22EF.cjs → image-ocr-EZEOBMEQ.cjs} +36 -36
- package/dist/{image-ocr-AGEB22EF.cjs.map → image-ocr-EZEOBMEQ.cjs.map} +1 -1
- package/dist/{image-ocr-B7RRK43I.js → image-ocr-RNY2H3HS.js} +8 -8
- package/dist/index.cjs +1214 -1115
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +37 -37
- package/dist/memo-RE3TCSXK.js +17 -0
- package/dist/{model-bundle-KFPWVEFB.js → model-bundle-ZYGK4G65.js} +5 -5
- package/dist/{models-IOX5WK67.js → models-K65TUK4Q.js} +5 -5
- package/dist/{parse-worker-v2-IL6U65X3.js → parse-worker-v2-VOM4DPZV.js} +23 -23
- package/dist/{parser-ANWES7Z3.js → parser-6KOCPC6H.js} +22 -13
- package/dist/{parser-ANWES7Z3.js.map → parser-6KOCPC6H.js.map} +1 -1
- package/dist/{parser-NCSJG5KJ.cjs → parser-7V6AQMPT.cjs} +176 -167
- package/dist/parser-7V6AQMPT.cjs.map +1 -0
- package/dist/{parser-ATU5CQZY.js → parser-SNW4ZFUX.js} +19 -10
- package/dist/{parser-ATU5CQZY.js.map → parser-SNW4ZFUX.js.map} +1 -1
- package/dist/{pdf-ocr-7IH7FGKQ.js → pdf-ocr-2JDCK34V.js} +9 -9
- package/dist/pdf-ocr-A4GJJCT3.cjs +43 -0
- package/dist/{pdf-ocr-F3ABLLXD.cjs.map → pdf-ocr-A4GJJCT3.cjs.map} +1 -1
- package/dist/{pdf-ocr-ZUGHKM32.js → pdf-ocr-JNCOGFLO.js} +6 -6
- package/dist/{profile-io-BGUQJDGK.js → profile-io-WHUZPJEM.js} +3 -3
- package/dist/{rasterize-JOAG2QCQ.js → rasterize-XR5V2FQQ.js} +3 -3
- package/dist/{redact-doc-WL2GWBMN.js → redact-doc-5FMV7KOY.js} +22 -22
- package/dist/{render-672D354C.js → render-OKC4QJUY.js} +12 -12
- package/dist/{rewrite-fallback-2JAAIU6G.js → rewrite-fallback-Y6ZUV6GG.js} +13 -13
- package/dist/seal-VMMMFVLG.js +16 -0
- package/dist/{setup-L4PVFG65.js → setup-Q6CIDVRW.js} +3 -3
- package/dist/to-hwpx-B7RPAOQC.cjs +16 -0
- package/dist/{to-hwpx-VBVI5H4N.cjs.map → to-hwpx-B7RPAOQC.cjs.map} +1 -1
- package/dist/{to-hwpx-OHZK2KBP.js → to-hwpx-BS2NFDUM.js} +4 -4
- package/dist/{to-hwpx-FR6GDNMY.js → to-hwpx-XFNMYMGR.js} +7 -7
- package/dist/visual-SECUV4LR.js +40 -0
- package/dist/{watch-OH4BMY2N.js → watch-ADXQOSZY.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-HHRQX733.cjs.map +0 -1
- package/dist/chunk-JYNG27VR.js.map +0 -1
- package/dist/chunk-MQ44UJN6.js.map +0 -1
- package/dist/chunk-PATC34WZ.js.map +0 -1
- package/dist/chunks-INR44FWQ.js +0 -11
- package/dist/generator-335G75L5.js +0 -11
- package/dist/generator-3S2MTXHO.cjs +0 -12
- package/dist/generator-R2CZZ2KU.js +0 -18
- package/dist/memo-SPNLGMIZ.js +0 -17
- package/dist/parser-NCSJG5KJ.cjs.map +0 -1
- package/dist/pdf-ocr-F3ABLLXD.cjs +0 -43
- package/dist/seal-XLDIGIIE.js +0 -16
- package/dist/to-hwpx-VBVI5H4N.cjs +0 -16
- package/dist/visual-IXMRTYJK.js +0 -40
- /package/dist/{-2LCJEMU4.js.map → -5UTN72IU.js.map} +0 -0
- /package/dist/{chunk-J6RLB6KE.js.map → chunk-4MAW3JZO.js.map} +0 -0
- /package/dist/{chunk-CWEB4XAH.js.map → chunk-5D25RVT5.js.map} +0 -0
- /package/dist/{chunk-E2RQPNXX.js.map → chunk-5TM34VJ5.js.map} +0 -0
- /package/dist/{chunk-RNBBMRKF.js.map → chunk-5XWGKCPA.js.map} +0 -0
- /package/dist/{chunk-PE3XRCTM.js.map → chunk-67WGWE23.js.map} +0 -0
- /package/dist/{chunk-T7YHAP4A.js.map → chunk-6P3XVII7.js.map} +0 -0
- /package/dist/{chunk-DTKVCSRC.js.map → chunk-7AWQXTSU.js.map} +0 -0
- /package/dist/{chunk-2ZQUSUDC.js.map → chunk-7Y2RNRWL.js.map} +0 -0
- /package/dist/{chunk-IRCO55NY.js.map → chunk-A7VTEP5R.js.map} +0 -0
- /package/dist/{chunk-TGM5V7UD.js.map → chunk-AMSLIVAC.js.map} +0 -0
- /package/dist/{chunk-MHDVZBUV.js.map → chunk-AOBRIYGM.js.map} +0 -0
- /package/dist/{chunk-MRHLGVK5.js.map → chunk-BPMDM3JP.js.map} +0 -0
- /package/dist/{chunk-PJ32UFPA.js.map → chunk-CG4BCYQ2.js.map} +0 -0
- /package/dist/{chunk-2P5GYSEI.js.map → chunk-CNUWB5NK.js.map} +0 -0
- /package/dist/{chunk-QDETIVPA.js.map → chunk-D4XGVKQV.js.map} +0 -0
- /package/dist/{chunk-ODJRLTXE.js.map → chunk-EFLSK5JD.js.map} +0 -0
- /package/dist/{chunk-4L3SF7EF.js.map → chunk-ERMTVALW.js.map} +0 -0
- /package/dist/{chunk-V3MVGLWO.js.map → chunk-GCUP3CBW.js.map} +0 -0
- /package/dist/{chunk-ZWA3MWAE.js.map → chunk-GUTZU7XE.js.map} +0 -0
- /package/dist/{chunk-BUZLNJXB.js.map → chunk-H7HRVW32.js.map} +0 -0
- /package/dist/{chunk-SABDVSQU.js.map → chunk-K6YLVT6X.js.map} +0 -0
- /package/dist/{chunk-SQ7BI34M.js.map → chunk-OLO76CMN.js.map} +0 -0
- /package/dist/{chunk-XIUXBJHE.js.map → chunk-P6GTNKAA.js.map} +0 -0
- /package/dist/{chunk-RZXJFM3A.js.map → chunk-QJ7MMZUI.js.map} +0 -0
- /package/dist/{chunk-LFXIZHPE.js.map → chunk-QWK3DGUI.js.map} +0 -0
- /package/dist/{chunk-U7EJ6QY7.js.map → chunk-SAUEKG7G.js.map} +0 -0
- /package/dist/{chunk-XOC5PVAC.js.map → chunk-SKP4XXCB.js.map} +0 -0
- /package/dist/{chunk-JT54JHR3.js.map → chunk-T424VUF7.js.map} +0 -0
- /package/dist/{chunk-45AT4XJD.js.map → chunk-UFTF2BO7.js.map} +0 -0
- /package/dist/{chunk-ODQJEBCB.js.map → chunk-UN3YZZNT.js.map} +0 -0
- /package/dist/{chunk-HQXVNLH2.js.map → chunk-XY5BFX3H.js.map} +0 -0
- /package/dist/{chunk-3X3ETOLW.js.map → chunk-Y2RWVFGG.js.map} +0 -0
- /package/dist/{chunk-WTKISVEW.js.map → chunk-YSOXWADD.js.map} +0 -0
- /package/dist/{chunk-4RB5OPUZ.js.map → chunk-ZZNZGQRX.js.map} +0 -0
- /package/dist/{chunks-INR44FWQ.js.map → chunks-QN364YXU.js.map} +0 -0
- /package/dist/{formula-3RUSZL2X.js.map → formula-37OIV2H3.js.map} +0 -0
- /package/dist/{formula-UJKRUT4H.js.map → formula-P6EJMUKF.js.map} +0 -0
- /package/dist/{generator-335G75L5.js.map → generator-C5FWPI6A.js.map} +0 -0
- /package/dist/{generator-R2CZZ2KU.js.map → generator-JX3OZYTO.js.map} +0 -0
- /package/dist/{hancom-VLS77NRS.js.map → hancom-547ZXYYE.js.map} +0 -0
- /package/dist/{hancom-4LFQU2RS.js.map → hancom-GOOSRL7W.js.map} +0 -0
- /package/dist/{image-ocr-CCLUXSWY.js.map → image-ocr-6HQTBMLN.js.map} +0 -0
- /package/dist/{image-ocr-B7RRK43I.js.map → image-ocr-RNY2H3HS.js.map} +0 -0
- /package/dist/{memo-SPNLGMIZ.js.map → memo-RE3TCSXK.js.map} +0 -0
- /package/dist/{model-bundle-KFPWVEFB.js.map → model-bundle-ZYGK4G65.js.map} +0 -0
- /package/dist/{models-IOX5WK67.js.map → models-K65TUK4Q.js.map} +0 -0
- /package/dist/{parse-worker-v2-IL6U65X3.js.map → parse-worker-v2-VOM4DPZV.js.map} +0 -0
- /package/dist/{pdf-ocr-7IH7FGKQ.js.map → pdf-ocr-2JDCK34V.js.map} +0 -0
- /package/dist/{pdf-ocr-ZUGHKM32.js.map → pdf-ocr-JNCOGFLO.js.map} +0 -0
- /package/dist/{profile-io-BGUQJDGK.js.map → profile-io-WHUZPJEM.js.map} +0 -0
- /package/dist/{rasterize-JOAG2QCQ.js.map → rasterize-XR5V2FQQ.js.map} +0 -0
- /package/dist/{redact-doc-WL2GWBMN.js.map → redact-doc-5FMV7KOY.js.map} +0 -0
- /package/dist/{render-672D354C.js.map → render-OKC4QJUY.js.map} +0 -0
- /package/dist/{rewrite-fallback-2JAAIU6G.js.map → rewrite-fallback-Y6ZUV6GG.js.map} +0 -0
- /package/dist/{seal-XLDIGIIE.js.map → seal-VMMMFVLG.js.map} +0 -0
- /package/dist/{setup-L4PVFG65.js.map → setup-Q6CIDVRW.js.map} +0 -0
- /package/dist/{to-hwpx-FR6GDNMY.js.map → to-hwpx-BS2NFDUM.js.map} +0 -0
- /package/dist/{to-hwpx-OHZK2KBP.js.map → to-hwpx-XFNMYMGR.js.map} +0 -0
- /package/dist/{visual-IXMRTYJK.js.map → visual-SECUV4LR.js.map} +0 -0
- /package/dist/{watch-OH4BMY2N.js.map → watch-ADXQOSZY.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkENGSBT44cjs = require('./chunk-ENGSBT44.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -9,11 +9,11 @@ var _chunkDIUYXWT2cjs = require('./chunk-DIUYXWT2.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkLHHZZVRDcjs = require('./chunk-LHHZZVRD.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkDZX2B4CBcjs = require('./chunk-DZX2B4CB.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 _chunkENGSBT44cjs.getModelsDir.call(void 0, "ppocr");
|
|
69
69
|
}
|
|
70
70
|
var DEFAULT_OCR_MODELS = Object.freeze({
|
|
71
71
|
det: { spec: OCR_DET_MODEL },
|
|
@@ -110,7 +110,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
|
|
|
110
110
|
if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
|
|
111
111
|
}
|
|
112
112
|
if (!todo.length) return;
|
|
113
|
-
await
|
|
113
|
+
await _chunkENGSBT44cjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
|
|
114
114
|
for (const spec of todo) {
|
|
115
115
|
const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
|
|
116
116
|
if (stamp) verifiedInProcess.set(path, stamp);
|
|
@@ -3414,16 +3414,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
|
|
|
3414
3414
|
}
|
|
3415
3415
|
function takeClipCellEdges(from, to) {
|
|
3416
3416
|
const e = CLIP_CELL_EDGES.get(from);
|
|
3417
|
-
if (e)
|
|
3417
|
+
if (e) _chunkLHHZZVRDcjs.CELL_EDGES.set(to, e);
|
|
3418
3418
|
}
|
|
3419
3419
|
function hasOpenCellSeam(a, b) {
|
|
3420
|
-
const u =
|
|
3420
|
+
const u = _chunkLHHZZVRDcjs.CELL_EDGES.get(a), d = _chunkLHHZZVRDcjs.CELL_EDGES.get(b);
|
|
3421
3421
|
return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
|
|
3422
3422
|
}
|
|
3423
3423
|
function joinCellEdges(a, b) {
|
|
3424
|
-
const u =
|
|
3424
|
+
const u = _chunkLHHZZVRDcjs.CELL_EDGES.get(a), d = _chunkLHHZZVRDcjs.CELL_EDGES.get(b);
|
|
3425
3425
|
if (!u || !d) return;
|
|
3426
|
-
|
|
3426
|
+
_chunkLHHZZVRDcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
3427
3427
|
}
|
|
3428
3428
|
|
|
3429
3429
|
// src/pdf/cell-extract.ts
|
|
@@ -3608,7 +3608,7 @@ function tagScripts(text, lines) {
|
|
|
3608
3608
|
const [s, e, kind] = marks[m];
|
|
3609
3609
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
3610
3610
|
}
|
|
3611
|
-
return
|
|
3611
|
+
return _chunkLHHZZVRDcjs.tidyScriptTags.call(void 0, out);
|
|
3612
3612
|
}
|
|
3613
3613
|
|
|
3614
3614
|
// src/pdf/line-wrap.ts
|
|
@@ -7207,9 +7207,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
7207
7207
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
7208
7208
|
const ratio = block.style.fontSize / medianFontSize;
|
|
7209
7209
|
let level = 0;
|
|
7210
|
-
if (ratio >=
|
|
7211
|
-
else if (ratio >=
|
|
7212
|
-
else if (ratio >=
|
|
7210
|
+
if (ratio >= _chunkLHHZZVRDcjs.HEADING_RATIO_H1) level = 1;
|
|
7211
|
+
else if (ratio >= _chunkLHHZZVRDcjs.HEADING_RATIO_H2) level = 2;
|
|
7212
|
+
else if (ratio >= _chunkLHHZZVRDcjs.HEADING_RATIO_H3) level = 3;
|
|
7213
7213
|
if (level > 0) {
|
|
7214
7214
|
block.type = "heading";
|
|
7215
7215
|
block.level = level;
|
|
@@ -7222,7 +7222,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
7222
7222
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _220 => _220.style, 'optionalAccess', _221 => _221.fontSize]), () => ( 0));
|
|
7223
7223
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _222 => _222.text, 'optionalAccess', _223 => _223.trim, 'call', _224 => _224()]), () => ( ""));
|
|
7224
7224
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _225 => _225.bbox]);
|
|
7225
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _226 => _226.text, 'optionalAccess', _227 => _227.trim, 'call', _228 => _228()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
7225
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _226 => _226.text, 'optionalAccess', _227 => _227.trim, 'call', _228 => _228()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkLHHZZVRDcjs.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;
|
|
7226
7226
|
}
|
|
7227
7227
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
7228
7228
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -8995,16 +8995,16 @@ function isProseSpread(items) {
|
|
|
8995
8995
|
for (let i = 1; i < sorted.length; i++) {
|
|
8996
8996
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
8997
8997
|
}
|
|
8998
|
-
const maxGap =
|
|
8998
|
+
const maxGap = _chunkDZX2B4CBcjs.safeMax.call(void 0, gaps);
|
|
8999
8999
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
9000
9000
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
9001
|
-
const minGap =
|
|
9001
|
+
const minGap = _chunkDZX2B4CBcjs.safeMin.call(void 0, gaps);
|
|
9002
9002
|
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)));
|
|
9003
9003
|
}
|
|
9004
9004
|
function detectColumns(yLines) {
|
|
9005
9005
|
const allItems = yLines.flat();
|
|
9006
9006
|
if (allItems.length === 0) return null;
|
|
9007
|
-
const pageWidth =
|
|
9007
|
+
const pageWidth = _chunkDZX2B4CBcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkDZX2B4CBcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
9008
9008
|
if (pageWidth < 100) return null;
|
|
9009
9009
|
let bigoLineIdx = -1;
|
|
9010
9010
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -9402,13 +9402,13 @@ function partTex(group) {
|
|
|
9402
9402
|
const base = Math.min(...g.filter((i) => i.fontSize >= size * SCRIPT_SIZE_RATIO).map((i) => i.y));
|
|
9403
9403
|
let s = "", run = "";
|
|
9404
9404
|
const flush = () => {
|
|
9405
|
-
if (run) s +=
|
|
9405
|
+
if (run) s += _chunkLHHZZVRDcjs.toTex.call(void 0, run);
|
|
9406
9406
|
run = "";
|
|
9407
9407
|
};
|
|
9408
9408
|
g.forEach((it, k) => {
|
|
9409
9409
|
if (it.fontSize < size * SCRIPT_SIZE_RATIO && it.y - base >= size * SCRIPT_RISE_EM) {
|
|
9410
9410
|
flush();
|
|
9411
|
-
s += `^{${
|
|
9411
|
+
s += `^{${_chunkLHHZZVRDcjs.toTex.call(void 0, it.text)}}`;
|
|
9412
9412
|
return;
|
|
9413
9413
|
}
|
|
9414
9414
|
if (k && it.x - (g[k - 1].x + g[k - 1].w) > spaceGapThreshold(it.fontSize)) run += " ";
|
|
@@ -9581,7 +9581,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
9581
9581
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
9582
9582
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
9583
9583
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
9584
|
-
for (const cell of cells[0])
|
|
9584
|
+
for (const cell of cells[0]) _chunkLHHZZVRDcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
9585
9585
|
for (const item of line) usedItems.add(item);
|
|
9586
9586
|
}
|
|
9587
9587
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -10163,7 +10163,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
10163
10163
|
const [label, spacer, title] = cells;
|
|
10164
10164
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
10165
10165
|
if (cells.some((c) => {
|
|
10166
|
-
const e =
|
|
10166
|
+
const e = _chunkLHHZZVRDcjs.CELL_EDGES.get(c);
|
|
10167
10167
|
return !e || e.t || e.b || e.l || e.r;
|
|
10168
10168
|
})) return;
|
|
10169
10169
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _420 => _420.fontSize]), () => ( 0));
|
|
@@ -10889,7 +10889,9 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10889
10889
|
fontName: i.fontName,
|
|
10890
10890
|
hasSpaceBefore: i.hasSpaceBefore,
|
|
10891
10891
|
syntheticSpace: i.syntheticSpace,
|
|
10892
|
-
spaceAfter: i.spaceAfter
|
|
10892
|
+
spaceAfter: i.spaceAfter,
|
|
10893
|
+
fx: i.fx,
|
|
10894
|
+
fw: i.fw
|
|
10893
10895
|
};
|
|
10894
10896
|
copyOcrTextGaps(i, item);
|
|
10895
10897
|
return item;
|
|
@@ -10935,7 +10937,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10935
10937
|
groupSizes.push(1);
|
|
10936
10938
|
}
|
|
10937
10939
|
const allY = remaining.map((i) => i.y);
|
|
10938
|
-
const pageH =
|
|
10940
|
+
const pageH = _chunkDZX2B4CBcjs.safeMax.call(void 0, allY) - _chunkDZX2B4CBcjs.safeMin.call(void 0, allY);
|
|
10939
10941
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
10940
10942
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
10941
10943
|
const textBlocks = [];
|
|
@@ -10951,7 +10953,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10951
10953
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
10952
10954
|
} else {
|
|
10953
10955
|
const allY = remaining.map((i) => i.y);
|
|
10954
|
-
const pageH =
|
|
10956
|
+
const pageH = _chunkDZX2B4CBcjs.safeMax.call(void 0, allY) - _chunkDZX2B4CBcjs.safeMin.call(void 0, allY);
|
|
10955
10957
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
10956
10958
|
const groups = xyCutOrder(remaining, gapThreshold, 0, void 0, 0, lex);
|
|
10957
10959
|
const textBlocks = [];
|
|
@@ -11246,7 +11248,9 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
11246
11248
|
fontName: i.fontName,
|
|
11247
11249
|
hasSpaceBefore: i.hasSpaceBefore,
|
|
11248
11250
|
syntheticSpace: i.syntheticSpace,
|
|
11249
|
-
spaceAfter: i.spaceAfter
|
|
11251
|
+
spaceAfter: i.spaceAfter,
|
|
11252
|
+
fx: i.fx,
|
|
11253
|
+
fw: i.fw
|
|
11250
11254
|
};
|
|
11251
11255
|
copyOcrTextGaps(i, item);
|
|
11252
11256
|
return item;
|
|
@@ -11313,7 +11317,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
11313
11317
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
11314
11318
|
} else {
|
|
11315
11319
|
const allY = items.map((i) => i.y);
|
|
11316
|
-
const pageHeight =
|
|
11320
|
+
const pageHeight = _chunkDZX2B4CBcjs.safeMax.call(void 0, allY) - _chunkDZX2B4CBcjs.safeMin.call(void 0, allY);
|
|
11317
11321
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
11318
11322
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap, lex);
|
|
11319
11323
|
for (const group of orderedGroups) {
|
|
@@ -11583,4 +11587,4 @@ function rowParagraphs(block) {
|
|
|
11583
11587
|
|
|
11584
11588
|
|
|
11585
11589
|
exports.DEFAULT_OCR_MODELS = DEFAULT_OCR_MODELS; exports.resolveOcrModels = resolveOcrModels; exports.handwritingFallbackModels = handwritingFallbackModels; 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.ringBoxes = ringBoxes; 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.stackedGlyphBands = stackedGlyphBands; 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;
|
|
11586
|
-
//# sourceMappingURL=chunk-
|
|
11590
|
+
//# sourceMappingURL=chunk-O5IIMWXC.cjs.map
|