kordoc 4.25.2 → 4.25.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/NOTICE +14 -8
- package/README.md +2 -2
- package/dist/{chunk-QJWSNET3.js → chunk-44JOWCSX.js} +8 -8
- package/dist/{chunk-CEYITKNO.js → chunk-7LVAULK7.js} +2 -2
- package/dist/{chunk-AHJOET62.js → chunk-ATOUJ2QT.js} +5 -5
- package/dist/{chunk-6VSEMZ2J.js → chunk-BAYK74RD.js} +10 -10
- package/dist/{chunk-EWUBFEPZ.js → chunk-BP54NHUP.js} +2 -2
- package/dist/{chunk-EWUBFEPZ.js.map → chunk-BP54NHUP.js.map} +2 -2
- package/dist/{chunk-ZMLZVD3J.js → chunk-CKRFG6QS.js} +2 -2
- package/dist/{chunk-BDBVGJW3.js → chunk-EL3TM6NH.js} +2 -2
- package/dist/{chunk-PE2Z234F.js → chunk-FZNY4DWZ.js} +2 -2
- package/dist/{chunk-NXDACGEH.js → chunk-G6HRSHV2.js} +39 -4
- package/dist/{chunk-NXDACGEH.js.map → chunk-G6HRSHV2.js.map} +2 -2
- package/dist/{chunk-NRHDHCJN.js → chunk-GRKTIXRO.js} +2 -2
- package/dist/{chunk-N4WIRSNW.js → chunk-H5JMMJSH.js} +2 -2
- package/dist/{chunk-ZHVSRDVF.js → chunk-H76I34IS.js} +6 -6
- package/dist/{chunk-A36NOLXN.js → chunk-HUN4CRUL.js} +6 -6
- package/dist/{chunk-GUOXYUMU.js → chunk-HWUAMWA2.js} +2 -2
- package/dist/{chunk-4X5R5EKL.js → chunk-JYZGHREO.js} +6 -6
- package/dist/{chunk-UMWSG2SJ.js → chunk-MJDPJ5XQ.js} +3 -3
- package/dist/{chunk-RWWLUT3Z.js → chunk-MLGR4AJ6.js} +25 -6
- package/dist/chunk-MLGR4AJ6.js.map +7 -0
- package/dist/{chunk-OQKYJVLL.js → chunk-NCZRKC5G.js} +4 -4
- package/dist/{chunk-RR7F4MV7.js → chunk-NOKFHQ6K.js} +2 -2
- package/dist/{chunk-GEWICG46.js → chunk-PEN2SUJQ.js} +2 -2
- package/dist/{chunk-OE76DPYB.js → chunk-Q4YOIJQF.js} +3 -3
- package/dist/{chunk-KK3ADW4V.js → chunk-Q525ZJZK.js} +28 -10
- package/dist/{chunk-KK3ADW4V.js.map → chunk-Q525ZJZK.js.map} +3 -3
- package/dist/{chunk-RCFCHOMY.js → chunk-S2DA7IZJ.js} +2 -2
- package/dist/{chunk-HS4V42R5.js → chunk-WYH2DSPZ.js} +2 -2
- package/dist/{chunk-BVJX756H.js → chunk-YJ6ZL7O2.js} +16 -16
- package/dist/{chunk-IK3FDYOE.js → chunk-ZD2KWXR2.js} +2 -2
- package/dist/chunks-EBMYAFDM.js +10 -0
- package/dist/cli.js +35 -35
- package/dist/{formula-6DMQSBFW.js → formula-3QN7DVFM.js} +4 -4
- package/dist/{generator-ORDTMIQM.js → generator-O5RTSTX6.js} +7 -7
- package/dist/{hancom-KN5SQMKT.js → hancom-ZJR546EJ.js} +2 -2
- package/dist/{image-ocr-LVJFXGL4.js → image-ocr-LA3LCRXK.js} +11 -11
- package/dist/index.cjs +87 -15
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +19 -19
- package/dist/mcp.js +33 -33
- package/dist/mcp.js.map +2 -2
- package/dist/memo-ZKU7B66X.js +15 -0
- package/dist/{model-bundle-VWCZDFFG.js → model-bundle-HEEEA6YP.js} +5 -5
- package/dist/{models-R67ZWDF4.js → models-BS5CBYRY.js} +9 -5
- package/dist/{parse-worker-v2-6WBBR7Z2.js → parse-worker-v2-J4OWXPNE.js} +21 -21
- package/dist/{parser-TCYP5RBA.js → parser-OGWIHRB7.js} +14 -13
- package/dist/{parser-TCYP5RBA.js.map → parser-OGWIHRB7.js.map} +2 -2
- package/dist/{pdf-ocr-DVCI7AAR.js → pdf-ocr-DLE7J6MD.js} +9 -9
- package/dist/{profile-io-4XUVQIFE.js → profile-io-3RT4KWON.js} +3 -3
- package/dist/{rasterize-WUSJNYMZ.js → rasterize-UBAGOEIC.js} +3 -3
- package/dist/{redact-doc-HCXNHJUZ.js → redact-doc-7CKGFON7.js} +20 -20
- package/dist/{render-NGSGUNWX.js → render-HOLN6Y7J.js} +10 -10
- package/dist/{rewrite-fallback-S7F2TP4G.js → rewrite-fallback-O6TBXS3M.js} +12 -12
- package/dist/seal-EYDUKV3T.js +14 -0
- package/dist/{setup-ECJK3FIE.js → setup-HVPORSZU.js} +3 -3
- package/dist/{to-hwpx-PSJYFTDW.js → to-hwpx-VPK7TIL6.js} +7 -7
- package/dist/visual-IWW6J4I4.js +38 -0
- package/dist/{watch-CTPPLNO4.js → watch-LSDUKNBM.js} +21 -21
- package/package.json +1 -1
- package/dist/chunk-RWWLUT3Z.js.map +0 -7
- package/dist/chunks-JNZ2WBME.js +0 -10
- package/dist/memo-UJ4UYP5C.js +0 -15
- package/dist/seal-BB7STCXD.js +0 -14
- package/dist/visual-QQC436MI.js +0 -38
- /package/dist/{chunk-QJWSNET3.js.map → chunk-44JOWCSX.js.map} +0 -0
- /package/dist/{chunk-CEYITKNO.js.map → chunk-7LVAULK7.js.map} +0 -0
- /package/dist/{chunk-AHJOET62.js.map → chunk-ATOUJ2QT.js.map} +0 -0
- /package/dist/{chunk-6VSEMZ2J.js.map → chunk-BAYK74RD.js.map} +0 -0
- /package/dist/{chunk-ZMLZVD3J.js.map → chunk-CKRFG6QS.js.map} +0 -0
- /package/dist/{chunk-BDBVGJW3.js.map → chunk-EL3TM6NH.js.map} +0 -0
- /package/dist/{chunk-PE2Z234F.js.map → chunk-FZNY4DWZ.js.map} +0 -0
- /package/dist/{chunk-NRHDHCJN.js.map → chunk-GRKTIXRO.js.map} +0 -0
- /package/dist/{chunk-N4WIRSNW.js.map → chunk-H5JMMJSH.js.map} +0 -0
- /package/dist/{chunk-ZHVSRDVF.js.map → chunk-H76I34IS.js.map} +0 -0
- /package/dist/{chunk-A36NOLXN.js.map → chunk-HUN4CRUL.js.map} +0 -0
- /package/dist/{chunk-GUOXYUMU.js.map → chunk-HWUAMWA2.js.map} +0 -0
- /package/dist/{chunk-4X5R5EKL.js.map → chunk-JYZGHREO.js.map} +0 -0
- /package/dist/{chunk-UMWSG2SJ.js.map → chunk-MJDPJ5XQ.js.map} +0 -0
- /package/dist/{chunk-OQKYJVLL.js.map → chunk-NCZRKC5G.js.map} +0 -0
- /package/dist/{chunk-RR7F4MV7.js.map → chunk-NOKFHQ6K.js.map} +0 -0
- /package/dist/{chunk-GEWICG46.js.map → chunk-PEN2SUJQ.js.map} +0 -0
- /package/dist/{chunk-OE76DPYB.js.map → chunk-Q4YOIJQF.js.map} +0 -0
- /package/dist/{chunk-RCFCHOMY.js.map → chunk-S2DA7IZJ.js.map} +0 -0
- /package/dist/{chunk-HS4V42R5.js.map → chunk-WYH2DSPZ.js.map} +0 -0
- /package/dist/{chunk-BVJX756H.js.map → chunk-YJ6ZL7O2.js.map} +0 -0
- /package/dist/{chunk-IK3FDYOE.js.map → chunk-ZD2KWXR2.js.map} +0 -0
- /package/dist/{chunks-JNZ2WBME.js.map → chunks-EBMYAFDM.js.map} +0 -0
- /package/dist/{formula-6DMQSBFW.js.map → formula-3QN7DVFM.js.map} +0 -0
- /package/dist/{generator-ORDTMIQM.js.map → generator-O5RTSTX6.js.map} +0 -0
- /package/dist/{hancom-KN5SQMKT.js.map → hancom-ZJR546EJ.js.map} +0 -0
- /package/dist/{image-ocr-LVJFXGL4.js.map → image-ocr-LA3LCRXK.js.map} +0 -0
- /package/dist/{memo-UJ4UYP5C.js.map → memo-ZKU7B66X.js.map} +0 -0
- /package/dist/{model-bundle-VWCZDFFG.js.map → model-bundle-HEEEA6YP.js.map} +0 -0
- /package/dist/{models-R67ZWDF4.js.map → models-BS5CBYRY.js.map} +0 -0
- /package/dist/{parse-worker-v2-6WBBR7Z2.js.map → parse-worker-v2-J4OWXPNE.js.map} +0 -0
- /package/dist/{pdf-ocr-DVCI7AAR.js.map → pdf-ocr-DLE7J6MD.js.map} +0 -0
- /package/dist/{profile-io-4XUVQIFE.js.map → profile-io-3RT4KWON.js.map} +0 -0
- /package/dist/{rasterize-WUSJNYMZ.js.map → rasterize-UBAGOEIC.js.map} +0 -0
- /package/dist/{redact-doc-HCXNHJUZ.js.map → redact-doc-7CKGFON7.js.map} +0 -0
- /package/dist/{render-NGSGUNWX.js.map → render-HOLN6Y7J.js.map} +0 -0
- /package/dist/{rewrite-fallback-S7F2TP4G.js.map → rewrite-fallback-O6TBXS3M.js.map} +0 -0
- /package/dist/{seal-BB7STCXD.js.map → seal-EYDUKV3T.js.map} +0 -0
- /package/dist/{setup-ECJK3FIE.js.map → setup-HVPORSZU.js.map} +0 -0
- /package/dist/{to-hwpx-PSJYFTDW.js.map → to-hwpx-VPK7TIL6.js.map} +0 -0
- /package/dist/{visual-QQC436MI.js.map → visual-IWW6J4I4.js.map} +0 -0
- /package/dist/{watch-CTPPLNO4.js.map → watch-LSDUKNBM.js.map} +0 -0
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
HEADING_RATIO_H3,
|
|
10
10
|
tidyScriptTags,
|
|
11
11
|
toTex
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BP54NHUP.js";
|
|
13
13
|
import {
|
|
14
14
|
safeMax,
|
|
15
15
|
safeMin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7LVAULK7.js";
|
|
17
17
|
|
|
18
18
|
// src/ocr/line-split.ts
|
|
19
19
|
function grayCrop(rgba, pageW, box) {
|
|
@@ -7807,6 +7807,7 @@ var TABLE_TAIL = /* @__PURE__ */ new WeakMap();
|
|
|
7807
7807
|
var PART_COLXS = /* @__PURE__ */ new WeakMap();
|
|
7808
7808
|
var EMPTY_PARTS = /* @__PURE__ */ new WeakSet();
|
|
7809
7809
|
var IMAGE_CELLS = /* @__PURE__ */ new WeakSet();
|
|
7810
|
+
var IMAGE_CELL_BOXES = /* @__PURE__ */ new WeakMap();
|
|
7810
7811
|
var FILLER_CELLS = /* @__PURE__ */ new WeakSet();
|
|
7811
7812
|
var CONT_PARTS = /* @__PURE__ */ new WeakMap();
|
|
7812
7813
|
var CELL_LINES = /* @__PURE__ */ new WeakMap();
|
|
@@ -10517,6 +10518,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
|
|
|
10517
10518
|
return cx > b.x1 && cx < b.x2 && cy > b.y1 && cy < b.y2 && !isBackdrop(r);
|
|
10518
10519
|
})) {
|
|
10519
10520
|
markImageCell(irGrid[cell.row][cell.col]);
|
|
10521
|
+
IMAGE_CELL_BOXES.set(irGrid[cell.row][cell.col], { x1: b.x1, y1: b.y1, x2: b.x2, y2: b.y2 });
|
|
10520
10522
|
}
|
|
10521
10523
|
if (cell.filler && !cellItems.length) FILLER_CELLS.add(irGrid[cell.row][cell.col]);
|
|
10522
10524
|
if (cellItems.length) recordCellLines(irGrid[cell.row][cell.col], cellItems);
|
|
@@ -11280,7 +11282,17 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
|
|
|
11280
11282
|
const frame = FRAME_READING_UNITS.get(block);
|
|
11281
11283
|
const source = frame?.blocks.every((member) => selectedSet.has(member)) ? frame.blocks : [block];
|
|
11282
11284
|
source.forEach((member) => seen2.add(member));
|
|
11283
|
-
const
|
|
11285
|
+
const outside = [];
|
|
11286
|
+
for (const member of source) {
|
|
11287
|
+
const cell = imageCellAt(before, page, member.bbox);
|
|
11288
|
+
if (!cell) {
|
|
11289
|
+
outside.push(member);
|
|
11290
|
+
continue;
|
|
11291
|
+
}
|
|
11292
|
+
addToCell(cell, { ...member, style: void 0, bbox: void 0 });
|
|
11293
|
+
added++;
|
|
11294
|
+
}
|
|
11295
|
+
const available = outside.filter((member) => !hasOriginal(member));
|
|
11284
11296
|
const units = frame && available.length === source.length && source === frame.blocks ? [{ blocks: available, bbox: frame.bbox, atomic: true }] : available.map((member) => ({ blocks: [member], bbox: member.bbox, atomic: false }));
|
|
11285
11297
|
for (const unit of units) {
|
|
11286
11298
|
const b = unit.bbox;
|
|
@@ -11301,6 +11313,29 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
|
|
|
11301
11313
|
}
|
|
11302
11314
|
return added;
|
|
11303
11315
|
}
|
|
11316
|
+
function imageCellAt(blocks, page, b) {
|
|
11317
|
+
const cx = b.x + b.width / 2, cy = b.y + b.height / 2;
|
|
11318
|
+
const walk = (list, depth) => {
|
|
11319
|
+
if (depth > 8) return null;
|
|
11320
|
+
for (const block of list) {
|
|
11321
|
+
if (!block.table || block.pageNumber !== void 0 && block.pageNumber !== page) continue;
|
|
11322
|
+
for (const row of block.table.cells) for (const cell of row) {
|
|
11323
|
+
const box = IMAGE_CELL_BOXES.get(cell);
|
|
11324
|
+
if (box && IMAGE_CELLS.has(cell) && cx > box.x1 && cx < box.x2 && cy > box.y1 && cy < box.y2) return cell;
|
|
11325
|
+
const inner = cell.blocks ? walk(cell.blocks, depth + 1) : null;
|
|
11326
|
+
if (inner) return inner;
|
|
11327
|
+
}
|
|
11328
|
+
}
|
|
11329
|
+
return null;
|
|
11330
|
+
};
|
|
11331
|
+
return walk(blocks, 0);
|
|
11332
|
+
}
|
|
11333
|
+
function addToCell(cell, block) {
|
|
11334
|
+
if (!cell.blocks?.length && cell.text.trim()) cell.blocks = [{ type: "paragraph", text: cell.text }];
|
|
11335
|
+
cell.blocks = [...cell.blocks ?? [], block];
|
|
11336
|
+
const text = block.type === "table" && block.table ? block.table.cells.map((row) => row.map((c) => c.text.trim()).filter(Boolean).join(" ")).join("\n") : block.text ?? "";
|
|
11337
|
+
cell.text = [cell.text, text].filter((t) => t.trim()).join("\n");
|
|
11338
|
+
}
|
|
11304
11339
|
function axisTick(block, candidates) {
|
|
11305
11340
|
const b = block.bbox;
|
|
11306
11341
|
if (!/^\d$/u.test(block.text?.trim() ?? "")) return false;
|
|
@@ -11454,4 +11489,4 @@ export {
|
|
|
11454
11489
|
UNRULED_REGION_TABLES,
|
|
11455
11490
|
mergeOcrImageRegions
|
|
11456
11491
|
};
|
|
11457
|
-
//# sourceMappingURL=chunk-
|
|
11492
|
+
//# sourceMappingURL=chunk-G6HRSHV2.js.map
|