bindings: cueseg, so a transcript can be chaptered in process

This commit is contained in:
funkpower committed 2026-09-20 09:00:26 -04:00
1 parent f9f809f701
commit dd09499e68
11 files changed
+112 -3

No files matched your search

+1
View File
@@ -45,6 +45,7 @@ try {
| `countTokens` | Tokens, by the encoding the budgets count in |
| `parseSubtitles` | SubRip, WebVTT or ASS into cues |
| `packCues` | Cues into passages, keeping the times they were said at |
| `segmentCues` | A timed transcript into topic chapters |
| `splitCollection` | One markdown file into the works inside it |
| `fuseHits` | Several ranked lists into one |
| `identify` | What a file is, from its first bytes |
+7 -3
View File
@@ -3,8 +3,8 @@
// check, and nothing else would notice.
import {
chunkMarkdown, scrub, countTokens, parseSubtitles, packCues,
splitCollection, fuseHits, identify, seriesOf, parseIdentifier,
type Chunk, type Cue, type Section, type Hit, type Doc, type SeriesProposal, type Identifier,
splitCollection, fuseHits, identify, seriesOf, parseIdentifier, segmentCues,
type Chunk, type Cue, type Section, type Hit, type Doc, type SeriesProposal, type Identifier, type Segment,
} from "./dist/web/catena.js";
const chunks: Chunk[] = chunkMarkdown("# One\n\nbody\n", 512, 64, 50, 768);
@@ -19,6 +19,10 @@ const cues: Cue[] = parseSubtitles("1\n00:00:01,000 --> 00:00:04,000\nline\n\n")
const start: number = cues[0].start;
const packed: Chunk[] = packCues(cues, 75, 512);
const chapters: Segment[] = segmentCues(cues, 3600);
const chapterTitle: string = chapters[0].title;
segmentCues(cues);
const works: Section[] = splitCollection("# One\n\nbody\n");
const slug: string = works[0].slug;
@@ -42,4 +46,4 @@ seriesOf("Aquinas (Companion)", "Cambridge");
const ident: Identifier | undefined = parseIdentifier("10.1000/182");
const checksum: boolean | null | undefined = ident?.checksum;
export const checked = [volume, checksum, page, chapter, flags, clean, tokens, start, packed, slug, fused, kind, notes];
export const checked = [volume, checksum, chapterTitle, page, chapter, flags, clean, tokens, start, packed, slug, fused, kind, notes];