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.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.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: burmese_tools-0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f7ee68fc455e570b0a4ae14838648adaf29e6975feed2e5fabc49fcfcacc9055
MD5 37db1177abcf7f8602b6a19a5bf34ef2
BLAKE2b-256 f54380160227d06369f6281c429b133c5101837bccc6c08805556ae73cfcbfa5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: burmese_tools-0.1.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ec16e472d0b3a0acf39422553ed1a5f32928035b696299ecc2ee3abcd797f27
MD5 591f93bc756b4e0d4afcba59aa07d596
BLAKE2b-256 52770522cc243e4725accc5efefb57fc316a2bb20244d7cd9a0f4375aa22e3b8

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