pythainlp.transliterate

The pythainlp.transliterate turns Thai text into a romanized one (put simply, spelled with English).

Modules

pythainlp.transliterate.romanize(text: str, engine: str = 'royin')str[source]

Rendering Thai words in the Latin alphabet or “romanization”, using the Royal Thai General System of Transcription (RTGS), which is the official system published by the Royal Institute of Thailand. ถอดเสียงภาษาไทยเป็นอักษรละติน :param str text: Thai text to be romanized :param str engine: ‘royin’ (default) or ‘thai2rom’. ‘royin’ uses the Royal Thai General System of Transcription issued by Royal Institute of Thailand. ‘thai2rom’ is deep learning Thai romanization (require keras). :return: A string of Thai words rendered in the Latin alphabet.

pythainlp.transliterate.transliterate(text: str, engine: str = 'ipa')str[source]

Transliteration of Thai text :param str text: Thai text to be transliterated :param str engine: ‘ipa’ (International Phonetic Alphabet; default) or ‘icu’. :return: A string of Internaitonal Phonetic Alphabets indicating how the text should be pronounced.