Member Junction
    Preparing search index...

    Function DeriveWordTimings

    • 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.

      Parameters

      • alignment: SpeechAlignment

        Character-level alignment from SpeechResult.Alignment

      Returns WordTiming[]

      Ordered word timings with start and end seconds