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.

Metadata

Release files for yasbd-union 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yasbd-union 0.2.0
File Size Uploaded
yasbd_union-0.2.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yasbd-union 0.2.0
File Interpreter ABI Platform
yasbd_union-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / yasbd_union-0.2.0.tar.gz

Download URL yasbd_union-0.2.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dea5fb821edb965cf40df5002188774c11c9edac6cc4c5e797708678f39a3511
BLAKE2b-256 checksum
How to use checksums
ac100e5db3a3e01a7492cea34fe011e39f59a6efb42c38273f9fc4780d4c73b2
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / yasbd_union-0.2.0-py3-none-any.whl

Download URL yasbd_union-0.2.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3396e1fa6a722fd337b18c7a79679f2825d7a712b954f9644e573d597920608
BLAKE2b-256 checksum
How to use checksums
b03cca28ffc4b3fe44155d42ed44e39c78596a9658df7af54e54621f668a9c4b
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release 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