Function lastSentence

  • The last sentence of a text, or undefined.

    Parameters

    • text: string

      The text to read.

    • sentences: ((text) => readonly {
          start: number;
          end: number;
      }[])

      The caller's sentence spans, as in TranscribePiecesOptions.

        • (text): readonly {
              start: number;
              end: number;
          }[]
        • Parameters

          • text: string

          Returns readonly {
              start: number;
              end: number;
          }[]

    Returns string | undefined

    The text of the last span, trimmed; the whole text, trimmed, when sentences answers no span; undefined when that is empty.