/** * Take clustering — finds segments that are likely re-takes of the same line. * * v0 uses Jaccard similarity over normalized token sets. This is: * - Free (no API call) * - Deterministic * - Fast: O(N * windowSize) where windowSize caps the comparison range * * Why Jaccard over embeddings? Re-takes typically share most words verbatim * (the speaker says the same thing 2-3 times to nail the delivery). Token * overlap catches this reliably. Embeddings would catch paraphrased re-takes * too, but at the cost of an API call per segment — moved to v1 if needed. */ export interface Segment { start: number; end: number; text: string; } export interface Cluster { id: number; /** Indexes into the original segments array (preserves source order). */ memberIndexes: number[]; members: Segment[]; } export interface ClusterOptions { /** Jaccard threshold above which two segments are considered the same take. Default 0.6. */ threshold?: number; /** Only compare segments within this many positions of each other. Default 100. */ window?: number; /** Skip segments shorter than this many tokens (too short to be meaningful re-takes). Default 4. */ minTokens?: number; } /** * Normalize a segment to a token Set: * - Lowercase * - Strip punctuation * - Drop stopwords + filler ("um", "uh", "like", "yeah", ...) * - Drop tokens shorter than 2 chars */ export declare function tokenize(text: string): Set; export declare function jaccard(a: Set, b: Set): number; /** * Group segments into clusters of likely re-takes. * * Returns clusters with size >= 2 only by default (singletons are not * interesting — they're just "things said once"). Use `includeSingletons` * for completeness. */ export declare function clusterSegments(segments: Segment[], opts?: ClusterOptions & { includeSingletons?: boolean; }): Cluster[]; //# sourceMappingURL=clustering.d.ts.map