kordoc 4.18.7 → 4.18.9
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 +74 -561
- package/dist/{-3AJPADNH.js → -OOORB3ZM.js} +11 -11
- package/dist/{chunk-6FGSSCXN.js → chunk-2ZATWIWX.js} +3 -3
- package/dist/{chunk-X6RQA2ZJ.js → chunk-44LAZYCW.js} +2 -2
- package/dist/{chunk-MKARDNWJ.js → chunk-5K7M5QCG.js} +2 -2
- package/dist/{chunk-32H2UKEZ.js → chunk-5XMZU77R.js} +2 -2
- package/dist/{chunk-HR7QNQOQ.cjs → chunk-5Z5VIVZ4.cjs} +3 -3
- package/dist/{chunk-HR7QNQOQ.cjs.map → chunk-5Z5VIVZ4.cjs.map} +1 -1
- package/dist/{chunk-M6UIEUUU.cjs → chunk-A66VFXSS.cjs} +12 -12
- package/dist/{chunk-M6UIEUUU.cjs.map → chunk-A66VFXSS.cjs.map} +1 -1
- package/dist/{chunk-T4TXPUOX.js → chunk-BBMS5Z7N.js} +2 -2
- package/dist/{chunk-MPUJQOCK.js → chunk-CGRLQJC2.js} +27 -4
- package/dist/chunk-CGRLQJC2.js.map +1 -0
- package/dist/{chunk-TQN4QRL7.cjs → chunk-FFUNCANU.cjs} +47 -24
- package/dist/chunk-FFUNCANU.cjs.map +1 -0
- package/dist/{chunk-2M7WLIUZ.js → chunk-H3MGECXS.js} +2 -2
- package/dist/{chunk-AOOQK3RX.js → chunk-IPJ5SVNH.js} +2 -2
- package/dist/{chunk-UHK47KXY.js → chunk-J6KBWT5D.js} +89 -10
- package/dist/chunk-J6KBWT5D.js.map +1 -0
- package/dist/{chunk-IM77QPKN.js → chunk-L3YW7ATL.js} +2 -2
- package/dist/{chunk-JXVVOSWW.js → chunk-L65DR4EY.js} +2 -2
- package/dist/{chunk-LUZF5ESP.js → chunk-LZJ4HHFE.js} +4 -4
- package/dist/{chunk-U4MI7XTO.js → chunk-MSGQ6DFT.js} +2 -2
- package/dist/{chunk-EB5T5SC6.js → chunk-MW2G24XL.js} +2 -2
- package/dist/{chunk-LFB3XTIK.js → chunk-NEQC7PV5.js} +2 -2
- package/dist/{chunk-AKQRKMY5.js → chunk-NMKCOSXN.js} +2 -2
- package/dist/{chunk-NCVMV4MR.js → chunk-O345LTOL.js} +3 -3
- package/dist/{chunk-5DKDP42Q.js → chunk-OJGHM3YD.js} +2 -2
- package/dist/{chunk-YROJFVJI.js → chunk-S7ED7QP2.js} +28 -5
- package/dist/chunk-S7ED7QP2.js.map +1 -0
- package/dist/{chunk-SD5DGUD4.js → chunk-SO66Q6ST.js} +2 -2
- package/dist/{chunk-ZCOZENWU.cjs → chunk-SOIGY5LM.cjs} +2 -2
- package/dist/{chunk-ZCOZENWU.cjs.map → chunk-SOIGY5LM.cjs.map} +1 -1
- package/dist/{chunk-5EXCACRC.cjs → chunk-VMGLV3P3.cjs} +3 -3
- package/dist/{chunk-5EXCACRC.cjs.map → chunk-VMGLV3P3.cjs.map} +1 -1
- package/dist/{chunk-7ELJ2VQW.js → chunk-XB6VRTM3.js} +2 -2
- package/dist/{chunk-T2VQWNMK.cjs → chunk-XMULZUPH.cjs} +6 -6
- package/dist/{chunk-T2VQWNMK.cjs.map → chunk-XMULZUPH.cjs.map} +1 -1
- package/dist/{chunk-KLOQU3SZ.js → chunk-ZMHMIXTU.js} +6 -6
- package/dist/chunks-2AMQTIMX.js +10 -0
- package/dist/cli.js +26 -26
- package/dist/{formula-WOW5NIIX.cjs → formula-5EGP7AVC.cjs} +9 -9
- package/dist/{formula-WOW5NIIX.cjs.map → formula-5EGP7AVC.cjs.map} +1 -1
- package/dist/{formula-BDPM3Q37.js → formula-CLVKOQCO.js} +4 -4
- package/dist/{formula-K2CIXI4G.js → formula-KOOZT2QS.js} +3 -3
- package/dist/{image-ocr-IGO6GXW4.js → image-ocr-AKSRUDIT.js} +9 -9
- package/dist/{image-ocr-PXFOI5HL.cjs → image-ocr-BHJFBQ2T.cjs} +15 -15
- package/dist/{image-ocr-PXFOI5HL.cjs.map → image-ocr-BHJFBQ2T.cjs.map} +1 -1
- package/dist/{image-ocr-SACGXUVC.js → image-ocr-LLMYXDAL.js} +6 -6
- package/dist/index.cjs +460 -381
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +84 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-Y64X36ZK.js → model-bundle-NT6KCK6Y.js} +5 -5
- package/dist/{models-NMOGNW7R.js → models-SWD6AIAB.js} +5 -5
- package/dist/{parser-CH4MBHEZ.js → parser-ANGCUOPB.js} +10 -9
- package/dist/{parser-CZWBWP7H.js.map → parser-ANGCUOPB.js.map} +1 -1
- package/dist/{parser-NMWMCBWM.cjs → parser-N5MYD4XA.cjs} +127 -126
- package/dist/parser-N5MYD4XA.cjs.map +1 -0
- package/dist/{parser-CZWBWP7H.js → parser-RYDOM6KM.js} +13 -12
- package/dist/{parser-CH4MBHEZ.js.map → parser-RYDOM6KM.js.map} +1 -1
- package/dist/pdf-ocr-B23SDZDD.js +20 -0
- package/dist/pdf-ocr-RX3CQENG.cjs +17 -0
- package/dist/{pdf-ocr-RPBTK6XS.cjs.map → pdf-ocr-RX3CQENG.cjs.map} +1 -1
- package/dist/pdf-ocr-SMFPZJGJ.js +16 -0
- package/dist/{profile-io-UFU7APWM.js → profile-io-CZE4YTYD.js} +3 -3
- package/dist/{rasterize-NL6RCQWN.js → rasterize-KBBEPWJN.js} +3 -3
- package/dist/{redact-doc-FEM3AGUQ.js → redact-doc-K7HCORXE.js} +11 -11
- package/dist/{render-WDCKVMGY.js → render-TXGEQCW6.js} +7 -7
- package/dist/seal-QBDRMEQ3.js +10 -0
- package/dist/{setup-E3E4LDKQ.js → setup-EHCY4PGN.js} +3 -3
- package/dist/visual-66VQETYB.js +20 -0
- package/dist/{watch-6UYWJ6UG.js → watch-54O2O32S.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-MPUJQOCK.js.map +0 -1
- package/dist/chunk-TQN4QRL7.cjs.map +0 -1
- package/dist/chunk-UHK47KXY.js.map +0 -1
- package/dist/chunk-YROJFVJI.js.map +0 -1
- package/dist/chunks-JOLLBBQL.js +0 -10
- package/dist/parser-NMWMCBWM.cjs.map +0 -1
- package/dist/pdf-ocr-BLU34LTG.js +0 -16
- package/dist/pdf-ocr-L4LJUSZ3.js +0 -20
- package/dist/pdf-ocr-RPBTK6XS.cjs +0 -17
- package/dist/seal-XHUWDRIW.js +0 -10
- package/dist/visual-74WYDXEK.js +0 -20
- /package/dist/{-3AJPADNH.js.map → -OOORB3ZM.js.map} +0 -0
- /package/dist/{chunk-6FGSSCXN.js.map → chunk-2ZATWIWX.js.map} +0 -0
- /package/dist/{chunk-X6RQA2ZJ.js.map → chunk-44LAZYCW.js.map} +0 -0
- /package/dist/{chunk-MKARDNWJ.js.map → chunk-5K7M5QCG.js.map} +0 -0
- /package/dist/{chunk-32H2UKEZ.js.map → chunk-5XMZU77R.js.map} +0 -0
- /package/dist/{chunk-T4TXPUOX.js.map → chunk-BBMS5Z7N.js.map} +0 -0
- /package/dist/{chunk-2M7WLIUZ.js.map → chunk-H3MGECXS.js.map} +0 -0
- /package/dist/{chunk-AOOQK3RX.js.map → chunk-IPJ5SVNH.js.map} +0 -0
- /package/dist/{chunk-IM77QPKN.js.map → chunk-L3YW7ATL.js.map} +0 -0
- /package/dist/{chunk-JXVVOSWW.js.map → chunk-L65DR4EY.js.map} +0 -0
- /package/dist/{chunk-LUZF5ESP.js.map → chunk-LZJ4HHFE.js.map} +0 -0
- /package/dist/{chunk-U4MI7XTO.js.map → chunk-MSGQ6DFT.js.map} +0 -0
- /package/dist/{chunk-EB5T5SC6.js.map → chunk-MW2G24XL.js.map} +0 -0
- /package/dist/{chunk-LFB3XTIK.js.map → chunk-NEQC7PV5.js.map} +0 -0
- /package/dist/{chunk-AKQRKMY5.js.map → chunk-NMKCOSXN.js.map} +0 -0
- /package/dist/{chunk-NCVMV4MR.js.map → chunk-O345LTOL.js.map} +0 -0
- /package/dist/{chunk-5DKDP42Q.js.map → chunk-OJGHM3YD.js.map} +0 -0
- /package/dist/{chunk-SD5DGUD4.js.map → chunk-SO66Q6ST.js.map} +0 -0
- /package/dist/{chunk-7ELJ2VQW.js.map → chunk-XB6VRTM3.js.map} +0 -0
- /package/dist/{chunk-KLOQU3SZ.js.map → chunk-ZMHMIXTU.js.map} +0 -0
- /package/dist/{chunks-JOLLBBQL.js.map → chunks-2AMQTIMX.js.map} +0 -0
- /package/dist/{formula-BDPM3Q37.js.map → formula-CLVKOQCO.js.map} +0 -0
- /package/dist/{formula-K2CIXI4G.js.map → formula-KOOZT2QS.js.map} +0 -0
- /package/dist/{image-ocr-IGO6GXW4.js.map → image-ocr-AKSRUDIT.js.map} +0 -0
- /package/dist/{image-ocr-SACGXUVC.js.map → image-ocr-LLMYXDAL.js.map} +0 -0
- /package/dist/{model-bundle-Y64X36ZK.js.map → model-bundle-NT6KCK6Y.js.map} +0 -0
- /package/dist/{models-NMOGNW7R.js.map → models-SWD6AIAB.js.map} +0 -0
- /package/dist/{pdf-ocr-BLU34LTG.js.map → pdf-ocr-B23SDZDD.js.map} +0 -0
- /package/dist/{pdf-ocr-L4LJUSZ3.js.map → pdf-ocr-SMFPZJGJ.js.map} +0 -0
- /package/dist/{profile-io-UFU7APWM.js.map → profile-io-CZE4YTYD.js.map} +0 -0
- /package/dist/{rasterize-NL6RCQWN.js.map → rasterize-KBBEPWJN.js.map} +0 -0
- /package/dist/{redact-doc-FEM3AGUQ.js.map → redact-doc-K7HCORXE.js.map} +0 -0
- /package/dist/{render-WDCKVMGY.js.map → render-TXGEQCW6.js.map} +0 -0
- /package/dist/{seal-XHUWDRIW.js.map → seal-QBDRMEQ3.js.map} +0 -0
- /package/dist/{setup-E3E4LDKQ.js.map → setup-EHCY4PGN.js.map} +0 -0
- /package/dist/{visual-74WYDXEK.js.map → visual-66VQETYB.js.map} +0 -0
- /package/dist/{watch-6UYWJ6UG.js.map → watch-54O2O32S.js.map} +0 -0
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkXMULZUPHcjs = require('./chunk-XMULZUPH.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk5Z5VIVZ4cjs = require('./chunk-5Z5VIVZ4.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkSOIGY5LMcjs = require('./chunk-SOIGY5LM.cjs');
|
|
16
16
|
|
|
17
17
|
// src/ocr/models.ts
|
|
18
18
|
var _path = require('path');
|
|
@@ -40,10 +40,10 @@ var OCR_REC_DICT = {
|
|
|
40
40
|
};
|
|
41
41
|
var ALL_OCR_MODELS = [OCR_DET_MODEL, OCR_REC_MODEL, OCR_REC_DICT];
|
|
42
42
|
function getOcrModelsDir() {
|
|
43
|
-
return
|
|
43
|
+
return _chunk5Z5VIVZ4cjs.getModelsDir.call(void 0, "ppocr");
|
|
44
44
|
}
|
|
45
45
|
async function ensureOcrModels(onProgress) {
|
|
46
|
-
return
|
|
46
|
+
return _chunk5Z5VIVZ4cjs.ensureModelsIn.call(void 0, getOcrModelsDir(), ALL_OCR_MODELS, onProgress);
|
|
47
47
|
}
|
|
48
48
|
async function ocrModelsCached() {
|
|
49
49
|
const dir = getOcrModelsDir();
|
|
@@ -2091,7 +2091,7 @@ function tagScripts(text, lines) {
|
|
|
2091
2091
|
const [s, e, kind] = marks[m];
|
|
2092
2092
|
out = out.slice(0, s) + `<${kind}>` + out.slice(s, e) + `</${kind}>` + out.slice(e);
|
|
2093
2093
|
}
|
|
2094
|
-
return
|
|
2094
|
+
return _chunkXMULZUPHcjs.tidyScriptTags.call(void 0, out);
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
2097
2097
|
// src/pdf/line-wrap.ts
|
|
@@ -2242,6 +2242,7 @@ function wrapJoiner(prevText, nextText, lex) {
|
|
|
2242
2242
|
return " ";
|
|
2243
2243
|
}
|
|
2244
2244
|
var PARA_LAST_LINE = /* @__PURE__ */ new WeakMap();
|
|
2245
|
+
var PAGE_BREAK_JOINS = /* @__PURE__ */ new WeakMap();
|
|
2245
2246
|
function joinPageBreakWraps(blocks, lex) {
|
|
2246
2247
|
const pageRight = /* @__PURE__ */ new Map();
|
|
2247
2248
|
for (const b of blocks) {
|
|
@@ -2256,13 +2257,34 @@ function joinPageBreakWraps(blocks, lex) {
|
|
|
2256
2257
|
if (!last || fs <= 0 || (_nullishCoalesce(pageRight.get(a.pageNumber), () => ( Infinity))) - last.right >= BODY_FULL_TOL * fs) continue;
|
|
2257
2258
|
if (last.width < BODY_MIN_WIDTH_EM * fs || Math.abs((_nullishCoalesce(_optionalChain([b, 'access', _56 => _56.style, 'optionalAccess', _57 => _57.fontSize]), () => ( 0))) - fs) > 0.15 * fs) continue;
|
|
2258
2259
|
if (startsNewItem(a.text, b.text)) continue;
|
|
2259
|
-
a.text
|
|
2260
|
+
const head = a.text, joiner = wrapJoiner(a.text, b.text, lex);
|
|
2261
|
+
a.text += joiner + b.text;
|
|
2262
|
+
const later = b.bbox && PAGE_BREAK_JOINS.get(b.bbox) || [];
|
|
2263
|
+
PAGE_BREAK_JOINS.set(a.bbox, [{ head, gap: joiner.length, tail: b }, ...later.map((c) => ({ ...c, head: head + joiner + c.head }))]);
|
|
2260
2264
|
const bl = b.bbox && PARA_LAST_LINE.get(b.bbox);
|
|
2261
2265
|
if (bl) PARA_LAST_LINE.set(a.bbox, bl);
|
|
2262
2266
|
else PARA_LAST_LINE.delete(a.bbox);
|
|
2263
2267
|
blocks.splice(i, 1);
|
|
2264
2268
|
}
|
|
2265
2269
|
}
|
|
2270
|
+
function splitPageBreakWraps(blocks) {
|
|
2271
|
+
return blocks.flatMap((b) => {
|
|
2272
|
+
const cuts = b.bbox && PAGE_BREAK_JOINS.get(b.bbox);
|
|
2273
|
+
const text = b.text;
|
|
2274
|
+
if (!cuts || !text) return [b];
|
|
2275
|
+
const out = [];
|
|
2276
|
+
let from = 0, cur = b;
|
|
2277
|
+
for (const c of cuts) {
|
|
2278
|
+
if (c.head.length < from || !text.startsWith(c.head)) break;
|
|
2279
|
+
out.push({ ...cur, text: text.slice(from, c.head.length) });
|
|
2280
|
+
from = c.head.length + c.gap;
|
|
2281
|
+
cur = c.tail;
|
|
2282
|
+
}
|
|
2283
|
+
if (!out.length) return [b];
|
|
2284
|
+
out.push({ ...cur, text: text.slice(from) });
|
|
2285
|
+
return out;
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2266
2288
|
var HANGING = /[,。、:;!?)」』】〕》〉.]\s*$/;
|
|
2267
2289
|
var MULTI_LEVEL_NUMBER = /^\d{1,2}(?:\.\d{1,3})+\.?\s/;
|
|
2268
2290
|
var BODY_FULL_TOL = 0.25;
|
|
@@ -3644,9 +3666,9 @@ function detectHeadings(blocks, medianFontSize) {
|
|
|
3644
3666
|
if (/^\d+$/.test(text) && !isChapterNumber(block, blocks[bi + 1], medianFontSize)) continue;
|
|
3645
3667
|
const ratio = block.style.fontSize / medianFontSize;
|
|
3646
3668
|
let level = 0;
|
|
3647
|
-
if (ratio >=
|
|
3648
|
-
else if (ratio >=
|
|
3649
|
-
else if (ratio >=
|
|
3669
|
+
if (ratio >= _chunkXMULZUPHcjs.HEADING_RATIO_H1) level = 1;
|
|
3670
|
+
else if (ratio >= _chunkXMULZUPHcjs.HEADING_RATIO_H2) level = 2;
|
|
3671
|
+
else if (ratio >= _chunkXMULZUPHcjs.HEADING_RATIO_H3) level = 3;
|
|
3650
3672
|
if (level > 0) {
|
|
3651
3673
|
block.type = "heading";
|
|
3652
3674
|
block.level = level;
|
|
@@ -3659,7 +3681,7 @@ function isChapterNumber(block, next, medianFontSize) {
|
|
|
3659
3681
|
const nextSize = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _96 => _96.style, 'optionalAccess', _97 => _97.fontSize]), () => ( 0));
|
|
3660
3682
|
const text = _nullishCoalesce(_optionalChain([next, 'optionalAccess', _98 => _98.text, 'optionalAccess', _99 => _99.trim, 'call', _100 => _100()]), () => ( ""));
|
|
3661
3683
|
const a = block.bbox, b = _optionalChain([next, 'optionalAccess', _101 => _101.bbox]);
|
|
3662
|
-
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _102 => _102.text, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize *
|
|
3684
|
+
return /^\d{1,2}$/.test(_nullishCoalesce(_optionalChain([block, 'access', _102 => _102.text, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()]), () => ( ""))) && size >= medianFontSize * 2.5 && !!next && (next.type === "paragraph" || next.type === "heading") && next.pageNumber === block.pageNumber && nextSize >= medianFontSize * _chunkXMULZUPHcjs.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;
|
|
3663
3685
|
}
|
|
3664
3686
|
function mergeStackedHeadingLines(blocks, medianFontSize) {
|
|
3665
3687
|
for (let i = 0; i < blocks.length - 1; ) {
|
|
@@ -5971,16 +5993,16 @@ function isProseSpread(items) {
|
|
|
5971
5993
|
for (let i = 1; i < sorted.length; i++) {
|
|
5972
5994
|
gaps.push(sorted[i].x - (sorted[i - 1].x + sorted[i - 1].w));
|
|
5973
5995
|
}
|
|
5974
|
-
const maxGap =
|
|
5996
|
+
const maxGap = _chunkSOIGY5LMcjs.safeMax.call(void 0, gaps);
|
|
5975
5997
|
const avgLen = items.reduce((s, i) => s + i.text.length, 0) / items.length;
|
|
5976
5998
|
if (items.length >= 4 && maxGap < 40 && avgLen < 5) return true;
|
|
5977
|
-
const minGap =
|
|
5999
|
+
const minGap = _chunkSOIGY5LMcjs.safeMin.call(void 0, gaps);
|
|
5978
6000
|
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;
|
|
5979
6001
|
}
|
|
5980
6002
|
function detectColumns(yLines) {
|
|
5981
6003
|
const allItems = yLines.flat();
|
|
5982
6004
|
if (allItems.length === 0) return null;
|
|
5983
|
-
const pageWidth =
|
|
6005
|
+
const pageWidth = _chunkSOIGY5LMcjs.safeMax.call(void 0, allItems.map((i) => i.x + i.w)) - _chunkSOIGY5LMcjs.safeMin.call(void 0, allItems.map((i) => i.x));
|
|
5984
6006
|
if (pageWidth < 100) return null;
|
|
5985
6007
|
let bigoLineIdx = -1;
|
|
5986
6008
|
for (let i = 0; i < yLines.length; i++) {
|
|
@@ -6450,12 +6472,12 @@ function recordClipCellEdges(grids, horizontals, verticals, nonRules) {
|
|
|
6450
6472
|
}
|
|
6451
6473
|
function takeClipCellEdges(from, to) {
|
|
6452
6474
|
const e = CLIP_CELL_EDGES.get(from);
|
|
6453
|
-
if (e)
|
|
6475
|
+
if (e) _chunkXMULZUPHcjs.CELL_EDGES.set(to, e);
|
|
6454
6476
|
}
|
|
6455
6477
|
function joinCellEdges(a, b) {
|
|
6456
|
-
const u =
|
|
6478
|
+
const u = _chunkXMULZUPHcjs.CELL_EDGES.get(a), d = _chunkXMULZUPHcjs.CELL_EDGES.get(b);
|
|
6457
6479
|
if (!u || !d) return;
|
|
6458
|
-
|
|
6480
|
+
_chunkXMULZUPHcjs.CELL_EDGES.set(a, { t: u.t, b: d.b, l: u.l || d.l, r: u.r || d.r });
|
|
6459
6481
|
}
|
|
6460
6482
|
|
|
6461
6483
|
// src/pdf/table-unit-row.ts
|
|
@@ -6471,7 +6493,7 @@ function rebuildUnitLine(items, grid) {
|
|
|
6471
6493
|
function prependUnitRow(cells, cols, line, usedItems) {
|
|
6472
6494
|
const text = cleanCellText(line.map((item) => item.text).join(""));
|
|
6473
6495
|
cells.unshift(Array.from({ length: cols }, (_, c) => ({ text: c === 0 ? text : "", colSpan: c === 0 ? cols : 1, rowSpan: 1 })));
|
|
6474
|
-
for (const cell of cells[0])
|
|
6496
|
+
for (const cell of cells[0]) _chunkXMULZUPHcjs.CELL_EDGES.set(cell, NO_EDGES);
|
|
6475
6497
|
for (const item of line) usedItems.add(item);
|
|
6476
6498
|
}
|
|
6477
6499
|
function attachUnitRow(items, grid, cells, cols, usedItems) {
|
|
@@ -7001,7 +7023,7 @@ function recordFrameTitle(table, source, pageNum) {
|
|
|
7001
7023
|
const [label, spacer, title] = cells;
|
|
7002
7024
|
if (!/^(?:붙임|별첨|첨부|부록)\s*\d{1,3}$/.test(label.text.trim()) || spacer.text.trim() || !title.text.trim()) return;
|
|
7003
7025
|
if (cells.some((c) => {
|
|
7004
|
-
const e =
|
|
7026
|
+
const e = _chunkXMULZUPHcjs.CELL_EDGES.get(c);
|
|
7005
7027
|
return !e || e.t || e.b || e.l || e.r;
|
|
7006
7028
|
})) return;
|
|
7007
7029
|
const xs = TABLE_COLXS.get(table), style = dominantStyle(source), fs = _nullishCoalesce(_optionalChain([style, 'optionalAccess', _324 => _324.fontSize]), () => ( 0));
|
|
@@ -7913,7 +7935,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7913
7935
|
groupSizes.push(1);
|
|
7914
7936
|
}
|
|
7915
7937
|
const allY = remaining.map((i) => i.y);
|
|
7916
|
-
const pageH =
|
|
7938
|
+
const pageH = _chunkSOIGY5LMcjs.safeMax.call(void 0, allY) - _chunkSOIGY5LMcjs.safeMin.call(void 0, allY);
|
|
7917
7939
|
const gapThreshold = Math.max(15, pageH * 0.03);
|
|
7918
7940
|
const sides = frameColumnTextBands(remaining, spanning, gx);
|
|
7919
7941
|
const textBlocks = [];
|
|
@@ -7929,7 +7951,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
7929
7951
|
finalTextBlocks.push(...detectListBlocks(textBlocks));
|
|
7930
7952
|
} else {
|
|
7931
7953
|
const allY = remaining.map((i) => i.y);
|
|
7932
|
-
const pageH =
|
|
7954
|
+
const pageH = _chunkSOIGY5LMcjs.safeMax.call(void 0, allY) - _chunkSOIGY5LMcjs.safeMin.call(void 0, allY);
|
|
7933
7955
|
const groups = xyCutOrder(remaining, Math.max(15, pageH * 0.03));
|
|
7934
7956
|
const textBlocks = [];
|
|
7935
7957
|
for (const group of groups) {
|
|
@@ -8254,7 +8276,7 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8254
8276
|
blocks.push(...columnTextToBlocks(tableText, pageNum, bbox, dominantStyle(items)));
|
|
8255
8277
|
} else {
|
|
8256
8278
|
const allY = items.map((i) => i.y);
|
|
8257
|
-
const pageHeight =
|
|
8279
|
+
const pageHeight = _chunkSOIGY5LMcjs.safeMax.call(void 0, allY) - _chunkSOIGY5LMcjs.safeMin.call(void 0, allY);
|
|
8258
8280
|
const gapThreshold = Math.max(15, pageHeight * 0.03);
|
|
8259
8281
|
const orderedGroups = proseCutX !== null ? splitTwoColumnProse(items, proseCutX) : xyCutOrder(items, gapThreshold);
|
|
8260
8282
|
for (const group of orderedGroups) {
|
|
@@ -8331,5 +8353,6 @@ function extractPageBlocksFallback(items, pageNum, fullPage = false, detectTable
|
|
|
8331
8353
|
|
|
8332
8354
|
|
|
8333
8355
|
|
|
8334
|
-
|
|
8335
|
-
|
|
8356
|
+
|
|
8357
|
+
exports.OCR_DET_MODEL = OCR_DET_MODEL; exports.OCR_REC_MODEL = OCR_REC_MODEL; exports.OCR_REC_DICT = OCR_REC_DICT; exports.getOcrModelsDir = getOcrModelsDir; exports.ensureOcrModels = ensureOcrModels; exports.ocrModelsCached = ocrModelsCached; exports.parseCharacterDict = parseCharacterDict; exports.extractLines = extractLines; exports.extractImageRegions = extractImageRegions; 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.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.NO_EDGES = NO_EDGES; exports.joinCellEdges = joinCellEdges; exports.FRAME_READING_UNITS = FRAME_READING_UNITS; exports.recordFrameReadingUnit = recordFrameReadingUnit; exports.restoreImageBullets = restoreImageBullets; exports.detectRightArrowRegions = detectRightArrowRegions; exports.removeSideTabs = removeSideTabs; exports.extractPageBlocksWithLines = extractPageBlocksWithLines;
|
|
8358
|
+
//# sourceMappingURL=chunk-FFUNCANU.cjs.map
|