Aggregates character-level SpeechAlignment into word-level timings.
A "word" is defined as a contiguous run of non-whitespace characters (!/^\s+$/),
so punctuation attached to a token remains part of that word (for example, "Hello,"
or "world!"). Any whitespace entry (' ', '\t', '\n', '\r', etc.) acts as a
word boundary and is not emitted as a token.
Edge cases:
Null, undefined, or empty Characters returns [].
Leading, trailing, or consecutive whitespace characters are skipped cleanly.
Mismatched array lengths (Characters.length !== StartSeconds.length or
Characters.length !== EndSeconds.length) return [] rather than throwing or
emitting partial timings.
Aggregates character-level SpeechAlignment into word-level timings.
A "word" is defined as a contiguous run of non-whitespace characters (
!/^\s+$/), so punctuation attached to a token remains part of that word (for example,"Hello,"or"world!"). Any whitespace entry (' ','\t','\n','\r', etc.) acts as a word boundary and is not emitted as a token.Edge cases:
Charactersreturns[].Characters.length !== StartSeconds.lengthorCharacters.length !== EndSeconds.length) return[]rather than throwing or emitting partial timings.