# myanmar-tools

> Tools for handling the Zawgyi font encoding in Myanmar.

Latest version **1.2.0** (published 2020-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install myanmar-tools
pnpm add myanmar-tools
yarn add myanmar-tools
bun add myanmar-tools
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-07-29 |
| First published | 2017-11-10 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 237.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 266 |
| Maintainers | sffc |
| Keywords | zawgyi, myanmar, burma, burmese, zawgyi1, zawgyi-one |

## Links

- npm: https://www.npmjs.com/package/myanmar-tools
- Repository: https://github.com/googlei18n/myanmar-tools
- Homepage: https://github.com/googlei18n/myanmar-tools#readme
- Issues: https://github.com/googlei18n/myanmar-tools/issues
- npm.io page: https://npm.io/package/myanmar-tools

## Recent versions

- 1.2.0 (latest) — 2020-07-29
- 1.1.3 — 2019-11-04
- 1.1.2 — 2019-03-19
- 1.1.1 — 2018-11-01
- 1.1.0 — 2018-07-11
- 1.0.3 — 2018-01-25
- 1.0.2 — 2018-01-25
- 1.0.1 — 2017-11-10

## README

# Myanmar Tools JavaScript Documentation

This documentation is for JavaScript specific usage of *Myanmar Tools*.  For general documentation, see [the top-level README](../../README.md).

## Node.JS Usage

Add the dependency to your project:

```bash
$ npm install --save myanmar-tools
```

To detect Zawgyi, create an instance of ZawgyiDetector, and call `getZawgyiProbability` with your string.

```js
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)
```

Zawgyi can be converted to Unicode as follows:

```js
const google_myanmar_tools = require("myanmar-tools");
const converter = new google_myanmar_tools.ZawgyiConverter();
const output = converter.zawgyiToUnicode("မ္း");
// output is now "မ်း"
```

You can use `converter.unicodeToZawgyi("...")` to convert in the opposite direction when possible.

For a complete working example, see [samples/node/demo.js](../../samples/node/demo.js).

## Browser Usage

Include the file *zawgyi_detector.min.js*.  It is available on [Google Hosted Libraries](https://developers.google.com/speed/libraries/#myanmar-tools):

```html
<script src="https://ajax.googleapis.com/ajax/libs/myanmar-tools/1.1.3/zawgyi_detector.min.js"></script>
```

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:

```js
const detector = new google_myanmar_tools.ZawgyiDetector();
const score = detector.getZawgyiProbability("မ္း");
// score is now 0.999772 (very likely Zawgyi)
```

Likewise for the converter:

```html
<script src="https://ajax.googleapis.com/ajax/libs/myanmar-tools/1.1.3/zawgyi_converter.min.js"></script>
```

```js
const converter = new google_myanmar_tools.ZawgyiConverter();
const output = converter.zawgyiToUnicode("မ္း");
// output is now "မ်း"
```

---
_Source: https://npm.io/package/myanmar-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
