sentence-stream


Namesentence-stream JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryA small sentence splitter for text streams
upload_time2025-07-24 15:37:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9.0
licenseApache-2.0
keywords home assistant sentence boundary
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sentence Stream

A small sentence splitter for text streams.

## Install

``` sh
pip install sentence-stream
```

## Example

``` python
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`.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sentence-stream",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": "home, assistant, sentence boundary",
    "author": null,
    "author_email": "The Home Assistant Authors <hello@home-assistant.io>",
    "download_url": "https://files.pythonhosted.org/packages/20/61/51918209769d7373c9bcaecac6222fb494b1d1f272e818e515e5129ef89c/sentence_stream-1.1.0.tar.gz",
    "platform": "any",
    "description": "# Sentence Stream\n\nA small sentence splitter for text streams.\n\n## Install\n\n``` sh\npip install sentence-stream\n```\n\n## Example\n\n``` python\nfrom sentence_stream import stream_to_sentences\n\ntext_chunks = [\n    \"Text chunks that a\",\n    \"re not on\",\n    \" word or se\",\n    \"ntence boundarie\",\n    \"s. But, they w\",\n    \"ill sti\",\n    \"ll get sp\",\n    \"lit right\",\n    \"!!! Goo\",\n    \"d\",\n]\n\nassert list(stream_to_sentences(text_chunks)) == [\n    \"Text chunks that are not on word or sentence boundaries.\",\n    \"But, they will still get split right!!!\",\n    \"Good\",\n]\n```\n\nFor async streams, use `async_stream_to_sentences`.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A small sentence splitter for text streams",
    "version": "1.1.0",
    "project_urls": {
        "Source Code": "http://github.com/OHF-Voice/sentence-stream"
    },
    "split_keywords": [
        "home",
        " assistant",
        " sentence boundary"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "72c88e39ad90b52372ed3bd1254450ef69f55f7920a838f906e29a414ffcf4b2",
                "md5": "2cb6869315d9144f7a19b2882f144ab6",
                "sha256": "3fceb47673ff16f5e301d7d0935db18413f8f1143ba4aea7ea2d9f808c5f1436"
            },
            "downloads": -1,
            "filename": "sentence_stream-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2cb6869315d9144f7a19b2882f144ab6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 7989,
            "upload_time": "2025-07-24T15:37:36",
            "upload_time_iso_8601": "2025-07-24T15:37:36.606017Z",
            "url": "https://files.pythonhosted.org/packages/72/c8/8e39ad90b52372ed3bd1254450ef69f55f7920a838f906e29a414ffcf4b2/sentence_stream-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "206151918209769d7373c9bcaecac6222fb494b1d1f272e818e515e5129ef89c",
                "md5": "d22556cfba7025138af694a081f349e7",
                "sha256": "a512604a9f43d4132e29ad04664e8b1778f4a20265799ac86e8d62d181009483"
            },
            "downloads": -1,
            "filename": "sentence_stream-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d22556cfba7025138af694a081f349e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 9262,
            "upload_time": "2025-07-24T15:37:37",
            "upload_time_iso_8601": "2025-07-24T15:37:37.831768Z",
            "url": "https://files.pythonhosted.org/packages/20/61/51918209769d7373c9bcaecac6222fb494b1d1f272e818e515e5129ef89c/sentence_stream-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-24 15:37:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OHF-Voice",
    "github_project": "sentence-stream",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sentence-stream"
}
        
Elapsed time: 0.89896s