Last active
July 3, 2020 22:41
-
-
Save otanim/80f0c31af8a03a4b27a1e2b69ed94400 to your computer and use it in GitHub Desktop.
Zawgyi to Unicode converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//packages | |
const google_myanmar_tools = require('myanmar-tools'); | |
const converter = new google_myanmar_tools.ZawgyiConverter(); | |
const detector = new google_myanmar_tools.ZawgyiDetector(); | |
const zawgyiToUnicode = (possiblyZawgyiText) => { | |
const hasToBeConverted = detector.getZawgyiProbability(possiblyZawgyiText) > 0.9; | |
const converted = hasToBeConverted ? converter.zawgyiToUnicode(possiblyZawgyiText) : possiblyZawgyiText; | |
return converted; | |
} | |
zawgyiToUnicode('လုပ္ငန္းရွင္မ်ား စာရင္းသုိ႕ ျပန္သြားရန'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment