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

Function joinTokens

packages/cli/src/whisper/normalize.ts:360–365  ·  view source on GitHub ↗

Join two adjacent tokens, omitting the space across a CJK boundary.

(left: string, right: string)

Source from the content-addressed store, hash-verified

358
359/** Join two adjacent tokens, omitting the space across a CJK boundary. */
360function joinTokens(left: string, right: string): string {
361 const a = left.at(-1) ?? "";
362 const b = right[0] ?? "";
363 const sep = CJK_CHAR.test(a) || CJK_CHAR.test(b) ? "" : " ";
364 return `${left}${sep}${right}`;
365}
366
367export function wordsToCues(words: Word[], opts: WordsToCuesOptions = {}): Cue[] {
368 // Phrase-level transcripts (imported .srt/.vtt cues) must keep their existing

Callers 1

wordsToCuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected