@vm75/inditrans 0.4.0 → 0.4.1
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/src/Inditrans.d.ts +1 -0
- package/dist/src/Inditrans.js +6 -0
- package/dist/src/InditransModule.d.ts +1 -0
- package/dist/src/Option.d.ts +5 -6
- package/dist/src/Option.js +5 -6
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +9 -2
- package/dist/src/inditrans.wasm +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# inditrans
|
|
2
2
|
|
|
3
|
-
An experimental transliterator library for some [Indic/
|
|
3
|
+
An experimental transliterator library for some [Indic/Brahmic](https://en.wikipedia.org/wiki/Brahmic_scripts) scripts.
|
|
4
4
|
|
|
5
5
|
- Self-contained and performant. Uses wasm.
|
|
6
6
|
- Supports [vedic accents](https://en.wikipedia.org/wiki/Vedic_accent). Useful for vedic scriptures.
|
package/dist/src/Inditrans.d.ts
CHANGED
package/dist/src/Inditrans.js
CHANGED
|
@@ -54,6 +54,12 @@ class Inditrans {
|
|
|
54
54
|
pointers.map((ptr) => this.module.stackRestore(ptr));
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
|
+
isScriptSupported(script) {
|
|
58
|
+
const ptr = this.stringToUtf8(script);
|
|
59
|
+
const result = this.module.isScriptSupported(ptr);
|
|
60
|
+
this.module.stackRestore(ptr);
|
|
61
|
+
return result == 1;
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
64
|
exports.Inditrans = Inditrans;
|
|
59
65
|
//# sourceMappingURL=Inditrans.js.map
|
package/dist/src/Option.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare enum Option {
|
|
2
2
|
None = 0,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
ASCIINumerals = 32
|
|
3
|
+
TamilTraditional = 1,
|
|
4
|
+
TamilSuperscripted = 2,
|
|
5
|
+
ASCIINumerals = 4,
|
|
6
|
+
IgnoreVedicAccents = 8,
|
|
7
|
+
ShowQuotedMarkers = 16
|
|
9
8
|
}
|
package/dist/src/Option.js
CHANGED
|
@@ -4,11 +4,10 @@ exports.Option = void 0;
|
|
|
4
4
|
var Option;
|
|
5
5
|
(function (Option) {
|
|
6
6
|
Option[Option["None"] = 0] = "None";
|
|
7
|
-
Option[Option["
|
|
8
|
-
Option[Option["
|
|
9
|
-
Option[Option["
|
|
10
|
-
Option[Option["
|
|
11
|
-
Option[Option["
|
|
12
|
-
Option[Option["ASCIINumerals"] = 32] = "ASCIINumerals";
|
|
7
|
+
Option[Option["TamilTraditional"] = 1] = "TamilTraditional";
|
|
8
|
+
Option[Option["TamilSuperscripted"] = 2] = "TamilSuperscripted";
|
|
9
|
+
Option[Option["ASCIINumerals"] = 4] = "ASCIINumerals";
|
|
10
|
+
Option[Option["IgnoreVedicAccents"] = 8] = "IgnoreVedicAccents";
|
|
11
|
+
Option[Option["ShowQuotedMarkers"] = 16] = "ShowQuotedMarkers";
|
|
13
12
|
})(Option = exports.Option || (exports.Option = {}));
|
|
14
13
|
//# sourceMappingURL=Option.js.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ import { Script } from './Script';
|
|
|
3
3
|
export { Option, Script };
|
|
4
4
|
export declare function init(): Promise<void>;
|
|
5
5
|
export declare function transliterate(text: string, from: Script, to: Script, options: Option): string;
|
|
6
|
-
declare
|
|
6
|
+
export declare function isScriptSupported(script: string): boolean;
|
|
7
|
+
declare const _default: (typeof Option | typeof Script | typeof init | typeof transliterate | typeof isScriptSupported)[];
|
|
7
8
|
export default _default;
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transliterate = exports.init = exports.Script = exports.Option = void 0;
|
|
3
|
+
exports.isScriptSupported = exports.transliterate = exports.init = exports.Script = exports.Option = void 0;
|
|
4
4
|
const Inditrans_1 = require("./Inditrans");
|
|
5
5
|
const Option_1 = require("./Option");
|
|
6
6
|
Object.defineProperty(exports, "Option", { enumerable: true, get: function () { return Option_1.Option; } });
|
|
@@ -18,5 +18,12 @@ function transliterate(text, from, to, options) {
|
|
|
18
18
|
return inditrans.transliterate(text, from, to, options);
|
|
19
19
|
}
|
|
20
20
|
exports.transliterate = transliterate;
|
|
21
|
-
|
|
21
|
+
function isScriptSupported(script) {
|
|
22
|
+
if (!inditrans) {
|
|
23
|
+
throw new Error('Inditrans not initialized');
|
|
24
|
+
}
|
|
25
|
+
return inditrans.isScriptSupported(script);
|
|
26
|
+
}
|
|
27
|
+
exports.isScriptSupported = isScriptSupported;
|
|
28
|
+
exports.default = [Option_1.Option, Script_1.Script, init, transliterate, isScriptSupported];
|
|
22
29
|
//# sourceMappingURL=index.js.map
|
package/dist/src/inditrans.wasm
CHANGED
|
Binary file
|