Thai localization package
Project description
num-thai-cnv
num-thai-cnv is python library, primarily focused on converting number into Thai text and vice versa.
Installation
pip install GoneJaguar300
Features
Convert number to Thai text and vice versa, convert Arabic to Thai number.
Initialize the object
from GoneJaguar300 import ThaiNumberConverter
thainum = ThaiNumberConverter()
Number Localization Methods
Method name | Description | Command | Result |
---|---|---|---|
ToText | Convert Arabic number to Thai text | thainum.ToText(123) or thainum.ToText('123') | 'หนึ่งร้อยยี่สิบสาม' |
ToNum | Convert Thai text to Arabic number | thainum.ToNum('หนึ่งร้อยยี่สิบสาม') | '123' |
ToThaiNumber | Convert Arabic number to Thai number | thainum(123) or thainum('123') | '๑๒๓' |
Number Localization Notes
-
ToText and ToThaiNumber method can support unlimited digit.
-
ToNum method will whitelist the following words, violation will lead to error 'Check if text contains excluded word'.
Words Words Words เอ็ด หก ร้อย หนึ่ง เจ็ด พัน สอง แปด หมื่น สาม เก้า แสน สี่ สิบ ล้าน ห้า ยี่
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
num_thai_cnv-1.0.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for num_thai_cnv-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707a2708542a71b309690f3caf243a6e9669c279d8e3680a59322bfe60e32ee7 |
|
MD5 | 4b507b022c0f79a71d04a5c63bb51b16 |
|
BLAKE2b-256 | 8767cc21220da8550f06c068517464e7784caee1c268274870b5a32dca4e7d14 |