Skip to main content

No project description provided

Project description

Burmese-Tools

burmese-tools is a Python library that mainly designed for transformation between unicode and zawgyi burmese lanuage script. Moreover, it also support syllable tokenization for burmese unicode and parital syllable tokenization for burmese zawgyi.

Features

  • Zawgyi to Unicode Conversion: Convert Zawgyi-encoded text to Unicode.
  • Unicode to Zawgyi Conversion: Transform Unicode text back to Zawgyi.
  • Unicode Syllable Tokenization: Tokenize Burmese Unicode text into syllables with customizable splitting.
  • Partial Zawgyi Syllable Tokenization: Tokenize Burmese Zawgyi text into syllables.

Installation

You can install this library from PyPI:

pip install burmese-tools

Usage

Importing the Library

from burmese_tools import tools

Convert Zawgyi to Unicode

text_zawgyi = "ကႏၲာရ"
converted_text = tools.zaw2uni(text_zawgyi)
print(converted_text)  # Output: ကန္တာရ

Convert Unicode to Zawgyi

text_unicode = "ကန္တာရ"
converted_text = tools.uni2zaw(text_unicode)
print(converted_text)  # Output: ကႏၲာ႐

Tokenize Unicode Text into Syllables

The uni_syllable function is a utility to tokenize Unicode text into syllable tokens, allowing for flexible splitting methods.

Features

  • Tokenizes Unicode text into syllables.
  • Provides two types of splitting:
    • Type 1: Splits ဂန္ဓာရ into ['ဂ', 'န္ဓာ', 'ရ']. (default)
    • Type 2: Splits ဂန္ဓာရ into ['ဂန္', 'ဓာ', 'ရ'].
  • Supports an optional transform to replace ္ with ် (applies only when type=2) d
    • default = True
text = "ကန္တာရ"
tokens = tools.uni_syllable(text, type=1)
print(tokens)  # Output: ['က', 'န္တာ', 'ရ']
text = "ကန္တာရ"
tokens = tools.uni_syllable(text, type=2)
print(tokens)  # Output: ['ကန်', 'တာ', 'ရ']
text = "ကန္တာရ"
tokens = tools.uni_syllable(text, type=2, transform=False)
print(tokens)  # Output: ['ကန္', 'တာ', 'ရ']

Tokenize Zawgyi Text into Partial Syllables

text = "ကႏၲာရ"
tokens = tools.zaw_partial_syllable(text)
print(tokens)  # Output: ['က', 'ႏၲာ', 'ရ']  in unicode ['က', 'န္တာ', 'ရ'] 

Contributing

Contributions are welcome! Please follow these steps:

Fork the repository. Create a new branch for your feature/bug fix. Make your changes and test thoroughly. Submit a pull request.

License

This library is licensed under the MIT License. Feel free to use, modify, and distribute it.

#Acknowledgments This library was developed to simplify Burmese text processing for developers and linguists. Special thanks to Sa Phyo Thu Thet, from Simbolo for his invaluable guidance, kindness, and support in teaching me. His mentorship has been instrumental in shaping my understanding and skills. Contributions and feedback from the community are also highly appreciated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

burmese_tools-0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

burmese_tools-0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file burmese_tools-0.1.tar.gz.

File metadata

  • Download URL: burmese_tools-0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for burmese_tools-0.1.tar.gz
Algorithm Hash digest
SHA256 988a131e51ce6552705aa63eb147f9b57db60f74bff12b245957c13846770369
MD5 30a7f85dd75d461999ffb533134fcfb4
BLAKE2b-256 4d5ff1a8b0419c02fff619c40384ef9bdbb41b3b63426c75ba8381a9dd3e2d4a

See more details on using hashes here.

File details

Details for the file burmese_tools-0.1-py3-none-any.whl.

File metadata

  • Download URL: burmese_tools-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for burmese_tools-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3fae69db14d4443cda98319d64ab8b3071169716700bde82508a2a14bc72818
MD5 d03ee5a361028b0792ea2e67dc3f9e0e
BLAKE2b-256 b9a140232833a9e7507e61a1c4741b2d1c3e01d4fe45a3702b5eeb3f6a3a9e84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page