@tienne/gestalt 0.146.0 → 0.148.0
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/dist/package.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/role-agents/video-summarizer/AGENT.md +11 -0
- package/dist/plugin/skills/conductor/SKILL.md +3 -3
- package/dist/plugin/skills/lens/SKILL.md +2 -0
- package/dist/plugin/skills/video-digest/SKILL.md +45 -6
- package/dist/src/cli/commands/conductor.d.ts.map +1 -1
- package/dist/src/cli/commands/conductor.js +64 -31
- package/dist/src/cli/commands/conductor.js.map +1 -1
- package/dist/src/cli/commands/digest.d.ts +5 -1
- package/dist/src/cli/commands/digest.d.ts.map +1 -1
- package/dist/src/cli/commands/digest.js +39 -8
- package/dist/src/cli/commands/digest.js.map +1 -1
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +9 -3
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/conductor/engine.d.ts.map +1 -1
- package/dist/src/conductor/engine.js +69 -11
- package/dist/src/conductor/engine.js.map +1 -1
- package/dist/src/conductor/launcher.d.ts +4 -1
- package/dist/src/conductor/launcher.d.ts.map +1 -1
- package/dist/src/conductor/launcher.js +18 -7
- package/dist/src/conductor/launcher.js.map +1 -1
- package/dist/src/conductor/store.d.ts +1 -2
- package/dist/src/conductor/store.d.ts.map +1 -1
- package/dist/src/conductor/store.js +2 -5
- package/dist/src/conductor/store.js.map +1 -1
- package/dist/src/conductor/types.d.ts +2 -0
- package/dist/src/conductor/types.d.ts.map +1 -1
- package/dist/src/conductor/types.js.map +1 -1
- package/dist/src/conductor/wait.d.ts +16 -3
- package/dist/src/conductor/wait.d.ts.map +1 -1
- package/dist/src/conductor/wait.js +127 -20
- package/dist/src/conductor/wait.js.map +1 -1
- package/dist/src/core/config.d.ts +12 -0
- package/dist/src/core/config.d.ts.map +1 -1
- package/dist/src/core/config.js +4 -0
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/core/json-file.d.ts +2 -0
- package/dist/src/core/json-file.d.ts.map +1 -1
- package/dist/src/core/json-file.js +4 -1
- package/dist/src/core/json-file.js.map +1 -1
- package/dist/src/digest/blocks.d.ts +716 -0
- package/dist/src/digest/blocks.d.ts.map +1 -1
- package/dist/src/digest/diagram-schema.d.ts +130 -0
- package/dist/src/digest/diagram-schema.d.ts.map +1 -1
- package/dist/src/digest/followups.d.ts +42 -0
- package/dist/src/digest/followups.d.ts.map +1 -0
- package/dist/src/digest/followups.js +137 -0
- package/dist/src/digest/followups.js.map +1 -0
- package/dist/src/digest/lens-schema.d.ts +46 -0
- package/dist/src/digest/lens-schema.d.ts.map +1 -1
- package/dist/src/digest/lens-source.d.ts +10 -0
- package/dist/src/digest/lens-source.d.ts.map +1 -1
- package/dist/src/digest/lens-source.js +10 -0
- package/dist/src/digest/lens-source.js.map +1 -1
- package/dist/src/digest/lens-widget-schema.d.ts +104 -0
- package/dist/src/digest/lens-widget-schema.d.ts.map +1 -1
- package/dist/src/digest/library.d.ts +2 -0
- package/dist/src/digest/library.d.ts.map +1 -0
- package/dist/src/digest/library.js +83 -0
- package/dist/src/digest/library.js.map +1 -0
- package/dist/src/digest/lint-cite.d.ts +7 -0
- package/dist/src/digest/lint-cite.d.ts.map +1 -0
- package/dist/src/digest/lint-cite.js +58 -0
- package/dist/src/digest/lint-cite.js.map +1 -0
- package/dist/src/digest/lint-extension.d.ts +3 -0
- package/dist/src/digest/lint-extension.d.ts.map +1 -1
- package/dist/src/digest/lint-extension.js +17 -41
- package/dist/src/digest/lint-extension.js.map +1 -1
- package/dist/src/digest/lint-followups.d.ts +8 -0
- package/dist/src/digest/lint-followups.d.ts.map +1 -0
- package/dist/src/digest/lint-followups.js +59 -0
- package/dist/src/digest/lint-followups.js.map +1 -0
- package/dist/src/digest/lint-lens.d.ts.map +1 -1
- package/dist/src/digest/lint-lens.js +6 -4
- package/dist/src/digest/lint-lens.js.map +1 -1
- package/dist/src/digest/lint.d.ts.map +1 -1
- package/dist/src/digest/lint.js +53 -15
- package/dist/src/digest/lint.js.map +1 -1
- package/dist/src/digest/merge.d.ts.map +1 -1
- package/dist/src/digest/merge.js +3 -0
- package/dist/src/digest/merge.js.map +1 -1
- package/dist/src/digest/render-html.d.ts +2 -1
- package/dist/src/digest/render-html.d.ts.map +1 -1
- package/dist/src/digest/render-html.js +41 -8
- package/dist/src/digest/render-html.js.map +1 -1
- package/dist/src/digest/render-lens.d.ts.map +1 -1
- package/dist/src/digest/render-lens.js +7 -2
- package/dist/src/digest/render-lens.js.map +1 -1
- package/dist/src/digest/render-md.d.ts +3 -2
- package/dist/src/digest/render-md.d.ts.map +1 -1
- package/dist/src/digest/render-md.js +46 -8
- package/dist/src/digest/render-md.js.map +1 -1
- package/dist/src/digest/render-slides.d.ts +9 -0
- package/dist/src/digest/render-slides.d.ts.map +1 -0
- package/dist/src/digest/render-slides.js +99 -0
- package/dist/src/digest/render-slides.js.map +1 -0
- package/dist/src/digest/render.d.ts +2 -0
- package/dist/src/digest/render.d.ts.map +1 -1
- package/dist/src/digest/render.js +16 -5
- package/dist/src/digest/render.js.map +1 -1
- package/dist/src/digest/schema-base.d.ts +6 -0
- package/dist/src/digest/schema-base.d.ts.map +1 -1
- package/dist/src/digest/schema-base.js +2 -0
- package/dist/src/digest/schema-base.js.map +1 -1
- package/dist/src/digest/schema.d.ts +3209 -16
- package/dist/src/digest/schema.d.ts.map +1 -1
- package/dist/src/digest/schema.js +16 -0
- package/dist/src/digest/schema.js.map +1 -1
- package/dist/src/digest/server.d.ts.map +1 -1
- package/dist/src/digest/server.js +16 -3
- package/dist/src/digest/server.js.map +1 -1
- package/dist/src/digest/slides.d.ts +16 -0
- package/dist/src/digest/slides.d.ts.map +1 -0
- package/dist/src/digest/slides.js +48 -0
- package/dist/src/digest/slides.js.map +1 -0
- package/dist/src/digest/viewer-js.d.ts.map +1 -1
- package/dist/src/digest/viewer-js.js +35 -27
- package/dist/src/digest/viewer-js.js.map +1 -1
- package/dist/src/lens/attach.d.ts +87 -0
- package/dist/src/lens/attach.d.ts.map +1 -1
- package/dist/src/lens/digest-slides.d.ts +15 -0
- package/dist/src/lens/digest-slides.d.ts.map +1 -0
- package/dist/src/lens/digest-slides.js +61 -0
- package/dist/src/lens/digest-slides.js.map +1 -0
- package/dist/src/lens/ingest.d.ts.map +1 -1
- package/dist/src/lens/ingest.js +8 -4
- package/dist/src/lens/ingest.js.map +1 -1
- package/dist/src/lens/pdf-extract-py.d.ts.map +1 -1
- package/dist/src/lens/pdf-extract-py.js +57 -4
- package/dist/src/lens/pdf-extract-py.js.map +1 -1
- package/dist/src/mcp/tools/digest-passthrough.d.ts.map +1 -1
- package/dist/src/mcp/tools/digest-passthrough.js +2 -0
- package/dist/src/mcp/tools/digest-passthrough.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/mcp.json +1 -1
- package/plugin/role-agents/video-summarizer/AGENT.md +11 -0
- package/plugin/skills/conductor/SKILL.md +3 -3
- package/plugin/skills/lens/SKILL.md +2 -0
- package/plugin/skills/video-digest/SKILL.md +45 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram-schema.d.ts","sourceRoot":"","sources":["../../../src/digest/diagram-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAC;AAE1D;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAMpD,CAAC;AAaF,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+DxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Cite, Report, Transcript } from './schema.js';
|
|
2
|
+
type Span = {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
};
|
|
6
|
+
interface Claim {
|
|
7
|
+
anchor: Cite;
|
|
8
|
+
text: string;
|
|
9
|
+
comparison?: string;
|
|
10
|
+
}
|
|
11
|
+
/** 구간 본문에 이미 인용된 영상 발언만 후속 설명의 시작점으로 쓴다 */
|
|
12
|
+
export declare function followupClaims(report: Report, span: Span): Claim[];
|
|
13
|
+
/** 후속 인용에 앞선 발언의 문맥을 식별하는 말이 있는지 최소한으로 검사한다 */
|
|
14
|
+
export declare function hasFollowupContext(transcript: Transcript, span: Span, anchor: Cite, quote: string): boolean;
|
|
15
|
+
/** 지역에서 관련 대목만 고른다. 후보가 실제로 같은 주장을 보충하는지는 양쪽 원문으로 판정한다 */
|
|
16
|
+
export declare function findFollowupCandidates(transcript: Transcript, report: Report): {
|
|
17
|
+
claim: string;
|
|
18
|
+
comparison: string | undefined;
|
|
19
|
+
anchor: {
|
|
20
|
+
key: number;
|
|
21
|
+
from: number;
|
|
22
|
+
to: number;
|
|
23
|
+
source?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
before: {
|
|
26
|
+
i: number;
|
|
27
|
+
startSec: number;
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
cite: {
|
|
31
|
+
key: number;
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
};
|
|
35
|
+
after: {
|
|
36
|
+
i: number;
|
|
37
|
+
startSec: number;
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
}[];
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=followups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followups.d.ts","sourceRoot":"","sources":["../../../src/digest/followups.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,IAAI,EAAE,MAAM,EAAW,UAAU,EAAE,MAAM,aAAa,CAAC;AAc7E,KAAK,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AACzC,UAAU,KAAK;IACb,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,CAoBlE;AA6BD,+CAA+C;AAC/C,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAOT;AAED,0DAA0D;AAC1D,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;IAuE5E"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { rangeSpan } from './reports.js';
|
|
2
|
+
const STOP_WORDS = new Set('about actually after again also and are because been being both can could does each even every first for from gonna had has have here how just like make might more most much now only other our out over really say see should some than that the their them then there these they thing this those through time too two use used very want was way were what when where which who will with would yeah you your'.split(' '));
|
|
3
|
+
const REFERS_BACK = /\b(?:earlier|up until now|to be precise|to clarify|i meant|let me correct)\b|앞에서|정확히 말하면|정정하/u;
|
|
4
|
+
const CLARIFICATION_CUE = /\bactually\b|실제로는|정확히는/u;
|
|
5
|
+
const MAX_CANDIDATES = 24;
|
|
6
|
+
const MAX_PER_CLAIM = 3;
|
|
7
|
+
const MAX_SEGMENT_CHARS = 350;
|
|
8
|
+
function* bullets(items) {
|
|
9
|
+
for (const item of items) {
|
|
10
|
+
yield item;
|
|
11
|
+
if (item.children)
|
|
12
|
+
yield* bullets(item.children);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** 구간 본문에 이미 인용된 영상 발언만 후속 설명의 시작점으로 쓴다 */
|
|
16
|
+
export function followupClaims(report, span) {
|
|
17
|
+
const claims = new Map();
|
|
18
|
+
for (const section of report.sections) {
|
|
19
|
+
for (const sub of section.subsections) {
|
|
20
|
+
for (const bullet of bullets(sub.bullets)) {
|
|
21
|
+
const anchor = bullet.comparison?.video.cite ?? bullet.cite;
|
|
22
|
+
if (anchor.source || anchor.from < span.from || anchor.to > span.to)
|
|
23
|
+
continue;
|
|
24
|
+
if (anchor.key < anchor.from || anchor.key > anchor.to)
|
|
25
|
+
continue;
|
|
26
|
+
const comparison = bullet.comparison?.note;
|
|
27
|
+
if (!claims.has(anchor.key) || comparison) {
|
|
28
|
+
claims.set(anchor.key, {
|
|
29
|
+
anchor,
|
|
30
|
+
text: bullet.text,
|
|
31
|
+
...(comparison ? { comparison } : {}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return [...claims.values()];
|
|
38
|
+
}
|
|
39
|
+
function terms(text) {
|
|
40
|
+
const found = text
|
|
41
|
+
.normalize('NFKC')
|
|
42
|
+
.toLowerCase()
|
|
43
|
+
.match(/[\p{L}]{3,}/gu) ?? [];
|
|
44
|
+
return new Set(found
|
|
45
|
+
.map((word) => word.replace(/^([a-z]{3,}[^s])s$/, '$1'))
|
|
46
|
+
.filter((word) => !STOP_WORDS.has(word)));
|
|
47
|
+
}
|
|
48
|
+
function excerpt(segments, from, to) {
|
|
49
|
+
return segments
|
|
50
|
+
.slice(from, to + 1)
|
|
51
|
+
.map(({ i, startSec, text }) => ({ i, startSec, text: text.slice(0, MAX_SEGMENT_CHARS) }));
|
|
52
|
+
}
|
|
53
|
+
function anchorExcerpt(transcript, anchor, span) {
|
|
54
|
+
return excerpt(transcript.segments, Math.max(span.from, anchor.key - 3), Math.min(span.to, anchor.key + 2));
|
|
55
|
+
}
|
|
56
|
+
/** 후속 인용에 앞선 발언의 문맥을 식별하는 말이 있는지 최소한으로 검사한다 */
|
|
57
|
+
export function hasFollowupContext(transcript, span, anchor, quote) {
|
|
58
|
+
const before = terms(anchorExcerpt(transcript, anchor, span)
|
|
59
|
+
.map((s) => s.text)
|
|
60
|
+
.join(' '));
|
|
61
|
+
return [...terms(quote)].filter((word) => before.has(word)).length >= 2;
|
|
62
|
+
}
|
|
63
|
+
/** 지역에서 관련 대목만 고른다. 후보가 실제로 같은 주장을 보충하는지는 양쪽 원문으로 판정한다 */
|
|
64
|
+
export function findFollowupCandidates(transcript, report) {
|
|
65
|
+
const range = report.options.range;
|
|
66
|
+
const video = transcript.meta.source === 'youtube' || transcript.meta.source === 'file';
|
|
67
|
+
const span = range && video ? rangeSpan(range, transcript.segments) : null;
|
|
68
|
+
if (!span)
|
|
69
|
+
return [];
|
|
70
|
+
const claims = followupClaims(report, span);
|
|
71
|
+
const { segments } = transcript;
|
|
72
|
+
const first = span.to + 1;
|
|
73
|
+
const after = segments.slice(first).map((segment) => terms(segment.text));
|
|
74
|
+
const frequencies = new Map();
|
|
75
|
+
for (const tokens of after) {
|
|
76
|
+
for (const word of tokens)
|
|
77
|
+
frequencies.set(word, (frequencies.get(word) ?? 0) + 1);
|
|
78
|
+
}
|
|
79
|
+
const weight = (word) => Math.log1p(after.length / (frequencies.get(word) ?? 1));
|
|
80
|
+
const ranked = claims.flatMap((claim) => {
|
|
81
|
+
const { anchor } = claim;
|
|
82
|
+
const before = anchorExcerpt(transcript, anchor, span);
|
|
83
|
+
const keyTerms = terms(segments[anchor.key]?.text ?? '');
|
|
84
|
+
const anchorTerms = terms(before.map((s) => s.text).join(' '));
|
|
85
|
+
const windows = after.flatMap((tokens, offset) => {
|
|
86
|
+
if (![...tokens].some((word) => keyTerms.has(word)))
|
|
87
|
+
return [];
|
|
88
|
+
const key = first + offset;
|
|
89
|
+
const from = Math.max(first, key - 2);
|
|
90
|
+
const to = Math.min(segments.length - 1, key + 4);
|
|
91
|
+
const nearby = excerpt(segments, from, to);
|
|
92
|
+
const windowText = nearby
|
|
93
|
+
.map((s) => s.text)
|
|
94
|
+
.join(' ')
|
|
95
|
+
.toLowerCase();
|
|
96
|
+
const local = terms(windowText);
|
|
97
|
+
const shared = [...local].filter((word) => anchorTerms.has(word));
|
|
98
|
+
if (shared.length < 2)
|
|
99
|
+
return [];
|
|
100
|
+
const score = shared.reduce((n, word) => n + weight(word), 0) +
|
|
101
|
+
[...tokens].filter((word) => keyTerms.has(word)).reduce((n, word) => n + weight(word), 0) +
|
|
102
|
+
(REFERS_BACK.test(windowText) ? 12 : 0) +
|
|
103
|
+
(CLARIFICATION_CUE.test(segments[key]?.text.toLowerCase() ?? '') ? 3 : 0);
|
|
104
|
+
return [{ score, cite: { key, from, to }, after: nearby }];
|
|
105
|
+
});
|
|
106
|
+
windows.sort((a, b) => b.score - a.score || a.cite.key - b.cite.key);
|
|
107
|
+
const best = [];
|
|
108
|
+
for (const window of windows) {
|
|
109
|
+
if (best.some((other) => other.cite.to >= window.cite.from && other.cite.from <= window.cite.to))
|
|
110
|
+
continue;
|
|
111
|
+
best.push(window);
|
|
112
|
+
if (best.length === MAX_PER_CLAIM)
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return best.map(({ score, cite, after }) => ({
|
|
116
|
+
rank: score + (claim.comparison ? 100 : 0),
|
|
117
|
+
claim: claim.text.slice(0, MAX_SEGMENT_CHARS),
|
|
118
|
+
...(claim.comparison ? { comparison: claim.comparison.slice(0, MAX_SEGMENT_CHARS) } : {}),
|
|
119
|
+
anchor,
|
|
120
|
+
before,
|
|
121
|
+
cite,
|
|
122
|
+
after,
|
|
123
|
+
}));
|
|
124
|
+
});
|
|
125
|
+
return ranked
|
|
126
|
+
.sort((a, b) => b.rank - a.rank || a.anchor.key - b.anchor.key)
|
|
127
|
+
.slice(0, MAX_CANDIDATES)
|
|
128
|
+
.map(({ claim, comparison, anchor, before, cite, after }) => ({
|
|
129
|
+
claim,
|
|
130
|
+
comparison,
|
|
131
|
+
anchor,
|
|
132
|
+
before,
|
|
133
|
+
cite,
|
|
134
|
+
after,
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=followups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followups.js","sourceRoot":"","sources":["../../../src/digest/followups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,mZAAmZ,CAAC,KAA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CAAC;YAC3C,IAAI,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1C,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC;YAC7C,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzF,MAAM;YACN,MAAM;YACN,IAAI;YACJ,KAAK;SACN,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IACH,OAAO,MAAM;SACV,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC9D,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;SACxB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5D,KAAK;QACL,UAAU;QACV,MAAM;QACN,MAAM;QACN,IAAI;QACJ,KAAK;KACN,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -32,6 +32,7 @@ export declare const evidenceSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
32
32
|
table: string;
|
|
33
33
|
}>, z.ZodObject<{
|
|
34
34
|
cite: z.ZodEffects<z.ZodObject<{
|
|
35
|
+
source: z.ZodOptional<z.ZodString>;
|
|
35
36
|
key: z.ZodNumber;
|
|
36
37
|
from: z.ZodNumber;
|
|
37
38
|
to: z.ZodNumber;
|
|
@@ -39,30 +40,36 @@ export declare const evidenceSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
39
40
|
key: number;
|
|
40
41
|
from: number;
|
|
41
42
|
to: number;
|
|
43
|
+
source?: string | undefined;
|
|
42
44
|
}, {
|
|
43
45
|
key: number;
|
|
44
46
|
from: number;
|
|
45
47
|
to: number;
|
|
48
|
+
source?: string | undefined;
|
|
46
49
|
}>, {
|
|
47
50
|
key: number;
|
|
48
51
|
from: number;
|
|
49
52
|
to: number;
|
|
53
|
+
source?: string | undefined;
|
|
50
54
|
}, {
|
|
51
55
|
key: number;
|
|
52
56
|
from: number;
|
|
53
57
|
to: number;
|
|
58
|
+
source?: string | undefined;
|
|
54
59
|
}>;
|
|
55
60
|
}, "strip", z.ZodTypeAny, {
|
|
56
61
|
cite: {
|
|
57
62
|
key: number;
|
|
58
63
|
from: number;
|
|
59
64
|
to: number;
|
|
65
|
+
source?: string | undefined;
|
|
60
66
|
};
|
|
61
67
|
}, {
|
|
62
68
|
cite: {
|
|
63
69
|
key: number;
|
|
64
70
|
from: number;
|
|
65
71
|
to: number;
|
|
72
|
+
source?: string | undefined;
|
|
66
73
|
};
|
|
67
74
|
}>]>;
|
|
68
75
|
/**
|
|
@@ -147,6 +154,7 @@ export declare const doubtSchema: z.ZodObject<{
|
|
|
147
154
|
table: string;
|
|
148
155
|
}>, z.ZodObject<{
|
|
149
156
|
cite: z.ZodEffects<z.ZodObject<{
|
|
157
|
+
source: z.ZodOptional<z.ZodString>;
|
|
150
158
|
key: z.ZodNumber;
|
|
151
159
|
from: z.ZodNumber;
|
|
152
160
|
to: z.ZodNumber;
|
|
@@ -154,30 +162,36 @@ export declare const doubtSchema: z.ZodObject<{
|
|
|
154
162
|
key: number;
|
|
155
163
|
from: number;
|
|
156
164
|
to: number;
|
|
165
|
+
source?: string | undefined;
|
|
157
166
|
}, {
|
|
158
167
|
key: number;
|
|
159
168
|
from: number;
|
|
160
169
|
to: number;
|
|
170
|
+
source?: string | undefined;
|
|
161
171
|
}>, {
|
|
162
172
|
key: number;
|
|
163
173
|
from: number;
|
|
164
174
|
to: number;
|
|
175
|
+
source?: string | undefined;
|
|
165
176
|
}, {
|
|
166
177
|
key: number;
|
|
167
178
|
from: number;
|
|
168
179
|
to: number;
|
|
180
|
+
source?: string | undefined;
|
|
169
181
|
}>;
|
|
170
182
|
}, "strip", z.ZodTypeAny, {
|
|
171
183
|
cite: {
|
|
172
184
|
key: number;
|
|
173
185
|
from: number;
|
|
174
186
|
to: number;
|
|
187
|
+
source?: string | undefined;
|
|
175
188
|
};
|
|
176
189
|
}, {
|
|
177
190
|
cite: {
|
|
178
191
|
key: number;
|
|
179
192
|
from: number;
|
|
180
193
|
to: number;
|
|
194
|
+
source?: string | undefined;
|
|
181
195
|
};
|
|
182
196
|
}>]>, "many">;
|
|
183
197
|
direction: z.ZodOptional<z.ZodObject<{
|
|
@@ -247,6 +261,7 @@ export declare const doubtSchema: z.ZodObject<{
|
|
|
247
261
|
key: number;
|
|
248
262
|
from: number;
|
|
249
263
|
to: number;
|
|
264
|
+
source?: string | undefined;
|
|
250
265
|
};
|
|
251
266
|
})[];
|
|
252
267
|
direction?: {
|
|
@@ -274,6 +289,7 @@ export declare const doubtSchema: z.ZodObject<{
|
|
|
274
289
|
key: number;
|
|
275
290
|
from: number;
|
|
276
291
|
to: number;
|
|
292
|
+
source?: string | undefined;
|
|
277
293
|
};
|
|
278
294
|
})[];
|
|
279
295
|
direction?: {
|
|
@@ -297,6 +313,7 @@ export declare const glanceSchema: z.ZodObject<{
|
|
|
297
313
|
kind: z.ZodEnum<["problem", "method", "result", "limit", "claim", "evidence", "topic"]>;
|
|
298
314
|
text: z.ZodString;
|
|
299
315
|
cite: z.ZodEffects<z.ZodObject<{
|
|
316
|
+
source: z.ZodOptional<z.ZodString>;
|
|
300
317
|
key: z.ZodNumber;
|
|
301
318
|
from: z.ZodNumber;
|
|
302
319
|
to: z.ZodNumber;
|
|
@@ -304,18 +321,22 @@ export declare const glanceSchema: z.ZodObject<{
|
|
|
304
321
|
key: number;
|
|
305
322
|
from: number;
|
|
306
323
|
to: number;
|
|
324
|
+
source?: string | undefined;
|
|
307
325
|
}, {
|
|
308
326
|
key: number;
|
|
309
327
|
from: number;
|
|
310
328
|
to: number;
|
|
329
|
+
source?: string | undefined;
|
|
311
330
|
}>, {
|
|
312
331
|
key: number;
|
|
313
332
|
from: number;
|
|
314
333
|
to: number;
|
|
334
|
+
source?: string | undefined;
|
|
315
335
|
}, {
|
|
316
336
|
key: number;
|
|
317
337
|
from: number;
|
|
318
338
|
to: number;
|
|
339
|
+
source?: string | undefined;
|
|
319
340
|
}>;
|
|
320
341
|
}, "strip", z.ZodTypeAny, {
|
|
321
342
|
text: string;
|
|
@@ -324,6 +345,7 @@ export declare const glanceSchema: z.ZodObject<{
|
|
|
324
345
|
key: number;
|
|
325
346
|
from: number;
|
|
326
347
|
to: number;
|
|
348
|
+
source?: string | undefined;
|
|
327
349
|
};
|
|
328
350
|
}, {
|
|
329
351
|
text: string;
|
|
@@ -332,6 +354,7 @@ export declare const glanceSchema: z.ZodObject<{
|
|
|
332
354
|
key: number;
|
|
333
355
|
from: number;
|
|
334
356
|
to: number;
|
|
357
|
+
source?: string | undefined;
|
|
335
358
|
};
|
|
336
359
|
}>;
|
|
337
360
|
/** 원문 표나 그림을 소섹션에 싣는다. 칸 내용은 source.json에서 렌더러가 옮겨서 모델이 숫자를 다시 적지 않는다 */
|
|
@@ -362,6 +385,7 @@ export declare const limitSchema: z.ZodObject<{
|
|
|
362
385
|
table: string;
|
|
363
386
|
}>, z.ZodObject<{
|
|
364
387
|
cite: z.ZodEffects<z.ZodObject<{
|
|
388
|
+
source: z.ZodOptional<z.ZodString>;
|
|
365
389
|
key: z.ZodNumber;
|
|
366
390
|
from: z.ZodNumber;
|
|
367
391
|
to: z.ZodNumber;
|
|
@@ -369,30 +393,36 @@ export declare const limitSchema: z.ZodObject<{
|
|
|
369
393
|
key: number;
|
|
370
394
|
from: number;
|
|
371
395
|
to: number;
|
|
396
|
+
source?: string | undefined;
|
|
372
397
|
}, {
|
|
373
398
|
key: number;
|
|
374
399
|
from: number;
|
|
375
400
|
to: number;
|
|
401
|
+
source?: string | undefined;
|
|
376
402
|
}>, {
|
|
377
403
|
key: number;
|
|
378
404
|
from: number;
|
|
379
405
|
to: number;
|
|
406
|
+
source?: string | undefined;
|
|
380
407
|
}, {
|
|
381
408
|
key: number;
|
|
382
409
|
from: number;
|
|
383
410
|
to: number;
|
|
411
|
+
source?: string | undefined;
|
|
384
412
|
}>;
|
|
385
413
|
}, "strip", z.ZodTypeAny, {
|
|
386
414
|
cite: {
|
|
387
415
|
key: number;
|
|
388
416
|
from: number;
|
|
389
417
|
to: number;
|
|
418
|
+
source?: string | undefined;
|
|
390
419
|
};
|
|
391
420
|
}, {
|
|
392
421
|
cite: {
|
|
393
422
|
key: number;
|
|
394
423
|
from: number;
|
|
395
424
|
to: number;
|
|
425
|
+
source?: string | undefined;
|
|
396
426
|
};
|
|
397
427
|
}>]>, "many">>;
|
|
398
428
|
card: z.ZodOptional<z.ZodString>;
|
|
@@ -407,6 +437,7 @@ export declare const limitSchema: z.ZodObject<{
|
|
|
407
437
|
key: number;
|
|
408
438
|
from: number;
|
|
409
439
|
to: number;
|
|
440
|
+
source?: string | undefined;
|
|
410
441
|
};
|
|
411
442
|
})[];
|
|
412
443
|
card?: string | undefined;
|
|
@@ -421,6 +452,7 @@ export declare const limitSchema: z.ZodObject<{
|
|
|
421
452
|
key: number;
|
|
422
453
|
from: number;
|
|
423
454
|
to: number;
|
|
455
|
+
source?: string | undefined;
|
|
424
456
|
};
|
|
425
457
|
})[] | undefined;
|
|
426
458
|
card?: string | undefined;
|
|
@@ -494,6 +526,7 @@ export declare const contextCardSchema: z.ZodObject<{
|
|
|
494
526
|
section: z.ZodString;
|
|
495
527
|
/** 카드가 이야기하는 원문 자리 */
|
|
496
528
|
anchor: z.ZodEffects<z.ZodObject<{
|
|
529
|
+
source: z.ZodOptional<z.ZodString>;
|
|
497
530
|
key: z.ZodNumber;
|
|
498
531
|
from: z.ZodNumber;
|
|
499
532
|
to: z.ZodNumber;
|
|
@@ -501,18 +534,22 @@ export declare const contextCardSchema: z.ZodObject<{
|
|
|
501
534
|
key: number;
|
|
502
535
|
from: number;
|
|
503
536
|
to: number;
|
|
537
|
+
source?: string | undefined;
|
|
504
538
|
}, {
|
|
505
539
|
key: number;
|
|
506
540
|
from: number;
|
|
507
541
|
to: number;
|
|
542
|
+
source?: string | undefined;
|
|
508
543
|
}>, {
|
|
509
544
|
key: number;
|
|
510
545
|
from: number;
|
|
511
546
|
to: number;
|
|
547
|
+
source?: string | undefined;
|
|
512
548
|
}, {
|
|
513
549
|
key: number;
|
|
514
550
|
from: number;
|
|
515
551
|
to: number;
|
|
552
|
+
source?: string | undefined;
|
|
516
553
|
}>;
|
|
517
554
|
title: z.ZodString;
|
|
518
555
|
lineage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -576,6 +613,7 @@ export declare const contextCardSchema: z.ZodObject<{
|
|
|
576
613
|
key: number;
|
|
577
614
|
from: number;
|
|
578
615
|
to: number;
|
|
616
|
+
source?: string | undefined;
|
|
579
617
|
};
|
|
580
618
|
title: string;
|
|
581
619
|
sources: {
|
|
@@ -606,6 +644,7 @@ export declare const contextCardSchema: z.ZodObject<{
|
|
|
606
644
|
key: number;
|
|
607
645
|
from: number;
|
|
608
646
|
to: number;
|
|
647
|
+
source?: string | undefined;
|
|
609
648
|
};
|
|
610
649
|
title: string;
|
|
611
650
|
sources: {
|
|
@@ -641,6 +680,7 @@ export declare const knowledgeLinkSchema: z.ZodObject<{
|
|
|
641
680
|
id: z.ZodString;
|
|
642
681
|
section: z.ZodString;
|
|
643
682
|
anchor: z.ZodEffects<z.ZodObject<{
|
|
683
|
+
source: z.ZodOptional<z.ZodString>;
|
|
644
684
|
key: z.ZodNumber;
|
|
645
685
|
from: z.ZodNumber;
|
|
646
686
|
to: z.ZodNumber;
|
|
@@ -648,18 +688,22 @@ export declare const knowledgeLinkSchema: z.ZodObject<{
|
|
|
648
688
|
key: number;
|
|
649
689
|
from: number;
|
|
650
690
|
to: number;
|
|
691
|
+
source?: string | undefined;
|
|
651
692
|
}, {
|
|
652
693
|
key: number;
|
|
653
694
|
from: number;
|
|
654
695
|
to: number;
|
|
696
|
+
source?: string | undefined;
|
|
655
697
|
}>, {
|
|
656
698
|
key: number;
|
|
657
699
|
from: number;
|
|
658
700
|
to: number;
|
|
701
|
+
source?: string | undefined;
|
|
659
702
|
}, {
|
|
660
703
|
key: number;
|
|
661
704
|
from: number;
|
|
662
705
|
to: number;
|
|
706
|
+
source?: string | undefined;
|
|
663
707
|
}>;
|
|
664
708
|
title: z.ZodString;
|
|
665
709
|
note: z.ZodString;
|
|
@@ -675,6 +719,7 @@ export declare const knowledgeLinkSchema: z.ZodObject<{
|
|
|
675
719
|
key: number;
|
|
676
720
|
from: number;
|
|
677
721
|
to: number;
|
|
722
|
+
source?: string | undefined;
|
|
678
723
|
};
|
|
679
724
|
note: string;
|
|
680
725
|
title: string;
|
|
@@ -689,6 +734,7 @@ export declare const knowledgeLinkSchema: z.ZodObject<{
|
|
|
689
734
|
key: number;
|
|
690
735
|
from: number;
|
|
691
736
|
to: number;
|
|
737
|
+
source?: string | undefined;
|
|
692
738
|
};
|
|
693
739
|
note: string;
|
|
694
740
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lens-schema.d.ts","sourceRoot":"","sources":["../../../src/digest/lens-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AAEH,4CAA4C;AAC5C,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAC;AAEH,2CAA2C;AAC3C,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"lens-schema.d.ts","sourceRoot":"","sources":["../../../src/digest/lens-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;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AAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -7,16 +7,19 @@ export declare const sourcePageSchema: z.ZodObject<{
|
|
|
7
7
|
width: z.ZodNumber;
|
|
8
8
|
height: z.ZodNumber;
|
|
9
9
|
image: z.ZodString;
|
|
10
|
+
textMethod: z.ZodOptional<z.ZodEnum<["ocr", "unread"]>>;
|
|
10
11
|
}, "strip", z.ZodTypeAny, {
|
|
11
12
|
width: number;
|
|
12
13
|
height: number;
|
|
13
14
|
n: number;
|
|
14
15
|
image: string;
|
|
16
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
15
17
|
}, {
|
|
16
18
|
width: number;
|
|
17
19
|
height: number;
|
|
18
20
|
n: number;
|
|
19
21
|
image: string;
|
|
22
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
20
23
|
}>;
|
|
21
24
|
/**
|
|
22
25
|
* 원문 표. rows는 머리줄을 포함한 칸 글자 그대로다.
|
|
@@ -92,16 +95,19 @@ export declare const lensSourceSchema: z.ZodObject<{
|
|
|
92
95
|
width: z.ZodNumber;
|
|
93
96
|
height: z.ZodNumber;
|
|
94
97
|
image: z.ZodString;
|
|
98
|
+
textMethod: z.ZodOptional<z.ZodEnum<["ocr", "unread"]>>;
|
|
95
99
|
}, "strip", z.ZodTypeAny, {
|
|
96
100
|
width: number;
|
|
97
101
|
height: number;
|
|
98
102
|
n: number;
|
|
99
103
|
image: string;
|
|
104
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
100
105
|
}, {
|
|
101
106
|
width: number;
|
|
102
107
|
height: number;
|
|
103
108
|
n: number;
|
|
104
109
|
image: string;
|
|
110
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
105
111
|
}>, "many">>;
|
|
106
112
|
tables: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
107
113
|
id: z.ZodString;
|
|
@@ -194,6 +200,7 @@ export declare const lensSourceSchema: z.ZodObject<{
|
|
|
194
200
|
height: number;
|
|
195
201
|
n: number;
|
|
196
202
|
image: string;
|
|
203
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
197
204
|
}[];
|
|
198
205
|
}, {
|
|
199
206
|
kind: "web" | "pdf" | "podcast";
|
|
@@ -225,12 +232,15 @@ export declare const lensSourceSchema: z.ZodObject<{
|
|
|
225
232
|
height: number;
|
|
226
233
|
n: number;
|
|
227
234
|
image: string;
|
|
235
|
+
textMethod?: "ocr" | "unread" | undefined;
|
|
228
236
|
}[] | undefined;
|
|
229
237
|
}>;
|
|
230
238
|
export type SourcePage = z.infer<typeof sourcePageSchema>;
|
|
231
239
|
export type SourceTable = z.infer<typeof sourceTableSchema>;
|
|
232
240
|
export type SourceFigure = z.infer<typeof sourceFigureSchema>;
|
|
233
241
|
export type LensSource = z.infer<typeof lensSourceSchema>;
|
|
242
|
+
/** PDF의 OCR 및 미추출 쪽을 수집 출력과 원문 창에 표시한다 */
|
|
243
|
+
export declare function pdfTextNotices(pages: readonly SourcePage[]): string[];
|
|
234
244
|
export declare function lensSourcePath(store: DigestStore, slug: string): string;
|
|
235
245
|
export type LensSourceRead = {
|
|
236
246
|
kind: 'missing';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lens-source.d.ts","sourceRoot":"","sources":["../../../src/digest/lens-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAC9C,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAMlD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"lens-source.d.ts","sourceRoot":"","sources":["../../../src/digest/lens-source.ts"],"names":[],"mappings":"AACA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EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAEvC,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAarF;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,CAGtE;AAED,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAGlF;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAItD;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/C,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -13,6 +13,7 @@ export const sourcePageSchema = z.object({
|
|
|
13
13
|
width: z.number().positive(),
|
|
14
14
|
height: z.number().positive(),
|
|
15
15
|
image: assetPath,
|
|
16
|
+
textMethod: z.enum(['ocr', 'unread']).optional(),
|
|
16
17
|
});
|
|
17
18
|
/**
|
|
18
19
|
* 원문 표. rows는 머리줄을 포함한 칸 글자 그대로다.
|
|
@@ -49,6 +50,15 @@ export const lensSourceSchema = z.object({
|
|
|
49
50
|
tables: z.array(sourceTableSchema).default([]),
|
|
50
51
|
figures: z.array(sourceFigureSchema).default([]),
|
|
51
52
|
});
|
|
53
|
+
/** PDF의 OCR 및 미추출 쪽을 수집 출력과 원문 창에 표시한다 */
|
|
54
|
+
export function pdfTextNotices(pages) {
|
|
55
|
+
const ocr = pages.filter((p) => p.textMethod === 'ocr').map((p) => p.n);
|
|
56
|
+
const unread = pages.filter((p) => p.textMethod === 'unread').map((p) => p.n);
|
|
57
|
+
return [
|
|
58
|
+
...(ocr.length ? [`OCR로 읽은 PDF 쪽: ${ocr.join(', ')}`] : []),
|
|
59
|
+
...(unread.length ? [`글자를 읽지 못한 PDF 쪽: ${unread.join(', ')}`] : []),
|
|
60
|
+
];
|
|
61
|
+
}
|
|
52
62
|
export function lensSourcePath(store, slug) {
|
|
53
63
|
return join(store.dir(slug), LENS_SOURCE_FILE);
|
|
54
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lens-source.js","sourceRoot":"","sources":["../../../src/digest/lens-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAoB,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAElD,gEAAgE;AAChE,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACtF,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,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