Skip to main content

Experimental multilingual aggregate for yasbd-lib — best-effort sentence splitting over all installed language profiles.

Project description

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 installed language pack 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 what rules are installed
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.rules import register_lang_packs
from yasbd import BoundaryDetector

register_lang_packs(["yasbd_union"])

detector = BoundaryDetector("xx")

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 can change depending on installed language packs
  • 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.

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

yasbd_union-0.1.2.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.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yasbd_union-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for yasbd_union-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1d6576d6cdefd15a91c4a255b737a7f425e01b9716e5f9f1e73161d04bd76b63
MD5 9d77907ca69eb647b469e9af9ddf1a6f
BLAKE2b-256 5910a8ea5e97b9dcda07acbb07fb9074e5a4ba48bb4f06cde32eee5d69ff9f26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yasbd_union-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for yasbd_union-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 adf39e821eee17819f7b053d3ea2d191d1e629793f371a74cbdff5e8a3654717
MD5 38eafc6b18fe3d350d56d6e4d333efbc
BLAKE2b-256 6fe3a0f524cf26c3d6f0947051415c58dbbb4834eccb1d062a3617a44b50f4e1

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