Skip to main content

A small sentence splitter for text streams

Project description

Sentence Stream

A small sentence splitter for text streams.

Install

pip install sentence-stream

Example

from sentence_stream import stream_to_sentences

text_chunks = [
    "Text chunks that a",
    "re not on",
    " word or se",
    "ntence boundarie",
    "s. But, they w",
    "ill sti",
    "ll get sp",
    "lit right",
    "!!! Goo",
    "d",
]

assert list(stream_to_sentences(text_chunks)) == [
    "Text chunks that are not on word or sentence boundaries.",
    "But, they will still get split right!!!",
    "Good",
]

For async streams, use async_stream_to_sentences.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentence_stream-1.2.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentence_stream-1.2.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file sentence_stream-1.2.1.tar.gz.

File metadata

  • Download URL: sentence_stream-1.2.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sentence_stream-1.2.1.tar.gz
Algorithm Hash digest
SHA256 427ed158a17294df3a3b5a1dce283faf9ae0cd4fe93efac0528b107002b99a47
MD5 687dc2e23d289e3be2d5033c9a594dae
BLAKE2b-256 48563e5cf7cb3e8418ec2041535d3f81b718dcca31d0d5be0630b5f8bc4c5558

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentence_stream-1.2.1.tar.gz:

Publisher: publish.yml on OHF-Voice/sentence-stream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sentence_stream-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sentence_stream-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a925a52322545dff19991247edd1c7b88dfb9bcd5013e09a50a280a3199bb796
MD5 36650be09dd52ca9b6ca776a5bf0d72d
BLAKE2b-256 434d2570aa15f43c4faf8c5a3e0d6ed5cb265af13c8b66cd408c970bd6aa0177

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentence_stream-1.2.1-py3-none-any.whl:

Publisher: publish.yml on OHF-Voice/sentence-stream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page