Skip to main content

yasbd-union

Python Version PyPI Tests Stability License: MIT

Sentence splitting for when you genuinely have no idea what language you're looking at.


What this is

yasbd-union is an experimental add-on for yasbd-lib.

It takes sentence-splitting rules from every built-in language in yasbd-lib and throws them into one shared space.

Sometimes it behaves nicely. Sometimes it makes bold assumptions. Sometimes it surprises even you.

That's basically the whole deal.


auto vs xx

auto tries to be smart about it.

It looks at your text, decides what language it is, and uses the right rules for the job. Clean and structured.

xx doesn't bother with that step.

It assumes your text is already a mix of everything and just applies all available rules at once.

auto xx
Language handling Detects first Doesn't care
Accuracy Stable Depends on bundled language rules
Mixed text Not ideal Basically its natural habitat
False splits Rare Happens sometimes
Personality Careful A bit chaotic, but trying its best
Best for Clean text Mixed-language messes

Install

pip install yasbd-union

Then register it:

from yasbd import BoundaryDetector

detector = BoundaryDetector(lang="xx", external_lang_packs = ["yasbd_union"])

Example

sentences = list(detector.segment(
    "Dr. Wang said 你好世界。Prof. Li replied 是的。"
))

print(sentences)

Output:

["Dr. Wang said 你好世界。", "Prof. Li replied 是的。"]

When to use xx

Use it when:

  • You don't know what language your text is in
  • Your input is messy, mixed, or unpredictable
  • You're dealing with logs, chats, or scraped text
  • You just want something that "tries its best"

When not to use xx

Avoid it when:

  • You need strict, repeatable results
  • Your text is single-language
  • You don't want surprises in sentence boundaries
  • You're trying to explain results to someone very literal

In those cases, auto or a specific language pack will behave better.


A few honest notes

  • Some sentence splits will be slightly unexpected
  • Results depend on what language rules are bundled in yasbd-lib
  • It is not fully predictable by design

If that sounds like a problem, xx is probably not what you want.


License

MIT: If it breaks, it's still yours.

Download files

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

Source Distribution

yasbd_union-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

yasbd_union-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file yasbd_union-0.2.0.tar.gz.

File metadata

  • Download URL: yasbd_union-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yasbd_union-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dea5fb821edb965cf40df5002188774c11c9edac6cc4c5e797708678f39a3511
MD5 8ef393a4508c2580d1b1a417cddc916b
BLAKE2b-256 ac100e5db3a3e01a7492cea34fe011e39f59a6efb42c38273f9fc4780d4c73b2

See more details on using hashes here.

File details

Details for the file yasbd_union-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yasbd_union-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for yasbd_union-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3396e1fa6a722fd337b18c7a79679f2825d7a712b954f9644e573d597920608
MD5 5cb2b31baeef02a494558e3243cfe3b9
BLAKE2b-256 b03cca28ffc4b3fe44155d42ed44e39c78596a9658df7af54e54621f668a9c4b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page