kordoc 4.24.19 → 4.24.21
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 +5 -5
- package/dist/{-IFNBZFGR.js → -IS4RXPEZ.js} +11 -11
- package/dist/{chunk-2IFSM7ZE.js → chunk-3RVASM4C.js} +4 -4
- package/dist/{chunk-MHBJAY2T.js → chunk-4OF7DHIT.js} +4 -4
- package/dist/{chunk-IXCXFGYB.js → chunk-B3POEH7X.js} +2 -2
- package/dist/{chunk-XQJNL7TD.cjs → chunk-B5M676H3.cjs} +6 -6
- package/dist/{chunk-XQJNL7TD.cjs.map → chunk-B5M676H3.cjs.map} +1 -1
- package/dist/{chunk-XGUX3JDV.js → chunk-BMXWY36E.js} +4 -4
- package/dist/{chunk-DIDPIFGO.js → chunk-BNEKESI4.js} +2 -2
- package/dist/{chunk-UTDQAY35.js → chunk-BTBFKDPH.js} +2 -2
- package/dist/{chunk-OJL4V7WL.cjs → chunk-BUFGW3UJ.cjs} +25 -25
- package/dist/{chunk-OJL4V7WL.cjs.map → chunk-BUFGW3UJ.cjs.map} +1 -1
- package/dist/{chunk-Q6XWPGGB.js → chunk-BV2YG7M6.js} +2 -2
- package/dist/{chunk-MRFBERH2.js → chunk-CPVXUEKF.js} +2 -2
- package/dist/{chunk-UNTBPUY5.js → chunk-E6G4B457.js} +2 -2
- package/dist/{chunk-EEJKU5SD.js → chunk-F4GZFIUJ.js} +2 -2
- package/dist/{chunk-752MQ7LI.js → chunk-F6OHQLN7.js} +3 -3
- package/dist/{chunk-QQAANXHZ.js → chunk-IZN5BTCW.js} +2 -2
- package/dist/{chunk-RPHURU2B.cjs → chunk-L556KKBU.cjs} +79 -79
- package/dist/{chunk-RPHURU2B.cjs.map → chunk-L556KKBU.cjs.map} +1 -1
- package/dist/{chunk-TATLMLLJ.js → chunk-MGCIQ43Y.js} +3 -3
- package/dist/{chunk-MP6CLG5T.js → chunk-MMZUWRH6.js} +11 -11
- package/dist/{chunk-DCEXKPBH.js → chunk-MYDHNNPA.js} +92 -27
- package/dist/chunk-MYDHNNPA.js.map +1 -0
- package/dist/{chunk-WUU63RFU.js → chunk-N45RCYBL.js} +3 -3
- package/dist/{chunk-DTNNWOBN.js → chunk-NE75RO62.js} +2 -2
- package/dist/{chunk-OI4LVKFX.js → chunk-NRCG3ASU.js} +2 -2
- package/dist/{chunk-B4X2Q5MK.js → chunk-O5ZCJEZ4.js} +2 -2
- package/dist/{chunk-U4QSRBEV.cjs → chunk-OMGCVZ4W.cjs} +2 -2
- package/dist/{chunk-U4QSRBEV.cjs.map → chunk-OMGCVZ4W.cjs.map} +1 -1
- package/dist/{chunk-JQJYIYMJ.js → chunk-PDOWSDNM.js} +2 -2
- package/dist/{chunk-RQCGVE3R.js → chunk-UNYH6MTO.js} +2 -2
- package/dist/{chunk-4OWHKA6D.cjs → chunk-V7S36XCU.cjs} +3 -3
- package/dist/{chunk-4OWHKA6D.cjs.map → chunk-V7S36XCU.cjs.map} +1 -1
- package/dist/{chunk-X6GHZRPS.js → chunk-WQC4XWVT.js} +2 -2
- package/dist/{chunk-7RVG2IVX.cjs → chunk-WVZSTMCZ.cjs} +3 -3
- package/dist/{chunk-7RVG2IVX.cjs.map → chunk-WVZSTMCZ.cjs.map} +1 -1
- package/dist/{chunk-S4EPR2Q4.js → chunk-Z6ONQ63K.js} +2 -2
- package/dist/chunks-FYCQOIWO.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-IYTV7SBF.js → formula-DHBBWQLC.js} +3 -3
- package/dist/{formula-WSK7DHQS.cjs → formula-G3FQTUOY.cjs} +9 -9
- package/dist/{formula-WSK7DHQS.cjs.map → formula-G3FQTUOY.cjs.map} +1 -1
- package/dist/{formula-WSFS7D7Z.js → formula-I4EA7ULD.js} +4 -4
- package/dist/{image-ocr-Y75JNXPZ.js → image-ocr-5YWVBRY6.js} +6 -6
- package/dist/{image-ocr-AVMUMNAV.js → image-ocr-QUVBGNWD.js} +9 -9
- package/dist/{image-ocr-LWWF4HEE.cjs → image-ocr-THUO6YRG.cjs} +17 -17
- package/dist/{image-ocr-LWWF4HEE.cjs.map → image-ocr-THUO6YRG.cjs.map} +1 -1
- package/dist/index.cjs +510 -445
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +92 -27
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +23 -23
- package/dist/{model-bundle-JOACGE6A.js → model-bundle-6RG5PO3R.js} +5 -5
- package/dist/{models-RTSOF7XB.js → models-CGYIGN6D.js} +5 -5
- package/dist/{parse-worker-v2-GHCIS7RI.js → parse-worker-v2-F5NXYBU6.js} +12 -12
- package/dist/{parser-4NF5BGSC.js → parser-G5QTRKII.js} +9 -9
- package/dist/{parser-GJWAT5YG.cjs → parser-GJ4PKW7I.cjs} +159 -159
- package/dist/{parser-GJWAT5YG.cjs.map → parser-GJ4PKW7I.cjs.map} +1 -1
- package/dist/{parser-E7VENFW7.js → parser-I2C5DUXC.js} +12 -12
- package/dist/pdf-ocr-LJKCUXTE.cjs +35 -0
- package/dist/{pdf-ocr-J74A2ZQW.cjs.map → pdf-ocr-LJKCUXTE.cjs.map} +1 -1
- package/dist/{pdf-ocr-CJSC4DLZ.js → pdf-ocr-TNW6YOPX.js} +6 -6
- package/dist/{pdf-ocr-K4MHY4KP.js → pdf-ocr-U3I74Q4O.js} +9 -9
- package/dist/{profile-io-LA4LFEFV.js → profile-io-5YZCFK7B.js} +3 -3
- package/dist/{rasterize-PZ6VCPOZ.js → rasterize-7VRHPOQX.js} +3 -3
- package/dist/{redact-doc-HHDDIIV7.js → redact-doc-VK6VGBK3.js} +11 -11
- package/dist/{render-QIWXWLYC.js → render-Y7J6DPRL.js} +7 -7
- package/dist/seal-4QIZ3ZNI.js +10 -0
- package/dist/{setup-Y6EZH34Z.js → setup-4XTUDU4X.js} +3 -3
- package/dist/visual-VEMQJ52W.js +21 -0
- package/dist/{watch-LBRW6NAG.js → watch-SPZRLTKG.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-DCEXKPBH.js.map +0 -1
- package/dist/chunks-7ACTVPJJ.js +0 -10
- package/dist/pdf-ocr-J74A2ZQW.cjs +0 -35
- package/dist/seal-SBA3CFCC.js +0 -10
- package/dist/visual-PN3PUVDG.js +0 -21
- /package/dist/{-IFNBZFGR.js.map → -IS4RXPEZ.js.map} +0 -0
- /package/dist/{chunk-2IFSM7ZE.js.map → chunk-3RVASM4C.js.map} +0 -0
- /package/dist/{chunk-MHBJAY2T.js.map → chunk-4OF7DHIT.js.map} +0 -0
- /package/dist/{chunk-IXCXFGYB.js.map → chunk-B3POEH7X.js.map} +0 -0
- /package/dist/{chunk-XGUX3JDV.js.map → chunk-BMXWY36E.js.map} +0 -0
- /package/dist/{chunk-DIDPIFGO.js.map → chunk-BNEKESI4.js.map} +0 -0
- /package/dist/{chunk-UTDQAY35.js.map → chunk-BTBFKDPH.js.map} +0 -0
- /package/dist/{chunk-Q6XWPGGB.js.map → chunk-BV2YG7M6.js.map} +0 -0
- /package/dist/{chunk-MRFBERH2.js.map → chunk-CPVXUEKF.js.map} +0 -0
- /package/dist/{chunk-UNTBPUY5.js.map → chunk-E6G4B457.js.map} +0 -0
- /package/dist/{chunk-EEJKU5SD.js.map → chunk-F4GZFIUJ.js.map} +0 -0
- /package/dist/{chunk-752MQ7LI.js.map → chunk-F6OHQLN7.js.map} +0 -0
- /package/dist/{chunk-QQAANXHZ.js.map → chunk-IZN5BTCW.js.map} +0 -0
- /package/dist/{chunk-TATLMLLJ.js.map → chunk-MGCIQ43Y.js.map} +0 -0
- /package/dist/{chunk-MP6CLG5T.js.map → chunk-MMZUWRH6.js.map} +0 -0
- /package/dist/{chunk-WUU63RFU.js.map → chunk-N45RCYBL.js.map} +0 -0
- /package/dist/{chunk-DTNNWOBN.js.map → chunk-NE75RO62.js.map} +0 -0
- /package/dist/{chunk-OI4LVKFX.js.map → chunk-NRCG3ASU.js.map} +0 -0
- /package/dist/{chunk-B4X2Q5MK.js.map → chunk-O5ZCJEZ4.js.map} +0 -0
- /package/dist/{chunk-JQJYIYMJ.js.map → chunk-PDOWSDNM.js.map} +0 -0
- /package/dist/{chunk-RQCGVE3R.js.map → chunk-UNYH6MTO.js.map} +0 -0
- /package/dist/{chunk-X6GHZRPS.js.map → chunk-WQC4XWVT.js.map} +0 -0
- /package/dist/{chunk-S4EPR2Q4.js.map → chunk-Z6ONQ63K.js.map} +0 -0
- /package/dist/{chunks-7ACTVPJJ.js.map → chunks-FYCQOIWO.js.map} +0 -0
- /package/dist/{formula-IYTV7SBF.js.map → formula-DHBBWQLC.js.map} +0 -0
- /package/dist/{formula-WSFS7D7Z.js.map → formula-I4EA7ULD.js.map} +0 -0
- /package/dist/{image-ocr-Y75JNXPZ.js.map → image-ocr-5YWVBRY6.js.map} +0 -0
- /package/dist/{image-ocr-AVMUMNAV.js.map → image-ocr-QUVBGNWD.js.map} +0 -0
- /package/dist/{model-bundle-JOACGE6A.js.map → model-bundle-6RG5PO3R.js.map} +0 -0
- /package/dist/{models-RTSOF7XB.js.map → models-CGYIGN6D.js.map} +0 -0
- /package/dist/{parse-worker-v2-GHCIS7RI.js.map → parse-worker-v2-F5NXYBU6.js.map} +0 -0
- /package/dist/{parser-4NF5BGSC.js.map → parser-G5QTRKII.js.map} +0 -0
- /package/dist/{parser-E7VENFW7.js.map → parser-I2C5DUXC.js.map} +0 -0
- /package/dist/{pdf-ocr-CJSC4DLZ.js.map → pdf-ocr-TNW6YOPX.js.map} +0 -0
- /package/dist/{pdf-ocr-K4MHY4KP.js.map → pdf-ocr-U3I74Q4O.js.map} +0 -0
- /package/dist/{profile-io-LA4LFEFV.js.map → profile-io-5YZCFK7B.js.map} +0 -0
- /package/dist/{rasterize-PZ6VCPOZ.js.map → rasterize-7VRHPOQX.js.map} +0 -0
- /package/dist/{redact-doc-HHDDIIV7.js.map → redact-doc-VK6VGBK3.js.map} +0 -0
- /package/dist/{render-QIWXWLYC.js.map → render-Y7J6DPRL.js.map} +0 -0
- /package/dist/{seal-SBA3CFCC.js.map → seal-4QIZ3ZNI.js.map} +0 -0
- /package/dist/{setup-Y6EZH34Z.js.map → setup-4XTUDU4X.js.map} +0 -0
- /package/dist/{visual-PN3PUVDG.js.map → visual-VEMQJ52W.js.map} +0 -0
- /package/dist/{watch-LBRW6NAG.js.map → watch-SPZRLTKG.js.map} +0 -0
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
HEADING_RATIO_H3,
|
|
6
6
|
tidyScriptTags,
|
|
7
7
|
toTex
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PDOWSDNM.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureModelsIn,
|
|
11
11
|
getModelsDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NE75RO62.js";
|
|
13
13
|
import {
|
|
14
14
|
safeMax,
|
|
15
15
|
safeMin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UNYH6MTO.js";
|
|
17
17
|
|
|
18
18
|
// src/ocr/models.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -10510,4 +10510,4 @@ export {
|
|
|
10510
10510
|
UNRULED_REGION_TABLES,
|
|
10511
10511
|
mergeOcrImageRegions
|
|
10512
10512
|
};
|
|
10513
|
-
//# sourceMappingURL=chunk-
|
|
10513
|
+
//# sourceMappingURL=chunk-BMXWY36E.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
assignTableIds,
|
|
4
4
|
blocksToMarkdown
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-B3POEH7X.js";
|
|
6
6
|
|
|
7
7
|
// src/chunks.ts
|
|
8
8
|
var LIST_MARKER_RE = /^(?:[□■◇◆○◎●◦ㅇ•▪▸▶※-]|\d{1,3}[.)]|[가나다라마바사아자차카타파하][.)]|\([가나다라마바사아자차카타파하0-9]{1,3}\)|[①-⑳㉮-㉻㈎-㈛])\s/;
|
|
@@ -82,4 +82,4 @@ function blocksToChunks(blocks, options) {
|
|
|
82
82
|
export {
|
|
83
83
|
blocksToChunks
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-BNEKESI4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToMarkdown
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B3POEH7X.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-BTBFKDPH.js.map
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkB5M676H3cjs = require('./chunk-B5M676H3.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkV7S36XCUcjs = require('./chunk-V7S36XCU.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkOMGCVZ4Wcjs = require('./chunk-OMGCVZ4W.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 _chunkV7S36XCUcjs.getModelsDir.call(void 0, "ppocr");
|
|
69
69
|
}
|
|
70
70
|
var DEFAULT_OCR_MODELS = Object.freeze({
|
|
71
71
|
det: { spec: OCR_DET_MODEL },
|
|
@@ -107,7 +107,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
|
|
|
107
107
|
if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
|
|
108
108
|
}
|
|
109
109
|
if (!todo.length) return;
|
|
110
|
-
await
|
|
110
|
+
await _chunkV7S36XCUcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
|
|
111
111
|
for (const spec of todo) {
|
|
112
112
|
const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
|
|
113
113
|
if (stamp) verifiedInProcess.set(path, stamp);
|
|
@@ -3154,16 +3154,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
function takeClipCellEdges(from, to) {
|
|
3156
3156
|
const e = CLIP_CELL_EDGES.get(from);
|
|
3157
|
-
if (e)
|
|
3157
|
+
if (e) _chunkB5M676H3cjs.CELL_EDGES.set(to, e);
|
|
3158
3158
|
}
|
|
3159
3159
|
function hasOpenCellSeam(a, b) {
|
|
3160
|
-
const u =
|
|
3160
|
+
const u = _chunkB5M676H3cjs.CELL_EDGES.get(a), d = _chunkB5M676H3cjs.CELL_EDGES.get(b);
|
|
3161
3161
|
return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
|
|
3162
3162
|
}
|
|
3163
3163
|
function joinCellEdges(a, b) {
|
|
3164
|
-
const u =
|
|
3164
|
+
const u = _chunkB5M676H3cjs.CELL_EDGES.get(a), d = _chunkB5M676H3cjs.CELL_EDGES.get(b);
|
|
3165
3165
|
if (!u || !d) return;
|
|
3166
|
-
|
|
3166
|
+
_chunkB5M676H3cjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
3167
3167
|
}
|
|
3168
3168
|
|
|
3169
3169
|
// src/pdf/cell-extract.ts
|
|
@@ -3339,7 +3339,7 @@ function tagScripts(text, lines) {
|
|
|
3339
3339
|
const [s, e, kind] = marks[m];
|
|
3340
3340
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
3341
3341
|
}
|
|
3342
|
-
return
|
|
3342
|
+
return _chunkB5M676H3cjs.tidyScriptTags.call(void 0, out);
|
|
3343
3343
|
}
|
|
3344
3344
|
|
|
3345
3345
|
// src/pdf/line-wrap.ts
|
|
@@ -6598,9 +6598,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
6598
6598
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
6599
6599
|
const ratio = block.style.fontSize / medianFontSize;
|
|
6600
6600
|
let level = 0;
|
|
6601
|
-
if (ratio >=
|
|
6602
|
-
else if (ratio >=
|
|
6603
|
-
else if (ratio >=
|
|
6601
|
+
if (ratio >= _chunkB5M676H3cjs.HEADING_RATIO_H1) level = 1;
|
|
6602
|
+
else if (ratio >= _chunkB5M676H3cjs.HEADING_RATIO_H2) level = 2;
|
|
6603
|
+
else if (ratio >= _chunkB5M676H3cjs.HEADING_RATIO_H3) level = 3;
|
|
6604
6604
|
if (level > 0) {
|
|
6605
6605
|
block.type = "heading";
|
|
6606
6606
|
block.level = level;
|
|
@@ -6613,7 +6613,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
6613
6613
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _174 => _174.style, 'optionalAccess', _175 => _175.fontSize]), () => ( 0));
|
|
6614
6614
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _176 => _176.text, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()]), () => ( ""));
|
|
6615
6615
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _179 => _179.bbox]);
|
|
6616
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _180 => _180.text, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
6616
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _180 => _180.text, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkB5M676H3cjs.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;
|
|
6617
6617
|
}
|
|
6618
6618
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
6619
6619
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -8151,16 +8151,16 @@ function isProseSpread(items) {
|
|
|
8151
8151
|
for (let i = 1; i < sorted.length; i++) {
|
|
8152
8152
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
8153
8153
|
}
|
|
8154
|
-
const maxGap =
|
|
8154
|
+
const maxGap = _chunkOMGCVZ4Wcjs.safeMax.call(void 0, gaps);
|
|
8155
8155
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
8156
8156
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
8157
|
-
const minGap =
|
|
8157
|
+
const minGap = _chunkOMGCVZ4Wcjs.safeMin.call(void 0, gaps);
|
|
8158
8158
|
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)));
|
|
8159
8159
|
}
|
|
8160
8160
|
function detectColumns(yLines) {
|
|
8161
8161
|
const allItems = yLines.flat();
|
|
8162
8162
|
if (allItems.length === 0) return null;
|
|
8163
|
-
const pageWidth =
|
|
8163
|
+
const pageWidth = _chunkOMGCVZ4Wcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkOMGCVZ4Wcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
8164
8164
|
if (pageWidth < 100) return null;
|
|
8165
8165
|
let bigoLineIdx = -1;
|
|
8166
8166
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -8558,13 +8558,13 @@ function partTex(group) {
|
|
|
8558
8558
|
const base = Math.min(...g.filter((i) => i.fontSize >= size * SCRIPT_SIZE_RATIO).map((i) => i.y));
|
|
8559
8559
|
let s = "", run = "";
|
|
8560
8560
|
const flush = () => {
|
|
8561
|
-
if (run) s +=
|
|
8561
|
+
if (run) s += _chunkB5M676H3cjs.toTex.call(void 0, run);
|
|
8562
8562
|
run = "";
|
|
8563
8563
|
};
|
|
8564
8564
|
g.forEach((it, k) => {
|
|
8565
8565
|
if (it.fontSize < size * SCRIPT_SIZE_RATIO && it.y - base >= size * SCRIPT_RISE_EM) {
|
|
8566
8566
|
flush();
|
|
8567
|
-
s += `^{${
|
|
8567
|
+
s += `^{${_chunkB5M676H3cjs.toTex.call(void 0, it.text)}}`;
|
|
8568
8568
|
return;
|
|
8569
8569
|
}
|
|
8570
8570
|
if (k && it.x - (g[k - 1].x + g[k - 1].w) > spaceGapThreshold(it.fontSize)) run += " ";
|
|
@@ -8736,7 +8736,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
8736
8736
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
8737
8737
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
8738
8738
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
8739
|
-
for (const cell of cells[0])
|
|
8739
|
+
for (const cell of cells[0]) _chunkB5M676H3cjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
8740
8740
|
for (const item of line) usedItems.add(item);
|
|
8741
8741
|
}
|
|
8742
8742
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -9318,7 +9318,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
9318
9318
|
const [label, spacer, title] = cells;
|
|
9319
9319
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
9320
9320
|
if (cells.some((c) => {
|
|
9321
|
-
const e =
|
|
9321
|
+
const e = _chunkB5M676H3cjs.CELL_EDGES.get(c);
|
|
9322
9322
|
return !e || e.t || e.b || e.l || e.r;
|
|
9323
9323
|
})) return;
|
|
9324
9324
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _373 => _373.fontSize]), () => ( 0));
|
|
@@ -9920,7 +9920,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9920
9920
|
groupSizes.push(1);
|
|
9921
9921
|
}
|
|
9922
9922
|
const allY = remaining.map((i) => i.y);
|
|
9923
|
-
const pageH =
|
|
9923
|
+
const pageH = _chunkOMGCVZ4Wcjs.safeMax.call(void 0, allY) - _chunkOMGCVZ4Wcjs.safeMin.call(void 0, allY);
|
|
9924
9924
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
9925
9925
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
9926
9926
|
const textBlocks = [];
|
|
@@ -9936,7 +9936,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
9936
9936
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
9937
9937
|
} else {
|
|
9938
9938
|
const allY = remaining.map((i) => i.y);
|
|
9939
|
-
const pageH =
|
|
9939
|
+
const pageH = _chunkOMGCVZ4Wcjs.safeMax.call(void 0, allY) - _chunkOMGCVZ4Wcjs.safeMin.call(void 0, allY);
|
|
9940
9940
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
9941
9941
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
9942
9942
|
const textBlocks = [];
|
|
@@ -10268,7 +10268,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
10268
10268
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
10269
10269
|
} else {
|
|
10270
10270
|
const allY = items.map((i) => i.y);
|
|
10271
|
-
const pageHeight =
|
|
10271
|
+
const pageHeight = _chunkOMGCVZ4Wcjs.safeMax.call(void 0, allY) - _chunkOMGCVZ4Wcjs.safeMin.call(void 0, allY);
|
|
10272
10272
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
10273
10273
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
10274
10274
|
for (const group of orderedGroups) {
|
|
@@ -10510,4 +10510,4 @@ function rowParagraphs(block) {
|
|
|
10510
10510
|
|
|
10511
10511
|
|
|
10512
10512
|
exports.DEFAULT_OCR_MODELS = DEFAULT_OCR_MODELS; exports.resolveOcrModels = resolveOcrModels; exports.ocrSelectionKey = ocrSelectionKey; exports.ocrSourcePath = ocrSourcePath; exports.ensureOcrModelsFor = ensureOcrModelsFor; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.grayCrop = grayCrop; exports.inkStats = inkStats; exports.splitRowBands = splitRowBands; exports.leadingTriangle = leadingTriangle; exports.arrowGlyph = arrowGlyph; exports.leaderRuns = leaderRuns; exports.inkBounds = inkBounds; exports.bracketFeatures = bracketFeatures; exports.slantedPair = slantedPair; exports.romanStems = romanStems; exports.circledAt = circledAt; exports.quoteHead = quoteHead; exports.edgeTrim = edgeTrim; exports.tallInkCount = tallInkCount; exports.gapGlyphs = gapGlyphs; exports.ringBullet = ringBullet; exports.dashRatio = dashRatio; exports.leadingRing = leadingRing; exports.discAt = discAt; exports.serifOne = serifOne; exports.starRun = starRun; exports.bracketShape = bracketShape; exports.leadingBullet = leadingBullet; exports.rememberOcrTextGaps = rememberOcrTextGaps; exports.copyOcrTextGaps = copyOcrTextGaps; exports.findOcrTextGaps = findOcrTextGaps; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; exports.NO_EDGES = NO_EDGES; exports.hasOpenCellSeam = hasOpenCellSeam; exports.joinCellEdges = joinCellEdges; exports.filterHiddenText = filterHiddenText; exports.collapseEvenSpacing = collapseEvenSpacing; exports.computeBBox = computeBBox; exports.dominantStyle = dominantStyle; exports.normalizeItems = normalizeItems; exports.groupByY = groupByY; exports.mergeLineSimple = mergeLineSimple; exports.WrapLexicon = WrapLexicon; exports.startsNewItem = startsNewItem; exports.wrapJoiner = wrapJoiner; exports.joinPageBreakWraps = joinPageBreakWraps; exports.splitPageBreakWraps = splitPageBreakWraps; exports.latinSoftWrap = latinSoftWrap; exports.TOC_BLOCKS = TOC_BLOCKS; exports.computeMedianFontSizeFromFreq = computeMedianFontSizeFromFreq; exports.detectHeadings = detectHeadings; exports.mergeStackedHeadingLines = mergeStackedHeadingLines; exports.detectTypographyHeadings = detectTypographyHeadings; exports.detectDocumentStyleHeadings = detectDocumentStyleHeadings; exports.detectSiblingStyleHeadings = detectSiblingStyleHeadings; exports.detectRepeatedPageLabels = detectRepeatedPageLabels; exports.detectPageLeadHeadings = detectPageLeadHeadings; exports.refineDocumentStyleHeadings = refineDocumentStyleHeadings; exports.detectMarkerHeadings = detectMarkerHeadings; exports.detectTableCaptions = detectTableCaptions; exports.detectKoreanListBlocks = detectKoreanListBlocks; exports.removeHeaderFooterBlocks = removeHeaderFooterBlocks; exports.runningLinePatterns = runningLinePatterns; exports.stripAbsorbedRunningLines = stripAbsorbedRunningLines; exports.CLIP_TABLES = CLIP_TABLES; exports.FRAME_TITLE_BLOCKS = FRAME_TITLE_BLOCKS; exports.TABLE_COLXS = TABLE_COLXS; exports.TABLE_ROWYS = TABLE_ROWYS; exports.TABLE_TAIL = TABLE_TAIL; exports.PART_COLXS = PART_COLXS; exports.EMPTY_PARTS = EMPTY_PARTS; exports.IMAGE_CELLS = IMAGE_CELLS; exports.FILLER_CELLS = FILLER_CELLS; exports.CONT_PARTS = CONT_PARTS; exports.CELL_LINES = CELL_LINES; exports.ROW_RULES = ROW_RULES; exports.trimTrailingEmptyTableCols = trimTrailingEmptyTableCols; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines; exports.UNRULED_REGION_TABLES = UNRULED_REGION_TABLES; exports.mergeOcrImageRegions = mergeOcrImageRegions;
|
|
10513
|
-
//# sourceMappingURL=chunk-
|
|
10513
|
+
//# sourceMappingURL=chunk-BUFGW3UJ.cjs.map
|