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.3.0.tar.gz (10.0 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.3.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sentence_stream-1.3.0.tar.gz
  • Upload date:
  • Size: 10.0 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.3.0.tar.gz
Algorithm Hash digest
SHA256 b06261d35729de97df9002a1cc708f9a888f662b80d5d6d008ee69c51f36041b
MD5 a04d669811c59ba6241dd41b3741956c
BLAKE2b-256 a869f3d048692aac843f41102507f6257138392ec841c16718f0618d27051caf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentence_stream-1.3.0.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sentence_stream-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7448d131315b85eefdf238e5edd9caa62899acf609145d5e0e10c09812eb8a1d
MD5 81e235eccac6ab5a5eec78a58084c307
BLAKE2b-256 48b648339c109bab6f54ff608800773b9425464c6cbf7fd3f2ba01294d78be3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentence_stream-1.3.0-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