tamil-toolkit 0.1.0-alpha.1 → 0.1.0-alpha.3
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/README.md +91 -24
- package/THIRD_PARTY_NOTICES.md +32 -0
- package/dist/api.d.ts +8 -0
- package/dist/api.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/web.d.ts +1 -1
- package/dist/web.js +1 -1
- package/package.json +1 -1
- package/pkg-node/README.md +91 -24
- package/pkg-node/package.json +1 -1
- package/pkg-node/tamil_toolkit_bg.wasm +0 -0
- package/pkg-web/README.md +91 -24
- package/pkg-web/package.json +1 -1
- package/pkg-web/tamil_toolkit_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,30 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
# tamil-toolkit for JavaScript and TypeScript
|
|
4
|
+
|
|
5
|
+
**Rust-backed Tamil text tools for Node.js and browsers.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
8
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
9
|
+
[](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
|
|
10
|
+
[](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE)
|
|
11
|
+
|
|
12
|
+
[Install](#install) · [Node quick start](#node-quick-start) · [Documentation](#documentation)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## What’s included
|
|
17
|
+
|
|
18
|
+
| Area | Capabilities |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| **Unicode and letters** | NFC/NFD normalization, tailored Tamil letter operations, and inspection. |
|
|
21
|
+
| **Ordering** | Stable Mei-first Agara collation and versioned sort/search keys. |
|
|
22
|
+
| **Numbers and dates** | Bounded TN/SL number words, exact INR/LKR amounts, fractions, and Gregorian dates. |
|
|
23
|
+
| **Legacy conversion** | Bamini text conversion, bounded TSCII/TAB/TAM/Anjal byte profiles, and LT-TM / IndoWord 16-bit CID conversion. |
|
|
24
|
+
|
|
25
|
+
TypeScript and WASM are thin bindings to the shared Rust implementation.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Node.js 22+ is supported. Install alpha 3 from npm’s `alpha` dist-tag:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install tamil-toolkit@alpha
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `alpha` tag points to `0.1.0-alpha.3`; npm’s `latest` tag still points to
|
|
36
|
+
`0.1.0-alpha.1`. The version badge above tracks the `alpha` tag.
|
|
37
|
+
|
|
38
|
+
## Node quick start
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
import * as tamil from "tamil-toolkit";
|
|
42
|
+
|
|
43
|
+
const text = "தமிழ்";
|
|
44
|
+
console.log(tamil.get_letters(text).join(" | ")); // த | மி | ழ்
|
|
45
|
+
console.log(tamil.unicode_to_bamini(text)); // jkpo;
|
|
46
|
+
console.log(tamil.format_currency(102550, "LKR", "SL")); // LKR 1,025.50
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Browser quick start
|
|
50
|
+
|
|
51
|
+
Use the `/web` entry point and initialize WebAssembly before calling the API:
|
|
11
52
|
|
|
12
53
|
```javascript
|
|
13
|
-
import {
|
|
54
|
+
import { init, get_letters } from "tamil-toolkit/web";
|
|
14
55
|
|
|
15
|
-
|
|
16
|
-
console.log(
|
|
56
|
+
await init();
|
|
57
|
+
console.log(get_letters("தமிழ்").join(" | "));
|
|
17
58
|
```
|
|
18
59
|
|
|
19
|
-
The
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
60
|
+
The host page or bundler must serve the packaged WASM asset as an ES module
|
|
61
|
+
asset. The Node entry point initializes its native WASM module automatically.
|
|
62
|
+
|
|
63
|
+
## Alpha 3 scope
|
|
64
|
+
|
|
65
|
+
The npm `0.1.0-alpha.3` package includes the capabilities listed above. The
|
|
66
|
+
shared `execute` API exposes `lt_tm_codes_to_unicode`, `lt_tm_text_to_unicode`,
|
|
67
|
+
`unicode_to_lt_tm_codes`, and `unicode_to_lt_tm_text`. LT-TM conversion handles
|
|
68
|
+
selected 16-bit code sequences; it does not parse PDFs, select font runs, or
|
|
69
|
+
detect encodings. The profile does not claim complete historical-font coverage.
|
|
70
|
+
APIs may change.
|
|
71
|
+
|
|
72
|
+
Other planned linguistic modules, the private PDF extraction utility, and
|
|
73
|
+
Dart/Pub distribution are not published.
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import * as tamil from "tamil-toolkit";
|
|
77
|
+
|
|
78
|
+
const codes = tamil.execute({ op: "unicode_to_lt_tm_codes", input: { text: "தமிழ்" } });
|
|
79
|
+
const text = tamil.execute({ op: "lt_tm_codes_to_unicode", input: { codes } });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
- [API and feature overview](https://github.com/abishtakan/tamil-toolkit#capability-contracts)
|
|
85
|
+
- [JavaScript/WASM API declarations](https://github.com/abishtakan/tamil-toolkit/tree/master/bindings/js-wasm)
|
|
86
|
+
- [Unicode/core contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/core-v0.1.md)
|
|
87
|
+
- [Collation contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/collate-v0.1.md)
|
|
88
|
+
- [Numerals, fractions, and dates](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/numerals-v0.2.md)
|
|
89
|
+
- [Codec contract and alpha 3 limits](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/releases/alpha-3.md#compatibility-and-scope)
|
|
90
|
+
- [LT-TM CID profile contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/codec-lt-tm.md)
|
|
91
|
+
- [Third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md)
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
Original code is [MIT licensed](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE).
|
|
96
|
+
Bundled data and mappings retain their recorded terms in the
|
|
97
|
+
[third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md).
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -7,6 +7,10 @@ replace them. Generated lexicon copies are checked against the canonical data.
|
|
|
7
7
|
Unicode 17 and CLDR 49 data: https://www.unicode.org/ and https://cldr.unicode.org/
|
|
8
8
|
Bamini mapping sources: https://github.com/ag-sanjjeev/app-tamil-fonts-unicode-converter
|
|
9
9
|
and https://github.com/Pakeetharan/unicode-bamini-converter
|
|
10
|
+
TSCII mapping source: https://github.com/mayooresan/Android-TamilUtil
|
|
11
|
+
LT-TM mapping reference: Azhagi+ Portable configuration; source digest and
|
|
12
|
+
scope are recorded in docs/specs/codec-lt-tm.md. Its bundled terms remain
|
|
13
|
+
applicable to the derived mapping table.
|
|
10
14
|
Exact sources, revisions, digests and profile limits are recorded at:
|
|
11
15
|
https://github.com/abishtakan/tamil-toolkit/tree/HEAD/tests/reference
|
|
12
16
|
and https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs
|
|
@@ -110,3 +114,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
110
114
|
SOFTWARE.
|
|
111
115
|
```
|
|
112
116
|
|
|
117
|
+
## Jay Mayu Android TamilUtil reference (MIT)
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
The MIT License (MIT)
|
|
121
|
+
|
|
122
|
+
Copyright (c) 2016 Jay Mayu
|
|
123
|
+
|
|
124
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
125
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
126
|
+
in the Software without restriction, including without limitation the rights
|
|
127
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
128
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
129
|
+
furnished to do so, subject to the following conditions:
|
|
130
|
+
|
|
131
|
+
The above copyright notice and this permission notice shall be included in all
|
|
132
|
+
copies or substantial portions of the Software.
|
|
133
|
+
|
|
134
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
135
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
136
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
137
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
138
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
139
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
140
|
+
SOFTWARE.
|
|
141
|
+
|
|
142
|
+
Above license is for Tamil-Utill only. We do not offer fonts used in the example under the same license.
|
|
143
|
+
```
|
|
144
|
+
|
package/dist/api.d.ts
CHANGED
|
@@ -41,6 +41,14 @@ export declare function createApi(nativeExecute: (request: string) => string): {
|
|
|
41
41
|
currency_to_words: (amount_minor: number, currency: Currency, locale?: Locale) => string;
|
|
42
42
|
bamini_to_unicode: (text: string, errors?: CodecErrorPolicy) => string;
|
|
43
43
|
unicode_to_bamini: (text: string) => string;
|
|
44
|
+
anjal_bytes_to_unicode: (bytes: Uint8Array | number[]) => string;
|
|
45
|
+
unicode_to_anjal_bytes: (text: string) => number[];
|
|
46
|
+
tam_bytes_to_unicode: (bytes: Uint8Array | number[]) => string;
|
|
47
|
+
unicode_to_tam_bytes: (text: string) => number[];
|
|
48
|
+
tab_bytes_to_unicode: (bytes: Uint8Array | number[]) => string;
|
|
49
|
+
unicode_to_tab_bytes: (text: string) => number[];
|
|
50
|
+
tscii_bytes_to_unicode: (bytes: Uint8Array | number[]) => string;
|
|
51
|
+
unicode_to_tscii_bytes: (text: string) => number[];
|
|
44
52
|
format_fraction: (numerator: number, denominator: number, digits?: DigitStyle) => string;
|
|
45
53
|
fraction_to_words: (numerator: number, denominator: number, locale?: Locale) => string;
|
|
46
54
|
fraction_symbol: (numerator: number, denominator: number) => string;
|
package/dist/api.js
CHANGED
|
@@ -18,6 +18,14 @@ export function createApi(nativeExecute) {
|
|
|
18
18
|
currency_to_words: (amount_minor, currency, locale = "TN") => execute({ op: "currency_to_words", input: { amount_minor, currency, locale } }),
|
|
19
19
|
bamini_to_unicode: (text, errors = "strict") => execute({ op: "bamini_to_unicode", input: { text, errors } }),
|
|
20
20
|
unicode_to_bamini: (text) => execute({ op: "unicode_to_bamini", input: { text } }),
|
|
21
|
+
anjal_bytes_to_unicode: (bytes) => execute({ op: "anjal_bytes_to_unicode", input: { bytes: Array.from(bytes) } }),
|
|
22
|
+
unicode_to_anjal_bytes: (text) => execute({ op: "unicode_to_anjal_bytes", input: { text } }),
|
|
23
|
+
tam_bytes_to_unicode: (bytes) => execute({ op: "tam_bytes_to_unicode", input: { bytes: Array.from(bytes) } }),
|
|
24
|
+
unicode_to_tam_bytes: (text) => execute({ op: "unicode_to_tam_bytes", input: { text } }),
|
|
25
|
+
tab_bytes_to_unicode: (bytes) => execute({ op: "tab_bytes_to_unicode", input: { bytes: Array.from(bytes) } }),
|
|
26
|
+
unicode_to_tab_bytes: (text) => execute({ op: "unicode_to_tab_bytes", input: { text } }),
|
|
27
|
+
tscii_bytes_to_unicode: (bytes) => execute({ op: "tscii_bytes_to_unicode", input: { bytes: Array.from(bytes) } }),
|
|
28
|
+
unicode_to_tscii_bytes: (text) => execute({ op: "unicode_to_tscii_bytes", input: { text } }),
|
|
21
29
|
format_fraction: (numerator, denominator, digits = "latin") => execute({ op: "format_fraction", input: { numerator, denominator, digits } }),
|
|
22
30
|
fraction_to_words: (numerator, denominator, locale = "TN") => execute({ op: "fraction_to_words", input: { numerator, denominator, locale } }),
|
|
23
31
|
fraction_symbol: (numerator, denominator) => execute({ op: "fraction_symbol", input: { numerator, denominator } }),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { Uyirmei, Request, Inspection, Locale, Currency, CodecErrorPolicy, DigitStyle, DateStyle } from "./api.js";
|
|
2
|
-
export declare const execute: (request: import("./api.js").Request) => unknown, get_letters: (text: string) => string[], normalize_nfc: (text: string) => string, normalize_nfd: (text: string) => string, split_uyirmei: (text: string) => import("./api.js").Uyirmei, compose_uyirmei: (mei: string, uyir: string) => string, inspect_tamil_string: (text: string) => import("./api.js").Inspection, compare: (left: string, right: string) => -1 | 0 | 1, sort_words: (words: string[]) => string[], sort_key: (text: string) => number[], search_key: (text: string) => number[], to_words: (value: number, locale?: import("./api.js").Locale) => string, format_currency: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, currency_to_words: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, bamini_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_bamini: (text: string) => string, format_fraction: (numerator: number, denominator: number, digits?: import("./api.js").DigitStyle) => string, fraction_to_words: (numerator: number, denominator: number, locale?: import("./api.js").Locale) => string, fraction_symbol: (numerator: number, denominator: number) => string, format_date: (year: number, month: number, day: number, locale?: import("./api.js").Locale, style?: import("./api.js").DateStyle, digits?: import("./api.js").DigitStyle) => string;
|
|
2
|
+
export declare const execute: (request: import("./api.js").Request) => unknown, get_letters: (text: string) => string[], normalize_nfc: (text: string) => string, normalize_nfd: (text: string) => string, split_uyirmei: (text: string) => import("./api.js").Uyirmei, compose_uyirmei: (mei: string, uyir: string) => string, inspect_tamil_string: (text: string) => import("./api.js").Inspection, compare: (left: string, right: string) => -1 | 0 | 1, sort_words: (words: string[]) => string[], sort_key: (text: string) => number[], search_key: (text: string) => number[], to_words: (value: number, locale?: import("./api.js").Locale) => string, format_currency: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, currency_to_words: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, bamini_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_bamini: (text: string) => string, anjal_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_anjal_bytes: (text: string) => number[], tam_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tam_bytes: (text: string) => number[], tab_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tab_bytes: (text: string) => number[], tscii_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tscii_bytes: (text: string) => number[], format_fraction: (numerator: number, denominator: number, digits?: import("./api.js").DigitStyle) => string, fraction_to_words: (numerator: number, denominator: number, locale?: import("./api.js").Locale) => string, fraction_symbol: (numerator: number, denominator: number) => string, format_date: (year: number, month: number, day: number, locale?: import("./api.js").Locale, style?: import("./api.js").DateStyle, digits?: import("./api.js").DigitStyle) => string;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { execute as nativeExecute } from "../pkg-node/tamil_toolkit.js";
|
|
2
2
|
import { createApi } from "./api.js";
|
|
3
|
-
export const { execute, get_letters, normalize_nfc, normalize_nfd, split_uyirmei, compose_uyirmei, inspect_tamil_string, compare, sort_words, sort_key, search_key, to_words, format_currency, currency_to_words, bamini_to_unicode, unicode_to_bamini, format_fraction, fraction_to_words, fraction_symbol, format_date } = createApi(nativeExecute);
|
|
3
|
+
export const { execute, get_letters, normalize_nfc, normalize_nfd, split_uyirmei, compose_uyirmei, inspect_tamil_string, compare, sort_words, sort_key, search_key, to_words, format_currency, currency_to_words, bamini_to_unicode, unicode_to_bamini, anjal_bytes_to_unicode, unicode_to_anjal_bytes, tam_bytes_to_unicode, unicode_to_tam_bytes, tab_bytes_to_unicode, unicode_to_tab_bytes, tscii_bytes_to_unicode, unicode_to_tscii_bytes, format_fraction, fraction_to_words, fraction_symbol, format_date } = createApi(nativeExecute);
|
package/dist/web.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import init from "../pkg-web/tamil_toolkit.js";
|
|
2
2
|
export { init };
|
|
3
3
|
export type { Uyirmei, Request, Inspection, Locale, Currency, CodecErrorPolicy, DigitStyle, DateStyle } from "./api.js";
|
|
4
|
-
export declare const execute: (request: import("./api.js").Request) => unknown, get_letters: (text: string) => string[], normalize_nfc: (text: string) => string, normalize_nfd: (text: string) => string, split_uyirmei: (text: string) => import("./api.js").Uyirmei, compose_uyirmei: (mei: string, uyir: string) => string, inspect_tamil_string: (text: string) => import("./api.js").Inspection, compare: (left: string, right: string) => -1 | 0 | 1, sort_words: (words: string[]) => string[], sort_key: (text: string) => number[], search_key: (text: string) => number[], to_words: (value: number, locale?: import("./api.js").Locale) => string, format_currency: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, currency_to_words: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, bamini_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_bamini: (text: string) => string, format_fraction: (numerator: number, denominator: number, digits?: import("./api.js").DigitStyle) => string, fraction_to_words: (numerator: number, denominator: number, locale?: import("./api.js").Locale) => string, fraction_symbol: (numerator: number, denominator: number) => string, format_date: (year: number, month: number, day: number, locale?: import("./api.js").Locale, style?: import("./api.js").DateStyle, digits?: import("./api.js").DigitStyle) => string;
|
|
4
|
+
export declare const execute: (request: import("./api.js").Request) => unknown, get_letters: (text: string) => string[], normalize_nfc: (text: string) => string, normalize_nfd: (text: string) => string, split_uyirmei: (text: string) => import("./api.js").Uyirmei, compose_uyirmei: (mei: string, uyir: string) => string, inspect_tamil_string: (text: string) => import("./api.js").Inspection, compare: (left: string, right: string) => -1 | 0 | 1, sort_words: (words: string[]) => string[], sort_key: (text: string) => number[], search_key: (text: string) => number[], to_words: (value: number, locale?: import("./api.js").Locale) => string, format_currency: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, currency_to_words: (amount_minor: number, currency: import("./api.js").Currency, locale?: import("./api.js").Locale) => string, bamini_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_bamini: (text: string) => string, anjal_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_anjal_bytes: (text: string) => number[], tam_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tam_bytes: (text: string) => number[], tab_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tab_bytes: (text: string) => number[], tscii_bytes_to_unicode: (bytes: Uint8Array | number[]) => string, unicode_to_tscii_bytes: (text: string) => number[], format_fraction: (numerator: number, denominator: number, digits?: import("./api.js").DigitStyle) => string, fraction_to_words: (numerator: number, denominator: number, locale?: import("./api.js").Locale) => string, fraction_symbol: (numerator: number, denominator: number) => string, format_date: (year: number, month: number, day: number, locale?: import("./api.js").Locale, style?: import("./api.js").DateStyle, digits?: import("./api.js").DigitStyle) => string;
|
package/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import init, { execute as nativeExecute } from "../pkg-web/tamil_toolkit.js";
|
|
2
2
|
import { createApi } from "./api.js";
|
|
3
3
|
export { init };
|
|
4
|
-
export const { execute, get_letters, normalize_nfc, normalize_nfd, split_uyirmei, compose_uyirmei, inspect_tamil_string, compare, sort_words, sort_key, search_key, to_words, format_currency, currency_to_words, bamini_to_unicode, unicode_to_bamini, format_fraction, fraction_to_words, fraction_symbol, format_date } = createApi(nativeExecute);
|
|
4
|
+
export const { execute, get_letters, normalize_nfc, normalize_nfd, split_uyirmei, compose_uyirmei, inspect_tamil_string, compare, sort_words, sort_key, search_key, to_words, format_currency, currency_to_words, bamini_to_unicode, unicode_to_bamini, anjal_bytes_to_unicode, unicode_to_anjal_bytes, tam_bytes_to_unicode, unicode_to_tam_bytes, tab_bytes_to_unicode, unicode_to_tab_bytes, tscii_bytes_to_unicode, unicode_to_tscii_bytes, format_fraction, fraction_to_words, fraction_symbol, format_date } = createApi(nativeExecute);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamil-toolkit",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {"type": "git", "url": "https://github.com/abishtakan/tamil-toolkit.git", "directory": "bindings/js-wasm"},
|
|
6
6
|
"homepage": "https://github.com/abishtakan/tamil-toolkit#readme",
|
package/pkg-node/README.md
CHANGED
|
@@ -1,30 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
# tamil-toolkit for JavaScript and TypeScript
|
|
4
|
+
|
|
5
|
+
**Rust-backed Tamil text tools for Node.js and browsers.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
8
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
9
|
+
[](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
|
|
10
|
+
[](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE)
|
|
11
|
+
|
|
12
|
+
[Install](#install) · [Node quick start](#node-quick-start) · [Documentation](#documentation)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## What’s included
|
|
17
|
+
|
|
18
|
+
| Area | Capabilities |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| **Unicode and letters** | NFC/NFD normalization, tailored Tamil letter operations, and inspection. |
|
|
21
|
+
| **Ordering** | Stable Mei-first Agara collation and versioned sort/search keys. |
|
|
22
|
+
| **Numbers and dates** | Bounded TN/SL number words, exact INR/LKR amounts, fractions, and Gregorian dates. |
|
|
23
|
+
| **Legacy conversion** | Bamini text conversion, bounded TSCII/TAB/TAM/Anjal byte profiles, and LT-TM / IndoWord 16-bit CID conversion. |
|
|
24
|
+
|
|
25
|
+
TypeScript and WASM are thin bindings to the shared Rust implementation.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Node.js 22+ is supported. Install alpha 3 from npm’s `alpha` dist-tag:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install tamil-toolkit@alpha
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `alpha` tag points to `0.1.0-alpha.3`; npm’s `latest` tag still points to
|
|
36
|
+
`0.1.0-alpha.1`. The version badge above tracks the `alpha` tag.
|
|
37
|
+
|
|
38
|
+
## Node quick start
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
import * as tamil from "tamil-toolkit";
|
|
42
|
+
|
|
43
|
+
const text = "தமிழ்";
|
|
44
|
+
console.log(tamil.get_letters(text).join(" | ")); // த | மி | ழ்
|
|
45
|
+
console.log(tamil.unicode_to_bamini(text)); // jkpo;
|
|
46
|
+
console.log(tamil.format_currency(102550, "LKR", "SL")); // LKR 1,025.50
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Browser quick start
|
|
50
|
+
|
|
51
|
+
Use the `/web` entry point and initialize WebAssembly before calling the API:
|
|
11
52
|
|
|
12
53
|
```javascript
|
|
13
|
-
import {
|
|
54
|
+
import { init, get_letters } from "tamil-toolkit/web";
|
|
14
55
|
|
|
15
|
-
|
|
16
|
-
console.log(
|
|
56
|
+
await init();
|
|
57
|
+
console.log(get_letters("தமிழ்").join(" | "));
|
|
17
58
|
```
|
|
18
59
|
|
|
19
|
-
The
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
60
|
+
The host page or bundler must serve the packaged WASM asset as an ES module
|
|
61
|
+
asset. The Node entry point initializes its native WASM module automatically.
|
|
62
|
+
|
|
63
|
+
## Alpha 3 scope
|
|
64
|
+
|
|
65
|
+
The npm `0.1.0-alpha.3` package includes the capabilities listed above. The
|
|
66
|
+
shared `execute` API exposes `lt_tm_codes_to_unicode`, `lt_tm_text_to_unicode`,
|
|
67
|
+
`unicode_to_lt_tm_codes`, and `unicode_to_lt_tm_text`. LT-TM conversion handles
|
|
68
|
+
selected 16-bit code sequences; it does not parse PDFs, select font runs, or
|
|
69
|
+
detect encodings. The profile does not claim complete historical-font coverage.
|
|
70
|
+
APIs may change.
|
|
71
|
+
|
|
72
|
+
Other planned linguistic modules, the private PDF extraction utility, and
|
|
73
|
+
Dart/Pub distribution are not published.
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import * as tamil from "tamil-toolkit";
|
|
77
|
+
|
|
78
|
+
const codes = tamil.execute({ op: "unicode_to_lt_tm_codes", input: { text: "தமிழ்" } });
|
|
79
|
+
const text = tamil.execute({ op: "lt_tm_codes_to_unicode", input: { codes } });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
- [API and feature overview](https://github.com/abishtakan/tamil-toolkit#capability-contracts)
|
|
85
|
+
- [JavaScript/WASM API declarations](https://github.com/abishtakan/tamil-toolkit/tree/master/bindings/js-wasm)
|
|
86
|
+
- [Unicode/core contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/core-v0.1.md)
|
|
87
|
+
- [Collation contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/collate-v0.1.md)
|
|
88
|
+
- [Numerals, fractions, and dates](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/numerals-v0.2.md)
|
|
89
|
+
- [Codec contract and alpha 3 limits](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/releases/alpha-3.md#compatibility-and-scope)
|
|
90
|
+
- [LT-TM CID profile contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/codec-lt-tm.md)
|
|
91
|
+
- [Third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md)
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
Original code is [MIT licensed](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE).
|
|
96
|
+
Bundled data and mappings retain their recorded terms in the
|
|
97
|
+
[third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md).
|
package/pkg-node/package.json
CHANGED
|
Binary file
|
package/pkg-web/README.md
CHANGED
|
@@ -1,30 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
# tamil-toolkit for JavaScript and TypeScript
|
|
4
|
+
|
|
5
|
+
**Rust-backed Tamil text tools for Node.js and browsers.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
8
|
+
[](https://www.npmjs.com/package/tamil-toolkit)
|
|
9
|
+
[](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
|
|
10
|
+
[](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE)
|
|
11
|
+
|
|
12
|
+
[Install](#install) · [Node quick start](#node-quick-start) · [Documentation](#documentation)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## What’s included
|
|
17
|
+
|
|
18
|
+
| Area | Capabilities |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| **Unicode and letters** | NFC/NFD normalization, tailored Tamil letter operations, and inspection. |
|
|
21
|
+
| **Ordering** | Stable Mei-first Agara collation and versioned sort/search keys. |
|
|
22
|
+
| **Numbers and dates** | Bounded TN/SL number words, exact INR/LKR amounts, fractions, and Gregorian dates. |
|
|
23
|
+
| **Legacy conversion** | Bamini text conversion, bounded TSCII/TAB/TAM/Anjal byte profiles, and LT-TM / IndoWord 16-bit CID conversion. |
|
|
24
|
+
|
|
25
|
+
TypeScript and WASM are thin bindings to the shared Rust implementation.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Node.js 22+ is supported. Install alpha 3 from npm’s `alpha` dist-tag:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npm install tamil-toolkit@alpha
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The `alpha` tag points to `0.1.0-alpha.3`; npm’s `latest` tag still points to
|
|
36
|
+
`0.1.0-alpha.1`. The version badge above tracks the `alpha` tag.
|
|
37
|
+
|
|
38
|
+
## Node quick start
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
import * as tamil from "tamil-toolkit";
|
|
42
|
+
|
|
43
|
+
const text = "தமிழ்";
|
|
44
|
+
console.log(tamil.get_letters(text).join(" | ")); // த | மி | ழ்
|
|
45
|
+
console.log(tamil.unicode_to_bamini(text)); // jkpo;
|
|
46
|
+
console.log(tamil.format_currency(102550, "LKR", "SL")); // LKR 1,025.50
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Browser quick start
|
|
50
|
+
|
|
51
|
+
Use the `/web` entry point and initialize WebAssembly before calling the API:
|
|
11
52
|
|
|
12
53
|
```javascript
|
|
13
|
-
import {
|
|
54
|
+
import { init, get_letters } from "tamil-toolkit/web";
|
|
14
55
|
|
|
15
|
-
|
|
16
|
-
console.log(
|
|
56
|
+
await init();
|
|
57
|
+
console.log(get_letters("தமிழ்").join(" | "));
|
|
17
58
|
```
|
|
18
59
|
|
|
19
|
-
The
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
60
|
+
The host page or bundler must serve the packaged WASM asset as an ES module
|
|
61
|
+
asset. The Node entry point initializes its native WASM module automatically.
|
|
62
|
+
|
|
63
|
+
## Alpha 3 scope
|
|
64
|
+
|
|
65
|
+
The npm `0.1.0-alpha.3` package includes the capabilities listed above. The
|
|
66
|
+
shared `execute` API exposes `lt_tm_codes_to_unicode`, `lt_tm_text_to_unicode`,
|
|
67
|
+
`unicode_to_lt_tm_codes`, and `unicode_to_lt_tm_text`. LT-TM conversion handles
|
|
68
|
+
selected 16-bit code sequences; it does not parse PDFs, select font runs, or
|
|
69
|
+
detect encodings. The profile does not claim complete historical-font coverage.
|
|
70
|
+
APIs may change.
|
|
71
|
+
|
|
72
|
+
Other planned linguistic modules, the private PDF extraction utility, and
|
|
73
|
+
Dart/Pub distribution are not published.
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import * as tamil from "tamil-toolkit";
|
|
77
|
+
|
|
78
|
+
const codes = tamil.execute({ op: "unicode_to_lt_tm_codes", input: { text: "தமிழ்" } });
|
|
79
|
+
const text = tamil.execute({ op: "lt_tm_codes_to_unicode", input: { codes } });
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Documentation
|
|
83
|
+
|
|
84
|
+
- [API and feature overview](https://github.com/abishtakan/tamil-toolkit#capability-contracts)
|
|
85
|
+
- [JavaScript/WASM API declarations](https://github.com/abishtakan/tamil-toolkit/tree/master/bindings/js-wasm)
|
|
86
|
+
- [Unicode/core contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/core-v0.1.md)
|
|
87
|
+
- [Collation contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/collate-v0.1.md)
|
|
88
|
+
- [Numerals, fractions, and dates](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/numerals-v0.2.md)
|
|
89
|
+
- [Codec contract and alpha 3 limits](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/releases/alpha-3.md#compatibility-and-scope)
|
|
90
|
+
- [LT-TM CID profile contract](https://github.com/abishtakan/tamil-toolkit/blob/master/docs/specs/codec-lt-tm.md)
|
|
91
|
+
- [Third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md)
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
Original code is [MIT licensed](https://github.com/abishtakan/tamil-toolkit/blob/master/LICENSE).
|
|
96
|
+
Bundled data and mappings retain their recorded terms in the
|
|
97
|
+
[third-party notices](https://github.com/abishtakan/tamil-toolkit/blob/master/THIRD_PARTY_NOTICES.md).
|
package/pkg-web/package.json
CHANGED
|
Binary file
|