pythainlp.ancient
Modules
- pythainlp.ancient.aksonhan_to_current(word: str) str[source]
Convert an AksonHan word to the current Thai word.
AksonHan (อักษรหัน) writes two consonants to spell the short /a/ vowel (สระ อะ).
Today, รร is an AksonHan pattern still used in Thai.
- Parameters:
word (str) – Thai word in AksonHan spelling
- Returns:
word in current Thai spelling
- Return type:
- Example:
>>> from pythainlp.ancient import aksonhan_to_current >>> print(aksonhan_to_current("จกก")) จัก >>> print(aksonhan_to_current("บงงคบบ")) บังคับ >>> print(aksonhan_to_current("สรรเพชญ")) # รร is still used. สรรเพชญ
- pythainlp.ancient.convert_currency(value: float, from_unit: str) dict[str, float][source]
Convert a value in an ancient Thai currency unit to other units.
Supported units:
เบี้ย (Bia)
อัฐ (At)
ไพ (Pi)
เฟื้อง (Feuang)
สลึง (Saleung)
บาท (Bath)
ตำลึง (Tamleung)
ชั่ง (Chang)
See more: Thai money.
- Parameters:
- Returns:
value in each unit, keyed by unit name
- Return type:
- Raises:
NotImplementedError – if
from_unitis not supported- Example:
>>> from pythainlp.ancient import convert_currency >>> print(convert_currency(8, "บาท")) {'เบี้ย': 51200.0, 'อัฐ': 512.0, 'ไพ': 256.0, 'เฟื้อง': 64.0, 'สลึง': 32.0, 'บาท': 8.0, 'ตำลึง': 2.0, 'ชั่ง': 0.1}