WASM-module to convert text from EWTS (Extended Wylie Transliteration Scheme) to Tibetan Unicode symbols
Fully compliant with the standard. See all rules on The Tibetan and Himalayan Library's site and tests on them here in rules_test.rs file.
It is part of set of apps/libs called ewts-rs. See more here
npm install ewts
Main module in package ('ewts/index.js
') at this time can only be used with bundlers (webpack, rollup, etc.).
If you don't use them, you can import submodule that natively supported by nodejs(ewts/nodejs
)
or by browsers ('ewts/web'
)
More info about difference between submodules in ewts
package can be found
on wasm-pack documentation:
-
ewts
(ewts/index.js
etc.) built with--target bundler
flag -
ewts/nodejs
with--target nodejs
- and
ewts/web
built with--target web
flag
import {EwtsConverter} from 'ewts'
// or from 'ewts/nodejs'
// or from 'ewts/web'
const converter = new EwtsConverter()
const ewtsStr = "oM ma Ni pad+me hU~M/"
const tibUnicodeStr = converter.ewtsToUnicode(ewtsStr)
console.log(tibUnicodeStr)
// "ཨོཾ་མ་ཎི་པདྨེ་ཧཱུྃ།"
Version built for bundlers is used for demo page: sources and result.
Other examples stored at ./examples dir.
To view it at work do:
git clone https://github.com/emgyrz/ewts-rs.git
cd ewts-rs/ewts-wasm/examples
npm i
# prints to console conversion result
node ./usage_in_node.js
# opens browser with simple page where `ewts` is used
npx http-server . -o "/usage_in_browser_without_bundlers.html"