UnicodeTokenizer
UnicodeTokenizer: tokenize all Unicode text
切词规则 Tokenize Rules
- break line
- Punctuation
- UnicodeScripts
- Split(" ?[^(\s|[.,!?…。,、।۔،])]+"
- break word
use
pip install UnicodeTokenizer
from UnicodeTokenizer import UnicodeTokenizer
tokenizer=UnicodeTokenizer()
line = """
首先8.88设置 st。art_new_word=True 和 output=[açaí],output 就是最终 no such name"
的输出คุณจะจัดพิธีแต่งงานเมื่อไรคะ탑승 수속해야pneumonoultramicroscopicsilicovolcanoconiosis"
하는데 카운터가 어디에 있어요ꆃꎭꆈꌠꊨꏦꏲꅉꆅꉚꅉꋍꂷꂶꌠلأحياء تمارين تتطلب من [MASK] [PAD] [CLS][SEP]
est 𗴂𗹭𘜶𗴲𗂧, ou "phiow-bjij-lhjij-lhjij", ce que l'on peut traduire par « pays-grand-blanc-élevé » (白高大夏國).
""".strip()
print(tokenizer.tokenize(line))
print(tokenizer.split_lines(line))
or
git clone https://github.com/laohur/UnicodeTokenizer
cd UnicodeTokenizer # modify
pip install -e .
reference
- PyICU https://gitlab.pyicu.org/main/pyicu
- tokenizers https://github.com/huggingface/tokenizers
- ICU-tokenizer https://github.com/mingruimingrui/ICU-tokenizer/tree/master
License
Metadata
Release files for UnicodeTokenizer 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| UnicodeTokenizer-0.2.2.tar.gz | 2.8 kB | Without provenance | Details for UnicodeTokenizer-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| UnicodeTokenizer-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for UnicodeTokenizer-0.2.2-py3-none-any.whl |
Total release size: 6.3 kB
Release files / UnicodeTokenizer-0.2.2.tar.gz
| Download URL | UnicodeTokenizer-0.2.2.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
579e817b08b2b01c3d4c4139689d1a9844714de41403ecb936a7a638f7cfb042
|
|
BLAKE2b-256 checksum How to use checksums |
56c07ec0c8cda52fb720b3579c9e881bf4ce27eb602052bb95cc7c0602f3372b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / UnicodeTokenizer-0.2.2-py3-none-any.whl
| Download URL | UnicodeTokenizer-0.2.2-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7116273a9c35d812146c10f9c521c71c47b6b8f3095a558ba7fa1d349e0595b
|
|
BLAKE2b-256 checksum How to use checksums |
e5234c8a7ed50a7bb75c655f1c62765a0d1c0146937a0fb33f359cf70cc25d40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for UnicodeTokenizer 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.