kordoc 4.24.21 → 4.24.22
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/{-IS4RXPEZ.js → -VCEFVSND.js} +11 -11
- package/dist/{chunk-Z6ONQ63K.js → chunk-35PIJFN6.js} +2 -2
- package/dist/{chunk-NRCG3ASU.js → chunk-3B7SMRWJ.js} +2 -2
- package/dist/{chunk-PDOWSDNM.js → chunk-4F6KDOS5.js} +2 -2
- package/dist/{chunk-OMGCVZ4W.cjs → chunk-4REIOZGL.cjs} +2 -2
- package/dist/{chunk-OMGCVZ4W.cjs.map → chunk-4REIOZGL.cjs.map} +1 -1
- package/dist/{chunk-O5ZCJEZ4.js → chunk-4TFAI3ED.js} +2 -2
- package/dist/{chunk-WVZSTMCZ.cjs → chunk-5DRJA7QR.cjs} +3 -3
- package/dist/{chunk-WVZSTMCZ.cjs.map → chunk-5DRJA7QR.cjs.map} +1 -1
- package/dist/{chunk-4OF7DHIT.js → chunk-6QRVXWR5.js} +4 -4
- package/dist/{chunk-BTBFKDPH.js → chunk-ABTMJUDG.js} +2 -2
- package/dist/{chunk-F4GZFIUJ.js → chunk-CC4NIJMB.js} +2 -2
- package/dist/{chunk-CPVXUEKF.js → chunk-D664D3FI.js} +2 -2
- package/dist/{chunk-WQC4XWVT.js → chunk-D72CU53J.js} +2 -2
- package/dist/{chunk-E6G4B457.js → chunk-GGRHL4YH.js} +2 -2
- package/dist/{chunk-B5M676H3.cjs → chunk-HA3YIEAS.cjs} +6 -6
- package/dist/{chunk-B5M676H3.cjs.map → chunk-HA3YIEAS.cjs.map} +1 -1
- package/dist/{chunk-BUFGW3UJ.cjs → chunk-I3SP3API.cjs} +212 -182
- package/dist/chunk-I3SP3API.cjs.map +1 -0
- package/dist/{chunk-MGCIQ43Y.js → chunk-JYYBXKZA.js} +3 -3
- package/dist/{chunk-BNEKESI4.js → chunk-KHTWVYXZ.js} +2 -2
- package/dist/{chunk-V7S36XCU.cjs → chunk-NFSD73DZ.cjs} +3 -3
- package/dist/{chunk-V7S36XCU.cjs.map → chunk-NFSD73DZ.cjs.map} +1 -1
- package/dist/{chunk-F6OHQLN7.js → chunk-OSA4N6SU.js} +37 -7
- package/dist/chunk-OSA4N6SU.js.map +1 -0
- package/dist/{chunk-BV2YG7M6.js → chunk-SGUJUZQO.js} +2 -2
- package/dist/{chunk-B3POEH7X.js → chunk-SWQRHUDA.js} +2 -2
- package/dist/{chunk-3RVASM4C.js → chunk-TR5VN742.js} +4 -4
- package/dist/{chunk-BMXWY36E.js → chunk-TWDML6TT.js} +38 -8
- package/dist/chunk-TWDML6TT.js.map +1 -0
- package/dist/{chunk-N45RCYBL.js → chunk-UD3HVA54.js} +3 -3
- package/dist/{chunk-NE75RO62.js → chunk-V3BF5CHZ.js} +2 -2
- package/dist/{chunk-IZN5BTCW.js → chunk-VEKQVNQB.js} +2 -2
- package/dist/{chunk-MYDHNNPA.js → chunk-VHOXQFOR.js} +36 -8
- package/dist/chunk-VHOXQFOR.js.map +1 -0
- package/dist/{chunk-L556KKBU.cjs → chunk-XQ3RVR6Q.cjs} +79 -79
- package/dist/{chunk-L556KKBU.cjs.map → chunk-XQ3RVR6Q.cjs.map} +1 -1
- package/dist/{chunk-MMZUWRH6.js → chunk-XQ5HPFAM.js} +11 -11
- package/dist/{chunk-UNYH6MTO.js → chunk-XQQBI2SA.js} +2 -2
- package/dist/chunks-ZLTYS4CR.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-DHBBWQLC.js → formula-3EGYBYNE.js} +3 -3
- package/dist/{formula-G3FQTUOY.cjs → formula-PHF3UITO.cjs} +9 -9
- package/dist/{formula-G3FQTUOY.cjs.map → formula-PHF3UITO.cjs.map} +1 -1
- package/dist/{formula-I4EA7ULD.js → formula-WMAQ55VQ.js} +4 -4
- package/dist/{image-ocr-5YWVBRY6.js → image-ocr-B2NN5TAL.js} +6 -6
- package/dist/{image-ocr-QUVBGNWD.js → image-ocr-KVJD6GHL.js} +9 -9
- package/dist/{image-ocr-THUO6YRG.cjs → image-ocr-T6LIG5GS.cjs} +17 -17
- package/dist/{image-ocr-THUO6YRG.cjs.map → image-ocr-T6LIG5GS.cjs.map} +1 -1
- package/dist/index.cjs +393 -365
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +23 -23
- package/dist/{model-bundle-6RG5PO3R.js → model-bundle-EXX3IODU.js} +5 -5
- package/dist/{models-CGYIGN6D.js → models-W2SESSYL.js} +5 -5
- package/dist/{parse-worker-v2-F5NXYBU6.js → parse-worker-v2-7BWE7KNP.js} +12 -12
- package/dist/{parser-G5QTRKII.js → parser-2PI6LJCI.js} +9 -9
- package/dist/{parser-I2C5DUXC.js → parser-CEAA577B.js} +12 -12
- package/dist/{parser-GJ4PKW7I.cjs → parser-YUINUJ4S.cjs} +159 -159
- package/dist/{parser-GJ4PKW7I.cjs.map → parser-YUINUJ4S.cjs.map} +1 -1
- package/dist/{pdf-ocr-TNW6YOPX.js → pdf-ocr-F3CIPEPL.js} +6 -6
- package/dist/pdf-ocr-OSTC5UJV.cjs +35 -0
- package/dist/{pdf-ocr-LJKCUXTE.cjs.map → pdf-ocr-OSTC5UJV.cjs.map} +1 -1
- package/dist/{pdf-ocr-U3I74Q4O.js → pdf-ocr-YGWCP4PR.js} +9 -9
- package/dist/{profile-io-5YZCFK7B.js → profile-io-SPV7R36C.js} +3 -3
- package/dist/{rasterize-7VRHPOQX.js → rasterize-LHEDECSI.js} +3 -3
- package/dist/{redact-doc-VK6VGBK3.js → redact-doc-IAO5G53U.js} +11 -11
- package/dist/{render-Y7J6DPRL.js → render-AUZ46UJ4.js} +7 -7
- package/dist/seal-V7X23PUW.js +10 -0
- package/dist/{setup-4XTUDU4X.js → setup-QSGBWJ6M.js} +3 -3
- package/dist/visual-DRB7R6X2.js +21 -0
- package/dist/{watch-SPZRLTKG.js → watch-GG4NB4MW.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-BMXWY36E.js.map +0 -1
- package/dist/chunk-BUFGW3UJ.cjs.map +0 -1
- package/dist/chunk-F6OHQLN7.js.map +0 -1
- package/dist/chunk-MYDHNNPA.js.map +0 -1
- package/dist/chunks-FYCQOIWO.js +0 -10
- package/dist/pdf-ocr-LJKCUXTE.cjs +0 -35
- package/dist/seal-4QIZ3ZNI.js +0 -10
- package/dist/visual-VEMQJ52W.js +0 -21
- /package/dist/{-IS4RXPEZ.js.map → -VCEFVSND.js.map} +0 -0
- /package/dist/{chunk-Z6ONQ63K.js.map → chunk-35PIJFN6.js.map} +0 -0
- /package/dist/{chunk-NRCG3ASU.js.map → chunk-3B7SMRWJ.js.map} +0 -0
- /package/dist/{chunk-PDOWSDNM.js.map → chunk-4F6KDOS5.js.map} +0 -0
- /package/dist/{chunk-O5ZCJEZ4.js.map → chunk-4TFAI3ED.js.map} +0 -0
- /package/dist/{chunk-4OF7DHIT.js.map → chunk-6QRVXWR5.js.map} +0 -0
- /package/dist/{chunk-BTBFKDPH.js.map → chunk-ABTMJUDG.js.map} +0 -0
- /package/dist/{chunk-F4GZFIUJ.js.map → chunk-CC4NIJMB.js.map} +0 -0
- /package/dist/{chunk-CPVXUEKF.js.map → chunk-D664D3FI.js.map} +0 -0
- /package/dist/{chunk-WQC4XWVT.js.map → chunk-D72CU53J.js.map} +0 -0
- /package/dist/{chunk-E6G4B457.js.map → chunk-GGRHL4YH.js.map} +0 -0
- /package/dist/{chunk-MGCIQ43Y.js.map → chunk-JYYBXKZA.js.map} +0 -0
- /package/dist/{chunk-BNEKESI4.js.map → chunk-KHTWVYXZ.js.map} +0 -0
- /package/dist/{chunk-BV2YG7M6.js.map → chunk-SGUJUZQO.js.map} +0 -0
- /package/dist/{chunk-B3POEH7X.js.map → chunk-SWQRHUDA.js.map} +0 -0
- /package/dist/{chunk-3RVASM4C.js.map → chunk-TR5VN742.js.map} +0 -0
- /package/dist/{chunk-N45RCYBL.js.map → chunk-UD3HVA54.js.map} +0 -0
- /package/dist/{chunk-NE75RO62.js.map → chunk-V3BF5CHZ.js.map} +0 -0
- /package/dist/{chunk-IZN5BTCW.js.map → chunk-VEKQVNQB.js.map} +0 -0
- /package/dist/{chunk-MMZUWRH6.js.map → chunk-XQ5HPFAM.js.map} +0 -0
- /package/dist/{chunk-UNYH6MTO.js.map → chunk-XQQBI2SA.js.map} +0 -0
- /package/dist/{chunks-FYCQOIWO.js.map → chunks-ZLTYS4CR.js.map} +0 -0
- /package/dist/{formula-DHBBWQLC.js.map → formula-3EGYBYNE.js.map} +0 -0
- /package/dist/{formula-I4EA7ULD.js.map → formula-WMAQ55VQ.js.map} +0 -0
- /package/dist/{image-ocr-5YWVBRY6.js.map → image-ocr-B2NN5TAL.js.map} +0 -0
- /package/dist/{image-ocr-QUVBGNWD.js.map → image-ocr-KVJD6GHL.js.map} +0 -0
- /package/dist/{model-bundle-6RG5PO3R.js.map → model-bundle-EXX3IODU.js.map} +0 -0
- /package/dist/{models-CGYIGN6D.js.map → models-W2SESSYL.js.map} +0 -0
- /package/dist/{parse-worker-v2-F5NXYBU6.js.map → parse-worker-v2-7BWE7KNP.js.map} +0 -0
- /package/dist/{parser-G5QTRKII.js.map → parser-2PI6LJCI.js.map} +0 -0
- /package/dist/{parser-I2C5DUXC.js.map → parser-CEAA577B.js.map} +0 -0
- /package/dist/{pdf-ocr-TNW6YOPX.js.map → pdf-ocr-F3CIPEPL.js.map} +0 -0
- /package/dist/{pdf-ocr-U3I74Q4O.js.map → pdf-ocr-YGWCP4PR.js.map} +0 -0
- /package/dist/{profile-io-5YZCFK7B.js.map → profile-io-SPV7R36C.js.map} +0 -0
- /package/dist/{rasterize-7VRHPOQX.js.map → rasterize-LHEDECSI.js.map} +0 -0
- /package/dist/{redact-doc-VK6VGBK3.js.map → redact-doc-IAO5G53U.js.map} +0 -0
- /package/dist/{render-Y7J6DPRL.js.map → render-AUZ46UJ4.js.map} +0 -0
- /package/dist/{seal-4QIZ3ZNI.js.map → seal-V7X23PUW.js.map} +0 -0
- /package/dist/{setup-4XTUDU4X.js.map → setup-QSGBWJ6M.js.map} +0 -0
- /package/dist/{visual-VEMQJ52W.js.map → visual-DRB7R6X2.js.map} +0 -0
- /package/dist/{watch-SPZRLTKG.js.map → watch-GG4NB4MW.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KordocError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-D72CU53J.js";
|
|
5
5
|
|
|
6
6
|
// src/shared/offline.ts
|
|
7
7
|
import { realpathSync } from "fs";
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
getAccessRoot,
|
|
50
50
|
assertWithinRoot
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-SGUJUZQO.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
escapeHtml,
|
|
4
4
|
sanitizeHref
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-D72CU53J.js";
|
|
6
6
|
|
|
7
7
|
// src/shared/symbol-fonts.ts
|
|
8
8
|
var WINGDINGS = [
|
|
@@ -1183,4 +1183,4 @@ export {
|
|
|
1183
1183
|
visibleText,
|
|
1184
1184
|
escapeHtmlCellText
|
|
1185
1185
|
};
|
|
1186
|
-
//# sourceMappingURL=chunk-
|
|
1186
|
+
//# sourceMappingURL=chunk-SWQRHUDA.js.map
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
splitRowBands,
|
|
32
32
|
starRun,
|
|
33
33
|
tallInkCount
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OSA4N6SU.js";
|
|
35
35
|
import {
|
|
36
36
|
validateOcrOptions
|
|
37
37
|
} from "./chunk-IQJKLIJV.js";
|
|
@@ -42,11 +42,11 @@ import {
|
|
|
42
42
|
ocrSourcePath,
|
|
43
43
|
parseCharacterDict,
|
|
44
44
|
resolveOcrModels
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-GGRHL4YH.js";
|
|
46
46
|
import {
|
|
47
47
|
KordocError,
|
|
48
48
|
OPTIONAL_DEP_INSTALL_HINT
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-D72CU53J.js";
|
|
50
50
|
|
|
51
51
|
// src/ocr/ruling-lines.ts
|
|
52
52
|
var INK_LUMA_MAX = 205;
|
|
@@ -2259,4 +2259,4 @@ export {
|
|
|
2259
2259
|
groupOcrLines,
|
|
2260
2260
|
ocrItemsToBlocks
|
|
2261
2261
|
};
|
|
2262
|
-
//# sourceMappingURL=chunk-
|
|
2262
|
+
//# sourceMappingURL=chunk-TR5VN742.js.map
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
HEADING_RATIO_H3,
|
|
6
6
|
tidyScriptTags,
|
|
7
7
|
toTex
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4F6KDOS5.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureModelsIn,
|
|
11
11
|
getModelsDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-V3BF5CHZ.js";
|
|
13
13
|
import {
|
|
14
14
|
safeMax,
|
|
15
15
|
safeMin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XQQBI2SA.js";
|
|
17
17
|
|
|
18
18
|
// src/ocr/models.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -1216,7 +1216,10 @@ function extractLines(fnArray, argsArray) {
|
|
|
1216
1216
|
classifyAndAdd(seg, effWidth, horizontals, verticals, fromFill, fromFill ? void 0 : { h: shortH, v: shortV });
|
|
1217
1217
|
});
|
|
1218
1218
|
if (from) outs.forEach((o, k) => {
|
|
1219
|
-
for (let n = from[k]; n < o.length; n++) if (white || k < 2 && !thinFill.has(o[n]))
|
|
1219
|
+
for (let n = from[k]; n < o.length; n++) if (white || k < 2 && !thinFill.has(o[n])) {
|
|
1220
|
+
nonRules.add(o[n]);
|
|
1221
|
+
if (white) WHITE_EDGES.add(o[n]);
|
|
1222
|
+
}
|
|
1220
1223
|
});
|
|
1221
1224
|
currentPath = [];
|
|
1222
1225
|
}
|
|
@@ -1543,8 +1546,15 @@ function preprocessLines(horizontals, verticals, nonRules) {
|
|
|
1543
1546
|
let v = verticals.filter((l) => l.lineWidth <= MAX_LINE_WIDTH);
|
|
1544
1547
|
h = dropShadingStacks(h, "h");
|
|
1545
1548
|
v = dropShadingStacks(v, "v");
|
|
1546
|
-
h = mergeParallelLines(h, "h", nonRules);
|
|
1549
|
+
h = mergeParallelLines(h, "h", nonRules, v);
|
|
1547
1550
|
v = mergeParallelLines(v, "v", nonRules);
|
|
1551
|
+
if (nonRules) {
|
|
1552
|
+
const visH = h.filter((l) => !nonRules.has(l)), visV = v.filter((l) => !nonRules.has(l));
|
|
1553
|
+
const crossH = (w) => visV.filter((c) => c.x1 > w.x1 + 1 && c.x1 < w.x2 - 1 && Math.min(c.y1, c.y2) < w.y1 - 2 && Math.max(c.y1, c.y2) > w.y1 + 2).length;
|
|
1554
|
+
const crossV = (w) => visH.filter((c) => c.y1 > Math.min(w.y1, w.y2) + 1 && c.y1 < Math.max(w.y1, w.y2) - 1 && Math.min(c.x1, c.x2) < w.x1 - 2 && Math.max(c.x1, c.x2) > w.x1 + 2).length;
|
|
1555
|
+
h = h.filter((l) => !(WHITE_EDGES.has(l) && nonRules.has(l) && crossH(l) >= 2));
|
|
1556
|
+
v = v.filter((l) => !(WHITE_EDGES.has(l) && nonRules.has(l) && crossV(l) >= 2));
|
|
1557
|
+
}
|
|
1548
1558
|
return { horizontals: h, verticals: v };
|
|
1549
1559
|
}
|
|
1550
1560
|
var STACK_GAP = 2;
|
|
@@ -1712,7 +1722,8 @@ function closeOpenTableEdges(horizontals, verticals) {
|
|
|
1712
1722
|
}
|
|
1713
1723
|
return synthesized.length ? [...verticals, ...synthesized] : verticals;
|
|
1714
1724
|
}
|
|
1715
|
-
|
|
1725
|
+
var WHITE_EDGES = /* @__PURE__ */ new WeakSet();
|
|
1726
|
+
function mergeParallelLines(lines, dir, nonRules, perp) {
|
|
1716
1727
|
if (lines.length <= 1) return lines;
|
|
1717
1728
|
const sorted = [...lines].sort((a, b) => {
|
|
1718
1729
|
const posA = dir === "h" ? a.y1 : a.x1;
|
|
@@ -1735,7 +1746,26 @@ function mergeParallelLines(lines, dir, nonRules) {
|
|
|
1735
1746
|
const overlap2 = Math.min(prevEnd, currEnd) - Math.max(prevStart, currStart);
|
|
1736
1747
|
const minLen = Math.min(prevEnd - prevStart, currEnd - currStart);
|
|
1737
1748
|
if (overlap2 > minLen * 0.3) {
|
|
1738
|
-
|
|
1749
|
+
const bgPrev = !!nonRules?.has(prev) && !nonRules.has(curr), bgCurr = !!nonRules?.has(curr) && !nonRules.has(prev);
|
|
1750
|
+
const whPrev = bgPrev && WHITE_EDGES.has(prev), whCurr = bgCurr && WHITE_EDGES.has(curr);
|
|
1751
|
+
if (bgPrev) nonRules.delete(prev);
|
|
1752
|
+
const clip = (w, o) => {
|
|
1753
|
+
if (dir !== "h" || !perp) return false;
|
|
1754
|
+
let n = 0;
|
|
1755
|
+
for (const c of perp) {
|
|
1756
|
+
if (nonRules.has(c) || Math.min(c.y1, c.y2) >= w.y1 - 2 || Math.max(c.y1, c.y2) <= w.y1 + 2) continue;
|
|
1757
|
+
if (c.x1 > w.x1 + 1 && c.x1 < o.x1 - 1 || c.x1 > o.x2 + 1 && c.x1 < w.x2 - 1) n++;
|
|
1758
|
+
}
|
|
1759
|
+
return n >= 2;
|
|
1760
|
+
};
|
|
1761
|
+
if (whPrev && clip(prev, curr)) {
|
|
1762
|
+
prev.x1 = curr.x1;
|
|
1763
|
+
prev.x2 = curr.x2;
|
|
1764
|
+
prev.y1 = prev.y2 = curr.y1;
|
|
1765
|
+
prev.lineWidth = curr.lineWidth;
|
|
1766
|
+
continue;
|
|
1767
|
+
}
|
|
1768
|
+
if (whCurr && clip(curr, prev)) continue;
|
|
1739
1769
|
if (dir === "h") {
|
|
1740
1770
|
prev.x1 = Math.min(prev.x1, curr.x1);
|
|
1741
1771
|
prev.x2 = Math.max(prev.x2, curr.x2);
|
|
@@ -10510,4 +10540,4 @@ export {
|
|
|
10510
10540
|
UNRULED_REGION_TABLES,
|
|
10511
10541
|
mergeOcrImageRegions
|
|
10512
10542
|
};
|
|
10513
|
-
//# sourceMappingURL=chunk-
|
|
10543
|
+
//# sourceMappingURL=chunk-TWDML6TT.js.map
|