INNER CODE UNIT · TypeScript
speakerName
iurysza/module-graph · .agents/skills/audio-transcribe/scripts/transcribe.ts:186
function speakerName(speaker: string | undefined): string {
if (!speaker) return "Speaker";
const match = /^spk[_:](\d+)$/i.exec(speaker);
return match ? `Speaker ${match[1]}` : speaker;
}
function joinWords(words: string[]): string {
return words
.join(" ")
.replace(/\s+([,.;:!?])/g, "$1")
.replace(/([([{])\s+/g, "$1")
.replace(/\s+([)\]}])/g, "$1");
}
export function extractWordAnnotations(response: TranscriptionResponse): WordAnnotation[] {
const words: WordAnnotation[] = [];
for (const step of response.steps ?? []) {
for (const content of step.content ?? []) {