Skip to main content
Version: 0.10.0

Function: formatChunk()

formatChunk(chunk, lang?): string

Defined in: extensions/speech/utils/supertonicUtils.ts:127

Formats a single text chunk by ensuring ending punctuation and wrapping with language tags. Should be run on individual partitioned text chunks.

Parameters​

chunk​

string

The partitioned text chunk.

lang?​

string

The language code.

Returns​

string

The formatted chunk ready for model input.

Throws​

With code INVALID_ARGUMENT if lang is unsupported.