Package Exports
- myanmar-tools
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (myanmar-tools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Myanmar Tools JavaScript Documentation
This documentation is for Java specific usage of Myanmar Tools. For general documentation, see the top-level README.
Node.JS Usage
Add the dependency to your project:
$ npm install --save myanmar-toolsTo detect Zawgyi, create an instance of ZawgyiDetector, and call getZawgyiProbability with your string.
const google_myanmar_tools = require("myanmar-tools");
const detector = new google_myanmar_tools.ZawgyiDetector();
const score = detector.getZawgyiProbability("မ္း");
// score is now 0.999772 (very likely Zawgyi)To convert Zawgyi to Unicode, you can look at third-party packages on npm. For example, using the package "rabbit-node":
const Rabbit = require("rabbit-node");
const output = Rabbit.zg2uni("မ္း");
// output is now "မ်း"Note: Google does not endorse any of the available third-party packages over any other.
For a complete working example, see samples/node/demo.js.
Browser Usage
Include the file zawgyi_detector.min.js. After doing this, the ZawgyiDetector will be available as the global google_myanmar_tools.ZawgyiDetector, and you can use it the same way as above:
const detector = new google_myanmar_tools.ZawgyiDetector();
const score = detector.getZawgyiProbability("မ္း");
// score is now 0.999772 (very likely Zawgyi)