close() {
    if (this._closed) {
      throw new Error("Stream is already closed.");
    }
    this._closed = true;
    this.flush();
  }
Closes the stream, signaling that no more text will be pushed.
This will flush any remaining text in the buffer as a sentence
and allow the consuming process to finish processing the stream.