tibetan-mantra-to-iast-and-phonetics 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tool-versions +1 -0
- package/README.md +3 -1
- package/package.json +3 -2
- package/src/lib/tibetan-mantra-to-iast-and-phonetics-old.js +1094 -0
- package/src/lib/tibetan-mantra-to-iast-and-phonetics.js +14 -1012
- package/src/tests.js +26 -9
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python 3.10.14
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ import { TibetanMantraToIastAndPhonetics } from "tibetan-mantra-to-iast-and-phon
|
|
|
18
18
|
const tibetan = "ཨོཾ་མ་ཎི་པདྨེ་ཧཱུྃ།";
|
|
19
19
|
const transliterator = new TibetanMantraToIastAndPhonetics(tibetan);
|
|
20
20
|
const iast = transliterator.transliterate({ mode: "iast" });
|
|
21
|
-
console.log(iast); // "
|
|
21
|
+
console.log(iast); // "oṃ maṇi padmé hūṃ"
|
|
22
22
|
|
|
23
23
|
// Transliterate to phonetics
|
|
24
24
|
const phonetics = transliterator.transliterate({ mode: "phonetics" });
|
|
@@ -31,11 +31,13 @@ The `transliterate()` method accepts an options object:
|
|
|
31
31
|
|
|
32
32
|
- `mode`: `'iast'` (default) or `'phonetics'`
|
|
33
33
|
- `capitalize`: `true` or `false` (default) - Capitalizes the first letter
|
|
34
|
+
- `anusvaraStyle`: `'ṃ'` (default) or `'ṁ'` - Choose anusvara representation style (only applies to IAST mode)
|
|
34
35
|
|
|
35
36
|
```javascript
|
|
36
37
|
const result = transliterator.transliterate({
|
|
37
38
|
mode: "iast",
|
|
38
39
|
capitalize: true,
|
|
40
|
+
anusvaraStyle: "ṁ", // Use ṁ instead of default ṃ
|
|
39
41
|
});
|
|
40
42
|
```
|
|
41
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tibetan-mantra-to-iast-and-phonetics",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A library to transliterate Tibetan mantras to IAST and phonetics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"tibetan-normalizer": "^0.2.0"
|
|
24
|
+
"tibetan-normalizer": "^0.2.0",
|
|
25
|
+
"tibetan-sanskrit-transliteration-data": "^0.1.1"
|
|
25
26
|
}
|
|
26
27
|
}
|