Viet Text Tools
Functions for working with Vietnamese text
Installation
To get the latest stable release from PyPi
pip install viet_text_tools
Usage
normalize_diacritics()
You can normalize diacritics for a Vietnamese word. The return value is in composed (NFC) form
normalize_diacritics('nghìên') == 'nghiền'
Pass new_style=True to use new style tone placement
normalize_diacritics('thủy', new_style=True) == 'thuỷ'
Pass decomposed=True to return a string in decomposed (NFD) form
len(normalize_diacritics('thủy')) == 4
len(normalize_diacritics('thủy', decomposed=True)) == 5
vietnamese_sort_key()
A key function for use with sorted() to sort Vietnamese text with the correct collation order
words = ['anh', 'ba', 'áo', 'cắt', 'cá', 'cả']
sorted(words) == ['anh', 'ba', 'cá', 'cả', 'cắt', 'áo']
sorted(words, key=vietnamese_sort_key) == ['anh', 'áo', 'ba', 'cả', 'cá', 'cắt']
vietnamese_case_insensitive_sort_key()
Same as vietnamese_sort_key() but case-insensitive.
Metadata
Release files for viet-text-tools 0.1.6
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 |
|---|---|---|---|---|
| viet_text_tools-0.1.6.tar.gz | 4.3 kB | Without provenance | Details for viet_text_tools-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viet_text_tools-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for viet_text_tools-0.1.6-py3-none-any.whl |
Total release size: 9.1 kB
Release files / viet_text_tools-0.1.6.tar.gz
| Download URL | viet_text_tools-0.1.6.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ea821e9a96b2f121f017ba95569dd380fd57c9f65a9695f531137b36d392730
|
|
BLAKE2b-256 checksum How to use checksums |
53025045c89a9a12de8f3047fae7a50abecaa319ce2eb2fba425f000cce457ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.8.2 Darwin/19.6.0
|
Release files / viet_text_tools-0.1.6-py3-none-any.whl
| Download URL | viet_text_tools-0.1.6-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6fcc7d180b59cbb8a8c245ad31fdc5af41763726dd1e82cc5105d13533d5072
|
|
BLAKE2b-256 checksum How to use checksums |
fd19fc232ac11a80a322159ac289d0d195064358a85a287ab986a7b5e791e2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.8.2 Darwin/19.6.0
|
Security for viet-text-tools 0.1.6
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.