kordoc 4.22.2 → 4.22.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 +10 -6
- package/dist/{-C437ZARA.js → -AOWV7MNY.js} +11 -11
- package/dist/{chunk-UMNKY2EZ.js → chunk-24YLYR6Q.js} +4 -4
- package/dist/{chunk-EKKZNKJD.cjs → chunk-2BCQVQO2.cjs} +3 -3
- package/dist/{chunk-EKKZNKJD.cjs.map → chunk-2BCQVQO2.cjs.map} +1 -1
- package/dist/{chunk-GFQIKYBV.js → chunk-3ANXRVI2.js} +3 -3
- package/dist/{chunk-CNMUT5YW.js → chunk-3H2IEU4V.js} +2 -2
- package/dist/{chunk-GVBQVXXB.js → chunk-4NQ4EZEE.js} +14 -4
- package/dist/chunk-4NQ4EZEE.js.map +1 -0
- package/dist/{chunk-56GBOIOE.js → chunk-6LIBF2ZB.js} +2 -2
- package/dist/{chunk-2X64TI7I.js → chunk-6QBBGZST.js} +2 -2
- package/dist/{chunk-FPUBEM3F.js → chunk-7XITVUAK.js} +11 -11
- package/dist/{chunk-S4KQUVBV.js → chunk-AXX5AQT4.js} +4 -4
- package/dist/{chunk-U3TZVR7A.js → chunk-BS2XWGT5.js} +2 -2
- package/dist/{chunk-4BJZGXNM.js → chunk-DKJ2RNDG.js} +2 -2
- package/dist/{chunk-IRP6QS3K.js → chunk-FDFXL7VJ.js} +3 -3
- package/dist/{chunk-YOFKJ7IM.js → chunk-IRNWAHHZ.js} +2 -2
- package/dist/{chunk-QFJCEHY7.js → chunk-J5PYESLX.js} +14 -4
- package/dist/chunk-J5PYESLX.js.map +1 -0
- package/dist/{chunk-AXR7OKQY.js → chunk-KBGNPGVY.js} +2 -2
- package/dist/{chunk-UV2G6XFA.js → chunk-M2X766AY.js} +2 -2
- package/dist/{chunk-YTEMFVZB.js → chunk-MEIQ476H.js} +2 -2
- package/dist/{chunk-AUWO57ED.cjs → chunk-MI655NV5.cjs} +2 -2
- package/dist/{chunk-AUWO57ED.cjs.map → chunk-MI655NV5.cjs.map} +1 -1
- package/dist/{chunk-ENV25MPM.cjs → chunk-NJEMRAIF.cjs} +24 -24
- package/dist/{chunk-ENV25MPM.cjs.map → chunk-NJEMRAIF.cjs.map} +1 -1
- package/dist/{chunk-I4BS4BXE.cjs → chunk-NLGOMLGU.cjs} +23 -23
- package/dist/{chunk-I4BS4BXE.cjs.map → chunk-NLGOMLGU.cjs.map} +1 -1
- package/dist/{chunk-ZLFUZM7H.cjs → chunk-O3OS6FAW.cjs} +3 -3
- package/dist/{chunk-ZLFUZM7H.cjs.map → chunk-O3OS6FAW.cjs.map} +1 -1
- package/dist/{chunk-4GCS7WJJ.js → chunk-O5E25RHU.js} +2 -2
- package/dist/{chunk-NGDMJICC.js → chunk-OIF5HRVP.js} +4 -4
- package/dist/{chunk-MED2MR6O.cjs → chunk-SJ5OZXEL.cjs} +23 -13
- package/dist/chunk-SJ5OZXEL.cjs.map +1 -0
- package/dist/{chunk-3LJ6QO53.js → chunk-SKRWKVVW.js} +3 -3
- package/dist/{chunk-VUC4JJUM.js → chunk-UCLDUUBX.js} +2 -2
- package/dist/{chunk-L6PFPBTK.js → chunk-VJCQOSMT.js} +2 -2
- package/dist/{chunk-DQXP3ELP.js → chunk-X45Q7EAC.js} +2 -2
- package/dist/{chunk-L6N4OMKR.js → chunk-YOGMCRM7.js} +54 -7
- package/dist/chunk-YOGMCRM7.js.map +1 -0
- package/dist/chunks-7KXTS7IV.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-3TVRNJ66.cjs → formula-5V2WG4BH.cjs} +9 -9
- package/dist/{formula-3TVRNJ66.cjs.map → formula-5V2WG4BH.cjs.map} +1 -1
- package/dist/{formula-HUENRCPJ.js → formula-C26FMMGO.js} +3 -3
- package/dist/{formula-43QBPAL5.js → formula-W4OL33YQ.js} +4 -4
- package/dist/{image-ocr-OC3TCXMV.cjs → image-ocr-BELHEWPX.cjs} +17 -17
- package/dist/{image-ocr-OC3TCXMV.cjs.map → image-ocr-BELHEWPX.cjs.map} +1 -1
- package/dist/{image-ocr-HYAKWJGE.js → image-ocr-NSQ34Y6T.js} +9 -9
- package/dist/{image-ocr-BAHDLDV5.js → image-ocr-T72HMX2W.js} +6 -6
- package/dist/index.cjs +453 -406
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-23WBSECG.js → model-bundle-34T2LJB4.js} +5 -5
- package/dist/{models-NRZQY45P.js → models-TQH5EM6V.js} +5 -5
- package/dist/{parse-worker-v2-DPNXGJ73.js → parse-worker-v2-YEYLILGJ.js} +12 -12
- package/dist/{parser-XNOLC3MZ.js → parser-E6BG3ECD.js} +72 -12
- package/dist/parser-E6BG3ECD.js.map +1 -0
- package/dist/{parser-OKAQRZKM.cjs → parser-OAXCXVQ4.cjs} +327 -267
- package/dist/parser-OAXCXVQ4.cjs.map +1 -0
- package/dist/{parser-FNUQW2F3.js → parser-SJHCBL7T.js} +75 -15
- package/dist/parser-SJHCBL7T.js.map +1 -0
- package/dist/{pdf-ocr-FAGA3O6B.js → pdf-ocr-LGPSJM22.js} +6 -6
- package/dist/pdf-ocr-RKXDY3ZA.cjs +31 -0
- package/dist/{pdf-ocr-6UXBIQE6.cjs.map → pdf-ocr-RKXDY3ZA.cjs.map} +1 -1
- package/dist/{pdf-ocr-N5LYC5LA.js → pdf-ocr-T5ASSUKK.js} +9 -9
- package/dist/{profile-io-HC6FMYX4.js → profile-io-KMCAFTMG.js} +3 -3
- package/dist/{rasterize-QLTROEV2.js → rasterize-M52AKY7R.js} +3 -3
- package/dist/{redact-doc-V4KMM2QV.js → redact-doc-SWJC27LL.js} +11 -11
- package/dist/{render-V4S3QLTR.js → render-45AB5YZR.js} +7 -7
- package/dist/seal-7KWG6VHS.js +10 -0
- package/dist/{setup-HU7ZOQNM.js → setup-5PBMUI6M.js} +3 -3
- package/dist/visual-OMJNXLNZ.js +21 -0
- package/dist/{watch-NPIZ6DSJ.js → watch-QOGKV52T.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-GVBQVXXB.js.map +0 -1
- package/dist/chunk-L6N4OMKR.js.map +0 -1
- package/dist/chunk-MED2MR6O.cjs.map +0 -1
- package/dist/chunk-QFJCEHY7.js.map +0 -1
- package/dist/chunks-MPOOHZVO.js +0 -10
- package/dist/parser-FNUQW2F3.js.map +0 -1
- package/dist/parser-OKAQRZKM.cjs.map +0 -1
- package/dist/parser-XNOLC3MZ.js.map +0 -1
- package/dist/pdf-ocr-6UXBIQE6.cjs +0 -31
- package/dist/seal-MQ5TB5YZ.js +0 -10
- package/dist/visual-RLIFC4XC.js +0 -21
- /package/dist/{-C437ZARA.js.map → -AOWV7MNY.js.map} +0 -0
- /package/dist/{chunk-UMNKY2EZ.js.map → chunk-24YLYR6Q.js.map} +0 -0
- /package/dist/{chunk-GFQIKYBV.js.map → chunk-3ANXRVI2.js.map} +0 -0
- /package/dist/{chunk-CNMUT5YW.js.map → chunk-3H2IEU4V.js.map} +0 -0
- /package/dist/{chunk-56GBOIOE.js.map → chunk-6LIBF2ZB.js.map} +0 -0
- /package/dist/{chunk-2X64TI7I.js.map → chunk-6QBBGZST.js.map} +0 -0
- /package/dist/{chunk-FPUBEM3F.js.map → chunk-7XITVUAK.js.map} +0 -0
- /package/dist/{chunk-S4KQUVBV.js.map → chunk-AXX5AQT4.js.map} +0 -0
- /package/dist/{chunk-U3TZVR7A.js.map → chunk-BS2XWGT5.js.map} +0 -0
- /package/dist/{chunk-4BJZGXNM.js.map → chunk-DKJ2RNDG.js.map} +0 -0
- /package/dist/{chunk-IRP6QS3K.js.map → chunk-FDFXL7VJ.js.map} +0 -0
- /package/dist/{chunk-YOFKJ7IM.js.map → chunk-IRNWAHHZ.js.map} +0 -0
- /package/dist/{chunk-AXR7OKQY.js.map → chunk-KBGNPGVY.js.map} +0 -0
- /package/dist/{chunk-UV2G6XFA.js.map → chunk-M2X766AY.js.map} +0 -0
- /package/dist/{chunk-YTEMFVZB.js.map → chunk-MEIQ476H.js.map} +0 -0
- /package/dist/{chunk-4GCS7WJJ.js.map → chunk-O5E25RHU.js.map} +0 -0
- /package/dist/{chunk-NGDMJICC.js.map → chunk-OIF5HRVP.js.map} +0 -0
- /package/dist/{chunk-3LJ6QO53.js.map → chunk-SKRWKVVW.js.map} +0 -0
- /package/dist/{chunk-VUC4JJUM.js.map → chunk-UCLDUUBX.js.map} +0 -0
- /package/dist/{chunk-L6PFPBTK.js.map → chunk-VJCQOSMT.js.map} +0 -0
- /package/dist/{chunk-DQXP3ELP.js.map → chunk-X45Q7EAC.js.map} +0 -0
- /package/dist/{chunks-MPOOHZVO.js.map → chunks-7KXTS7IV.js.map} +0 -0
- /package/dist/{formula-HUENRCPJ.js.map → formula-C26FMMGO.js.map} +0 -0
- /package/dist/{formula-43QBPAL5.js.map → formula-W4OL33YQ.js.map} +0 -0
- /package/dist/{image-ocr-HYAKWJGE.js.map → image-ocr-NSQ34Y6T.js.map} +0 -0
- /package/dist/{image-ocr-BAHDLDV5.js.map → image-ocr-T72HMX2W.js.map} +0 -0
- /package/dist/{model-bundle-23WBSECG.js.map → model-bundle-34T2LJB4.js.map} +0 -0
- /package/dist/{models-NRZQY45P.js.map → models-TQH5EM6V.js.map} +0 -0
- /package/dist/{parse-worker-v2-DPNXGJ73.js.map → parse-worker-v2-YEYLILGJ.js.map} +0 -0
- /package/dist/{pdf-ocr-FAGA3O6B.js.map → pdf-ocr-LGPSJM22.js.map} +0 -0
- /package/dist/{pdf-ocr-N5LYC5LA.js.map → pdf-ocr-T5ASSUKK.js.map} +0 -0
- /package/dist/{profile-io-HC6FMYX4.js.map → profile-io-KMCAFTMG.js.map} +0 -0
- /package/dist/{rasterize-QLTROEV2.js.map → rasterize-M52AKY7R.js.map} +0 -0
- /package/dist/{redact-doc-V4KMM2QV.js.map → redact-doc-SWJC27LL.js.map} +0 -0
- /package/dist/{render-V4S3QLTR.js.map → render-45AB5YZR.js.map} +0 -0
- /package/dist/{seal-MQ5TB5YZ.js.map → seal-7KWG6VHS.js.map} +0 -0
- /package/dist/{setup-HU7ZOQNM.js.map → setup-5PBMUI6M.js.map} +0 -0
- /package/dist/{visual-RLIFC4XC.js.map → visual-OMJNXLNZ.js.map} +0 -0
- /package/dist/{watch-NPIZ6DSJ.js.map → watch-QOGKV52T.js.map} +0 -0
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkSJ5OZXELcjs = require('./chunk-SJ5OZXEL.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkO3OS6FAWcjs = require('./chunk-O3OS6FAW.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkMI655NV5cjs = require('./chunk-MI655NV5.cjs');
|
|
16
16
|
|
|
17
17
|
// src/ocr/models.ts
|
|
18
18
|
var _path = require('path');
|
|
@@ -48,7 +48,7 @@ var OCR_REC_DICT = {
|
|
|
48
48
|
sizeMb: 1
|
|
49
49
|
};
|
|
50
50
|
function getOcrModelsDir() {
|
|
51
|
-
return
|
|
51
|
+
return _chunkO3OS6FAWcjs.getModelsDir.call(void 0, "ppocr");
|
|
52
52
|
}
|
|
53
53
|
var DEFAULT_OCR_MODELS = Object.freeze({
|
|
54
54
|
det: { spec: OCR_DET_MODEL },
|
|
@@ -90,7 +90,7 @@ async function ensureOcrModelsFor(sel, onProgress) {
|
|
|
90
90
|
if (!stamp || verifiedInProcess.get(path) !== stamp) todo.push(s.spec);
|
|
91
91
|
}
|
|
92
92
|
if (!todo.length) return;
|
|
93
|
-
await
|
|
93
|
+
await _chunkO3OS6FAWcjs.ensureModelsIn.call(void 0, dir, todo, onProgress);
|
|
94
94
|
for (const spec of todo) {
|
|
95
95
|
const path = _path.join.call(void 0, dir, spec.filename), stamp = await fileStamp(path);
|
|
96
96
|
if (stamp) verifiedInProcess.set(path, stamp);
|
|
@@ -2139,16 +2139,16 @@ function recordOpenEndCellEdges(grid, cells, horizontals) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
function takeClipCellEdges(from, to) {
|
|
2141
2141
|
const e = CLIP_CELL_EDGES.get(from);
|
|
2142
|
-
if (e)
|
|
2142
|
+
if (e) _chunkSJ5OZXELcjs.CELL_EDGES.set(to, e);
|
|
2143
2143
|
}
|
|
2144
2144
|
function hasOpenCellSeam(a, b) {
|
|
2145
|
-
const u =
|
|
2145
|
+
const u = _chunkSJ5OZXELcjs.CELL_EDGES.get(a), d = _chunkSJ5OZXELcjs.CELL_EDGES.get(b);
|
|
2146
2146
|
return !!u && !!d && u.t && !u.b && !d.t && d.b && u.l && u.r && d.l && d.r;
|
|
2147
2147
|
}
|
|
2148
2148
|
function joinCellEdges(a, b) {
|
|
2149
|
-
const u =
|
|
2149
|
+
const u = _chunkSJ5OZXELcjs.CELL_EDGES.get(a), d = _chunkSJ5OZXELcjs.CELL_EDGES.get(b);
|
|
2150
2150
|
if (!u || !d) return;
|
|
2151
|
-
|
|
2151
|
+
_chunkSJ5OZXELcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
2152
2152
|
}
|
|
2153
2153
|
|
|
2154
2154
|
// src/pdf/cell-extract.ts
|
|
@@ -2324,7 +2324,7 @@ function tagScripts(text, lines) {
|
|
|
2324
2324
|
const [s, e, kind] = marks[m];
|
|
2325
2325
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2326
2326
|
}
|
|
2327
|
-
return
|
|
2327
|
+
return _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, out);
|
|
2328
2328
|
}
|
|
2329
2329
|
|
|
2330
2330
|
// src/pdf/line-wrap.ts
|
|
@@ -5379,9 +5379,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
5379
5379
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
5380
5380
|
const ratio = block.style.fontSize / medianFontSize;
|
|
5381
5381
|
let level = 0;
|
|
5382
|
-
if (ratio >=
|
|
5383
|
-
else if (ratio >=
|
|
5384
|
-
else if (ratio >=
|
|
5382
|
+
if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H1) level = 1;
|
|
5383
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H2) level = 2;
|
|
5384
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H3) level = 3;
|
|
5385
5385
|
if (level > 0) {
|
|
5386
5386
|
block.type = "heading";
|
|
5387
5387
|
block.level = level;
|
|
@@ -5394,7 +5394,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
5394
5394
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _158 => _158.style, 'optionalAccess', _159 => _159.fontSize]), () => ( 0));
|
|
5395
5395
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _160 => _160.text, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]), () => ( ""));
|
|
5396
5396
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _163 => _163.bbox]);
|
|
5397
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _164 => _164.text, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
5397
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _164 => _164.text, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkSJ5OZXELcjs.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;
|
|
5398
5398
|
}
|
|
5399
5399
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
5400
5400
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -6924,16 +6924,16 @@ function isProseSpread(items) {
|
|
|
6924
6924
|
for (let i = 1; i < sorted.length; i++) {
|
|
6925
6925
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
6926
6926
|
}
|
|
6927
|
-
const maxGap =
|
|
6927
|
+
const maxGap = _chunkMI655NV5cjs.safeMax.call(void 0, gaps);
|
|
6928
6928
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
6929
6929
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
6930
|
-
const minGap =
|
|
6930
|
+
const minGap = _chunkMI655NV5cjs.safeMin.call(void 0, gaps);
|
|
6931
6931
|
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)));
|
|
6932
6932
|
}
|
|
6933
6933
|
function detectColumns(yLines) {
|
|
6934
6934
|
const allItems = yLines.flat();
|
|
6935
6935
|
if (allItems.length === 0) return null;
|
|
6936
|
-
const pageWidth =
|
|
6936
|
+
const pageWidth = _chunkMI655NV5cjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkMI655NV5cjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
6937
6937
|
if (pageWidth < 100) return null;
|
|
6938
6938
|
let bigoLineIdx = -1;
|
|
6939
6939
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -7425,7 +7425,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
7425
7425
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
7426
7426
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
7427
7427
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
7428
|
-
for (const cell of cells[0])
|
|
7428
|
+
for (const cell of cells[0]) _chunkSJ5OZXELcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
7429
7429
|
for (const item of line) usedItems.add(item);
|
|
7430
7430
|
}
|
|
7431
7431
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7957,7 +7957,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7957
7957
|
const [label, spacer, title] = cells;
|
|
7958
7958
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7959
7959
|
if (cells.some((c) => {
|
|
7960
|
-
const e =
|
|
7960
|
+
const e = _chunkSJ5OZXELcjs.CELL_EDGES.get(c);
|
|
7961
7961
|
return !e || e.t || e.b || e.l || e.r;
|
|
7962
7962
|
})) return;
|
|
7963
7963
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _357 => _357.fontSize]), () => ( 0));
|
|
@@ -8538,7 +8538,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8538
8538
|
groupSizes.push(1);
|
|
8539
8539
|
}
|
|
8540
8540
|
const allY = remaining.map((i) => i.y);
|
|
8541
|
-
const pageH =
|
|
8541
|
+
const pageH = _chunkMI655NV5cjs.safeMax.call(void 0, allY) - _chunkMI655NV5cjs.safeMin.call(void 0, allY);
|
|
8542
8542
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8543
8543
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
8544
8544
|
const textBlocks = [];
|
|
@@ -8554,7 +8554,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
8554
8554
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
8555
8555
|
} else {
|
|
8556
8556
|
const allY = remaining.map((i) => i.y);
|
|
8557
|
-
const pageH =
|
|
8557
|
+
const pageH = _chunkMI655NV5cjs.safeMax.call(void 0, allY) - _chunkMI655NV5cjs.safeMin.call(void 0, allY);
|
|
8558
8558
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
8559
8559
|
const groups = xyCutOrder(remaining, gapThreshold);
|
|
8560
8560
|
const textBlocks = [];
|
|
@@ -8882,7 +8882,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8882
8882
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8883
8883
|
} else {
|
|
8884
8884
|
const allY = items.map((i) => i.y);
|
|
8885
|
-
const pageHeight =
|
|
8885
|
+
const pageHeight = _chunkMI655NV5cjs.safeMax.call(void 0, allY) - _chunkMI655NV5cjs.safeMin.call(void 0, allY);
|
|
8886
8886
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8887
8887
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold, 0, void 0, minGap);
|
|
8888
8888
|
for (const group of orderedGroups) {
|
|
@@ -9096,4 +9096,4 @@ function rowParagraphs(block) {
|
|
|
9096
9096
|
|
|
9097
9097
|
|
|
9098
9098
|
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;
|
|
9099
|
-
//# sourceMappingURL=chunk-
|
|
9099
|
+
//# sourceMappingURL=chunk-NLGOMLGU.cjs.map
|