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.0.0.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sentence_stream-1.0.0.tar.gz.
File metadata
- Download URL: sentence_stream-1.0.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b67fddbe40f797658c8d7d1cfc727418008e90bc4df5737e21411f54324dfb
|
|
| MD5 |
343f213ba2e18092077e51f872296498
|
|
| BLAKE2b-256 |
c8287658d9917b9bb1945e7f3d46b68fb98cf53385d36491ae77c86de70d115e
|
File details
Details for the file sentence_stream-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sentence_stream-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
683d89224731b80eeb44f9f19cb79974cd963acbc2825f323bbb6fd80361ec9c
|
|
| MD5 |
a86b94a425b391b504bcdaf6565469bc
|
|
| BLAKE2b-256 |
430e45da2b9082e34fd57346161cc29ff67fb7ac1132268301ea36ed52e0538c
|