MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / parseOpenAI

Function parseOpenAI

packages/cli/src/whisper/normalize.ts:170–184  ·  view source on GitHub ↗
(data: Record<string, unknown>)

Source from the content-addressed store, hash-verified

168}
169
170function parseOpenAI(data: Record<string, unknown>): Word[] {
171 const words = (data.words ?? []) as Array<{
172 word?: string;
173 text?: string;
174 start?: number;
175 end?: number;
176 }>;
177 return words
178 .map((w) => ({
179 text: (w.word ?? w.text ?? "").trim(),
180 start: round3(w.start ?? 0),
181 end: round3(w.end ?? 0),
182 }))
183 .filter((w) => w.text.length > 0);
184}
185
186function parseSrt(content: string): Word[] {
187 // SRT doesn't have word-level timestamps — parse as phrase-level entries.

Callers 1

loadTranscriptFunction · 0.85

Calls 1

round3Function · 0.70

Tested by

no test coverage detected