kordoc 4.24.2 → 4.24.3
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 +12 -10
- package/dist/{-SRNEV7LS.js → -Q56U3KCA.js} +11 -11
- package/dist/{chunk-E7B5CXYI.js → chunk-33NZN73M.js} +2 -2
- package/dist/{chunk-NJ5RUDCW.js → chunk-3EWXRIPH.js} +3 -3
- package/dist/{chunk-NMFFIUI6.js → chunk-42FSKT7R.js} +2 -2
- package/dist/{chunk-M46PB75E.js → chunk-4X73CGIL.js} +2 -2
- package/dist/{chunk-PNSALBXH.cjs → chunk-6ZRZLV3J.cjs} +2 -2
- package/dist/{chunk-PNSALBXH.cjs.map → chunk-6ZRZLV3J.cjs.map} +1 -1
- package/dist/{chunk-W24TJJNN.js → chunk-AEEQN6L3.js} +2 -2
- package/dist/{chunk-TW3V6FSH.js → chunk-EEXIFCXC.js} +2 -2
- package/dist/{chunk-LMEF7FN5.js → chunk-EWCJCWTT.js} +2 -2
- package/dist/{chunk-MHNJOJQV.js → chunk-FZT34MUI.js} +4 -4
- package/dist/{chunk-WDSTW3BD.js → chunk-HNX2I7D6.js} +2 -2
- package/dist/{chunk-PNX5FYHC.cjs → chunk-HTG3VVET.cjs} +24 -24
- package/dist/{chunk-PNX5FYHC.cjs.map → chunk-HTG3VVET.cjs.map} +1 -1
- package/dist/{chunk-KUC5I5MB.js → chunk-HU7POUBS.js} +2 -2
- package/dist/{chunk-WJAFE3Z6.js → chunk-I2QETSZN.js} +2 -2
- package/dist/{chunk-DHMBPMKC.js → chunk-J45OVEUM.js} +139 -15
- package/dist/chunk-J45OVEUM.js.map +1 -0
- package/dist/{chunk-UNICY546.cjs → chunk-JILIA5EV.cjs} +23 -23
- package/dist/{chunk-UNICY546.cjs.map → chunk-JILIA5EV.cjs.map} +1 -1
- package/dist/{chunk-TDMBTG7U.js → chunk-KXHNIHLC.js} +2 -2
- package/dist/{chunk-JFUUFJZW.cjs → chunk-N65EY5BI.cjs} +6 -6
- package/dist/{chunk-JFUUFJZW.cjs.map → chunk-N65EY5BI.cjs.map} +1 -1
- package/dist/{chunk-4XC4O7FJ.js → chunk-NKDPCALC.js} +4 -4
- package/dist/{chunk-C6ZVB547.js → chunk-OAOM7IEI.js} +11 -11
- package/dist/{chunk-4745MFQU.js → chunk-PHZDAHZC.js} +3 -3
- package/dist/{chunk-RIRPLFPN.js → chunk-PMX5CPK5.js} +2 -2
- package/dist/{chunk-E6VBLBOO.js → chunk-Q2QKRE4P.js} +2 -2
- package/dist/{chunk-7NTMM6PO.js → chunk-TZ753B6A.js} +2 -2
- package/dist/{chunk-HLTPMSYW.cjs → chunk-VFEI2GIE.cjs} +3 -3
- package/dist/{chunk-HLTPMSYW.cjs.map → chunk-VFEI2GIE.cjs.map} +1 -1
- package/dist/{chunk-3HN65YAL.js → chunk-W6O7KBOD.js} +2 -2
- package/dist/{chunk-VPSF5LEM.js → chunk-XAZ5RGVG.js} +3 -3
- package/dist/{chunk-R2GIGE5H.js → chunk-XNNMMYFO.js} +2 -2
- package/dist/{chunk-JMOAMKAR.js → chunk-XZOAE2Q7.js} +4 -4
- package/dist/{chunk-IGG63DFK.cjs → chunk-YG4YOPK6.cjs} +3 -3
- package/dist/{chunk-IGG63DFK.cjs.map → chunk-YG4YOPK6.cjs.map} +1 -1
- package/dist/chunks-REYSCBPB.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-HK2MNZ3Q.cjs → formula-2BPHF6O7.cjs} +9 -9
- package/dist/{formula-HK2MNZ3Q.cjs.map → formula-2BPHF6O7.cjs.map} +1 -1
- package/dist/{formula-DSB574H7.js → formula-EA5GDCUD.js} +4 -4
- package/dist/{formula-U2LZ67KI.js → formula-IREEAC4T.js} +3 -3
- package/dist/{image-ocr-QNIMVE5A.cjs → image-ocr-CCTE7HX3.cjs} +17 -17
- package/dist/{image-ocr-QNIMVE5A.cjs.map → image-ocr-CCTE7HX3.cjs.map} +1 -1
- package/dist/{image-ocr-J54Q3YWP.js → image-ocr-JQJC5HWK.js} +6 -6
- package/dist/{image-ocr-3QB2HLSI.js → image-ocr-LGOFUS3O.js} +9 -9
- package/dist/index.cjs +517 -393
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +139 -15
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +23 -23
- package/dist/{model-bundle-CGWU4ALC.js → model-bundle-YW62Y6UD.js} +5 -5
- package/dist/{models-A3TF3BDV.js → models-AAL3IS2R.js} +5 -5
- package/dist/{parse-worker-v2-MNUD4WAR.js → parse-worker-v2-3JAHV7NY.js} +12 -12
- package/dist/{parser-C3ARF26I.js → parser-4FCKKJ2N.js} +18 -14
- package/dist/parser-4FCKKJ2N.js.map +1 -0
- package/dist/{parser-RPAHN3OR.cjs → parser-HE45CCSG.cjs} +163 -159
- package/dist/parser-HE45CCSG.cjs.map +1 -0
- package/dist/{parser-OBGWEWSU.js → parser-ZBP5GOQK.js} +15 -11
- package/dist/parser-ZBP5GOQK.js.map +1 -0
- package/dist/pdf-ocr-7MDCLWAA.cjs +31 -0
- package/dist/{pdf-ocr-GA5QJFNK.cjs.map → pdf-ocr-7MDCLWAA.cjs.map} +1 -1
- package/dist/{pdf-ocr-K53REDNY.js → pdf-ocr-HFAEOA7W.js} +6 -6
- package/dist/{pdf-ocr-ENLVEEYL.js → pdf-ocr-Q4TPGDDI.js} +9 -9
- package/dist/{profile-io-ZGFEO7CB.js → profile-io-EDQTKLLL.js} +3 -3
- package/dist/{rasterize-QMC2SAUT.js → rasterize-VD2XGHUJ.js} +3 -3
- package/dist/{redact-doc-JH6RZZBE.js → redact-doc-TBIBQJCT.js} +11 -11
- package/dist/{render-ZGKQLKPJ.js → render-J5KAZAQH.js} +7 -7
- package/dist/seal-H2JNAZU7.js +10 -0
- package/dist/{setup-LAQGCYQ2.js → setup-5LYHCQRU.js} +3 -3
- package/dist/visual-7EO6GR3M.js +21 -0
- package/dist/{watch-7YPB4TKC.js → watch-YP4IWM75.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-DHMBPMKC.js.map +0 -1
- package/dist/chunks-AL4P5TO5.js +0 -10
- package/dist/parser-C3ARF26I.js.map +0 -1
- package/dist/parser-OBGWEWSU.js.map +0 -1
- package/dist/parser-RPAHN3OR.cjs.map +0 -1
- package/dist/pdf-ocr-GA5QJFNK.cjs +0 -31
- package/dist/seal-KMGYTJAV.js +0 -10
- package/dist/visual-4OYJFGXL.js +0 -21
- /package/dist/{-SRNEV7LS.js.map → -Q56U3KCA.js.map} +0 -0
- /package/dist/{chunk-E7B5CXYI.js.map → chunk-33NZN73M.js.map} +0 -0
- /package/dist/{chunk-NJ5RUDCW.js.map → chunk-3EWXRIPH.js.map} +0 -0
- /package/dist/{chunk-NMFFIUI6.js.map → chunk-42FSKT7R.js.map} +0 -0
- /package/dist/{chunk-M46PB75E.js.map → chunk-4X73CGIL.js.map} +0 -0
- /package/dist/{chunk-W24TJJNN.js.map → chunk-AEEQN6L3.js.map} +0 -0
- /package/dist/{chunk-TW3V6FSH.js.map → chunk-EEXIFCXC.js.map} +0 -0
- /package/dist/{chunk-LMEF7FN5.js.map → chunk-EWCJCWTT.js.map} +0 -0
- /package/dist/{chunk-MHNJOJQV.js.map → chunk-FZT34MUI.js.map} +0 -0
- /package/dist/{chunk-WDSTW3BD.js.map → chunk-HNX2I7D6.js.map} +0 -0
- /package/dist/{chunk-KUC5I5MB.js.map → chunk-HU7POUBS.js.map} +0 -0
- /package/dist/{chunk-WJAFE3Z6.js.map → chunk-I2QETSZN.js.map} +0 -0
- /package/dist/{chunk-TDMBTG7U.js.map → chunk-KXHNIHLC.js.map} +0 -0
- /package/dist/{chunk-4XC4O7FJ.js.map → chunk-NKDPCALC.js.map} +0 -0
- /package/dist/{chunk-C6ZVB547.js.map → chunk-OAOM7IEI.js.map} +0 -0
- /package/dist/{chunk-4745MFQU.js.map → chunk-PHZDAHZC.js.map} +0 -0
- /package/dist/{chunk-RIRPLFPN.js.map → chunk-PMX5CPK5.js.map} +0 -0
- /package/dist/{chunk-E6VBLBOO.js.map → chunk-Q2QKRE4P.js.map} +0 -0
- /package/dist/{chunk-7NTMM6PO.js.map → chunk-TZ753B6A.js.map} +0 -0
- /package/dist/{chunk-3HN65YAL.js.map → chunk-W6O7KBOD.js.map} +0 -0
- /package/dist/{chunk-VPSF5LEM.js.map → chunk-XAZ5RGVG.js.map} +0 -0
- /package/dist/{chunk-R2GIGE5H.js.map → chunk-XNNMMYFO.js.map} +0 -0
- /package/dist/{chunk-JMOAMKAR.js.map → chunk-XZOAE2Q7.js.map} +0 -0
- /package/dist/{chunks-AL4P5TO5.js.map → chunks-REYSCBPB.js.map} +0 -0
- /package/dist/{formula-DSB574H7.js.map → formula-EA5GDCUD.js.map} +0 -0
- /package/dist/{formula-U2LZ67KI.js.map → formula-IREEAC4T.js.map} +0 -0
- /package/dist/{image-ocr-J54Q3YWP.js.map → image-ocr-JQJC5HWK.js.map} +0 -0
- /package/dist/{image-ocr-3QB2HLSI.js.map → image-ocr-LGOFUS3O.js.map} +0 -0
- /package/dist/{model-bundle-CGWU4ALC.js.map → model-bundle-YW62Y6UD.js.map} +0 -0
- /package/dist/{models-A3TF3BDV.js.map → models-AAL3IS2R.js.map} +0 -0
- /package/dist/{parse-worker-v2-MNUD4WAR.js.map → parse-worker-v2-3JAHV7NY.js.map} +0 -0
- /package/dist/{pdf-ocr-ENLVEEYL.js.map → pdf-ocr-HFAEOA7W.js.map} +0 -0
- /package/dist/{pdf-ocr-K53REDNY.js.map → pdf-ocr-Q4TPGDDI.js.map} +0 -0
- /package/dist/{profile-io-ZGFEO7CB.js.map → profile-io-EDQTKLLL.js.map} +0 -0
- /package/dist/{rasterize-QMC2SAUT.js.map → rasterize-VD2XGHUJ.js.map} +0 -0
- /package/dist/{redact-doc-JH6RZZBE.js.map → redact-doc-TBIBQJCT.js.map} +0 -0
- /package/dist/{render-ZGKQLKPJ.js.map → render-J5KAZAQH.js.map} +0 -0
- /package/dist/{seal-KMGYTJAV.js.map → seal-H2JNAZU7.js.map} +0 -0
- /package/dist/{setup-LAQGCYQ2.js.map → setup-5LYHCQRU.js.map} +0 -0
- /package/dist/{visual-4OYJFGXL.js.map → visual-7EO6GR3M.js.map} +0 -0
- /package/dist/{watch-7YPB4TKC.js.map → watch-YP4IWM75.js.map} +0 -0
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkN65EY5BIcjs = require('./chunk-N65EY5BI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkVFEI2GIEcjs = require('./chunk-VFEI2GIE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk6ZRZLV3Jcjs = require('./chunk-6ZRZLV3J.cjs');
|
|
16
16
|
|
|
17
17
|
// src/ocr/models.ts
|
|
18
18
|
var _path = require('path');
|
|
@@ -56,7 +56,7 @@ var OCR_REC_DICT = {
|
|
|
56
56
|
sizeMb: 1
|
|
57
57
|
};
|
|
58
58
|
function getOcrModelsDir() {
|
|
59
|
-
return
|
|
59
|
+
return _chunkVFEI2GIEcjs.getModelsDir.call(void 0, "ppocr");
|
|
60
60
|
}
|
|
61
61
|
var DEFAULT_OCR_MODELS = Object.freeze({
|
|
62
62
|
det: { spec: OCR_DET_MODEL },
|
|
@@ -98,7 +98,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
|
|
|
98
98
|
if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
|
|
99
99
|
}
|
|
100
100
|
if (!todo.length) return;
|
|
101
|
-
await
|
|
101
|
+
await _chunkVFEI2GIEcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
|
|
102
102
|
for (const spec of todo) {
|
|
103
103
|
const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
|
|
104
104
|
if (stamp) verifiedInProcess.set(path, stamp);
|
|
@@ -2147,16 +2147,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
|
|
|
2147
2147
|
}
|
|
2148
2148
|
function takeClipCellEdges(from, to) {
|
|
2149
2149
|
const e = CLIP_CELL_EDGES.get(from);
|
|
2150
|
-
if (e)
|
|
2150
|
+
if (e) _chunkN65EY5BIcjs.CELL_EDGES.set(to, e);
|
|
2151
2151
|
}
|
|
2152
2152
|
function hasOpenCellSeam(a, b) {
|
|
2153
|
-
const u =
|
|
2153
|
+
const u = _chunkN65EY5BIcjs.CELL_EDGES.get(a), d = _chunkN65EY5BIcjs.CELL_EDGES.get(b);
|
|
2154
2154
|
return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
|
|
2155
2155
|
}
|
|
2156
2156
|
function joinCellEdges(a, b) {
|
|
2157
|
-
const u =
|
|
2157
|
+
const u = _chunkN65EY5BIcjs.CELL_EDGES.get(a), d = _chunkN65EY5BIcjs.CELL_EDGES.get(b);
|
|
2158
2158
|
if (!u || !d) return;
|
|
2159
|
-
|
|
2159
|
+
_chunkN65EY5BIcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
2160
2160
|
}
|
|
2161
2161
|
|
|
2162
2162
|
// src/pdf/cell-extract.ts
|
|
@@ -2332,7 +2332,7 @@ function tagScripts(text, lines) {
|
|
|
2332
2332
|
const [s, e, kind] = marks[m];
|
|
2333
2333
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2334
2334
|
}
|
|
2335
|
-
return
|
|
2335
|
+
return _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, out);
|
|
2336
2336
|
}
|
|
2337
2337
|
|
|
2338
2338
|
// src/pdf/line-wrap.ts
|
|
@@ -5391,9 +5391,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
5391
5391
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
5392
5392
|
const ratio = block.style.fontSize / medianFontSize;
|
|
5393
5393
|
let level = 0;
|
|
5394
|
-
if (ratio >=
|
|
5395
|
-
else if (ratio >=
|
|
5396
|
-
else if (ratio >=
|
|
5394
|
+
if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H1) level = 1;
|
|
5395
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H2) level = 2;
|
|
5396
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H3) level = 3;
|
|
5397
5397
|
if (level > 0) {
|
|
5398
5398
|
block.type = "heading";
|
|
5399
5399
|
block.level = level;
|
|
@@ -5406,7 +5406,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
5406
5406
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _159 => _159.style, 'optionalAccess', _160 => _160.fontSize]), () => ( 0));
|
|
5407
5407
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _161 => _161.text, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()]), () => ( ""));
|
|
5408
5408
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _164 => _164.bbox]);
|
|
5409
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _165 => _165.text, 'optionalAccess', _166 => _166.trim, 'call', _167 => _167()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
5409
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _165 => _165.text, 'optionalAccess', _166 => _166.trim, 'call', _167 => _167()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkN65EY5BIcjs.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;
|
|
5410
5410
|
}
|
|
5411
5411
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
5412
5412
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -6944,16 +6944,16 @@ function isProseSpread(items) {
|
|
|
6944
6944
|
for (let i = 1; i < sorted.length; i++) {
|
|
6945
6945
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
6946
6946
|
}
|
|
6947
|
-
const maxGap =
|
|
6947
|
+
const maxGap = _chunk6ZRZLV3Jcjs.safeMax.call(void 0, gaps);
|
|
6948
6948
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
6949
6949
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
6950
|
-
const minGap =
|
|
6950
|
+
const minGap = _chunk6ZRZLV3Jcjs.safeMin.call(void 0, gaps);
|
|
6951
6951
|
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)));
|
|
6952
6952
|
}
|
|
6953
6953
|
function detectColumns(yLines) {
|
|
6954
6954
|
const allItems = yLines.flat();
|
|
6955
6955
|
if (allItems.length === 0) return null;
|
|
6956
|
-
const pageWidth =
|
|
6956
|
+
const pageWidth = _chunk6ZRZLV3Jcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunk6ZRZLV3Jcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
6957
6957
|
if (pageWidth < 100) return null;
|
|
6958
6958
|
let bigoLineIdx = -1;
|
|
6959
6959
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -7445,7 +7445,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
7445
7445
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
7446
7446
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
7447
7447
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
7448
|
-
for (const cell of cells[0])
|
|
7448
|
+
for (const cell of cells[0]) _chunkN65EY5BIcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
7449
7449
|
for (const item of line) usedItems.add(item);
|
|
7450
7450
|
}
|
|
7451
7451
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7977,7 +7977,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7977
7977
|
const [label, spacer, title] = cells;
|
|
7978
7978
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7979
7979
|
if (cells.some((c) => {
|
|
7980
|
-
const e =
|
|
7980
|
+
const e = _chunkN65EY5BIcjs.CELL_EDGES.get(c);
|
|
7981
7981
|
return !e || e.t || e.b || e.l || e.r;
|
|
7982
7982
|
})) return;
|
|
7983
7983
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _358 => _358.fontSize]), () => ( 0));
|
|
@@ -8558,7 +8558,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8558
8558
|
groupSizes.push(1);
|
|
8559
8559
|
}
|
|
8560
8560
|
const allY = remaining.map((i) => i.y);
|
|
8561
|
-
const pageH =
|
|
8561
|
+
const pageH = _chunk6ZRZLV3Jcjs.safeMax.call(void 0, allY) - _chunk6ZRZLV3Jcjs.safeMin.call(void 0, allY);
|
|
8562
8562
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8563
8563
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
8564
8564
|
const textBlocks = [];
|
|
@@ -8574,7 +8574,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8574
8574
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
8575
8575
|
} else {
|
|
8576
8576
|
const allY = remaining.map((i) => i.y);
|
|
8577
|
-
const pageH =
|
|
8577
|
+
const pageH = _chunk6ZRZLV3Jcjs.safeMax.call(void 0, allY) - _chunk6ZRZLV3Jcjs.safeMin.call(void 0, allY);
|
|
8578
8578
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8579
8579
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
8580
8580
|
const textBlocks = [];
|
|
@@ -8902,7 +8902,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8902
8902
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8903
8903
|
} else {
|
|
8904
8904
|
const allY = items.map((i) => i.y);
|
|
8905
|
-
const pageHeight =
|
|
8905
|
+
const pageHeight = _chunk6ZRZLV3Jcjs.safeMax.call(void 0, allY) - _chunk6ZRZLV3Jcjs.safeMin.call(void 0, allY);
|
|
8906
8906
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8907
8907
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
8908
8908
|
for (const group of orderedGroups) {
|
|
@@ -9118,4 +9118,4 @@ function rowParagraphs(block) {
|
|
|
9118
9118
|
|
|
9119
9119
|
|
|
9120
9120
|
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.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;
|
|
9121
|
-
//# sourceMappingURL=chunk-
|
|
9121
|
+
//# sourceMappingURL=chunk-JILIA5EV.cjs.map
|