Skip to main content

Segment text with Unicode TR29-compliant segmenters.

Project description

Unicode Segment

Segment text with Unicode TR29-compliant segmenters.

Usage

from unicode_segment import SentenceSegmenter

text = """This, that, the other thing, etc. Another sentence... A, b, c, \
etc., and more. D, e, f, etc. and more. One, i. e. two. Three, i. e., four. \
Five, i.e. six. You have 4.2 messages. Property access: `a.b.c`."""

segmenter = SentenceSegmenter()
sentences = segmenter.split(text)

assert sentences == [
    "This, that, the other thing, etc. ",
    "Another sentence... ",
    "A, b, c, etc., and more. ",
    "D, e, f, etc. and more. ",
    "One, i. e. two. ",
    "Three, i. e., four. ",
    "Five, i.e. six. ",
    "You have 4.2 messages. ",
    "Property access: `a.b.c`.",
]

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

unicode_segment-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

unicode_segment-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file unicode_segment-0.1.0.tar.gz.

File metadata

  • Download URL: unicode_segment-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for unicode_segment-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58acfe545fc934e3d7250d8b076067e539696489df3edf1f10069276409297e4
MD5 2ef8727d71300a96a343ea327b8adb29
BLAKE2b-256 50dea199150a015556f178e751873366f96956031ee7530b60ed0f5990c95e48

See more details on using hashes here.

File details

Details for the file unicode_segment-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unicode_segment-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4215c09b4eecde2a254e69c4be919b908e54dbc3d066a351b5c53befc70a814
MD5 cff242620f443c8ff7ad24a4182cc826
BLAKE2b-256 1b9a62e1cc4925f33805e346d99de3cd56294fe7d60fb51638bf7ecef9874cf1

See more details on using hashes here.

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