Instantly share code, notes, and snippets.

Embed
What would you like to do?
Myanmar language libraries / Asia Foundation

These JavaScript libraries have been super-helpful for our work in Myanmar. We are open-sourcing all of our work, and linking to local developers' open source work, too:

Zawgyi

We use knayi-myscript from GLO (Thuya Myo Nyunt)

You can get a command-line version here: knayi-cli.

For languages other than JavaScript, see more local developers' work on Rabbit Converter.

WinResearcher

Sometimes documents come in an ASCII font called WinResearcher. You can convert that to Unicode, too: https://www.npmjs.com/package/my-winresearcher

Numbers

Convert between local numbers (Shan and Burmese) and Latin numerals: https://www.npmjs.com/package/myanmar-numbers

This can work on number, string, and date types.

Autocomplete / Typeahead

Don't separate Myanmar letters when searching for them in typeahead.js : https://github.com/mapmeld/typeahead.myanmar.js

Sorting

On the client-side, you can sort A to Z (က to ဧ?) with JavaScript's Intl.Collator feature.

For server-side JavaScript, you have a few options:

Names

A simple addition to your client-side and server-side sort, but for sorting names. This library understands prefixes, so your ဦ's and ဒေါ်'s won't all be sorted together. https://www.npmjs.com/package/myanmar-names

You can also do fuzzy name-matching (confusing ဂ and ဝ, forgetting a ီ) based on our most common errors from data-entry people typing names.

Install

These libraries can all be used in client-side JavaScript!

For NodeJS, run this:

npm install knayi-myscript my-winresearcher myanmar-sort myanmar-names myanmar-numbers
npm install knayi-cli -g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment