Skip to content

OpenPecha/pyewts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


OpenPecha

Python Tibetan Unicode to Wylie (EWTS) Converter

DescriptionInstallationExamplesChangesLicenseMaintenanceOwner


Description

The goal of this code is to provide a library to convert back and forth between Tibetan Unicode and EWTS. The code is adapted from Java ewts-converter.

It also provides a conversion from the ACIP Transliteration to EWTS.

Installation

pip install pyewts

Examples

Convert Wylie to Unicode

import pyewts

converter = pyewts.pyewts()
print(converter.toUnicode("ba b+ba [a] ba\\u0f0b"))
# བ་བྦ་a་བ་

Convert Unicode to Wylie

print(converter.toWylie("༼༽"))
# ()

Catch Wylie warnings

>>> orig = """dangs
... zhwa
... dwang
... rma
... tshe
... phywa
... dge
... rgya
... dwags
... (rtse mgron)"""
>>> 
>>> print(orig)
dangs
zhwa
dwang
rma
tshe
phywa
dge
rgya
dwags
(rtse mgron)
>>> warns = []
>>> res = converter.toUnicode(orig, warns)
>>> print(res)
དངས
ཞྭ
དྭང
རྨ
ཚེ
ཕྱྭ
དགེ
རྒྱ
དྭགསརྩེམགྲོན>>> print(warns)
['line 1: "dangs": Syllable should probably be "dngas".']

See demo.py

Changes

See CHANGELOG.md.

License

The Python code is Copyright (C) 2018 Esukhia, provided under MIT License. See CONTRIBUTORS.md for a list of authors and contributors.

Maintenance

Build the source dist:

rm -rf dist/
python3 setup.py clean sdist

and upload on twine (version >= 1.11.0) with:

twine upload dist/*

Owner

About

Tibetan Unicode to Wylie converter. (EWTS-Extended Wylie Transliteration Scheme)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages