tamil-toolkit 0.1.0-alpha.2 → 0.1.0-alpha.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/README.md CHANGED
@@ -1,39 +1,97 @@
1
- # tamil-toolkit for TypeScript / WASM
1
+ <div align="center">
2
2
 
3
- `just sync-bindings` produces Node and browser WASM builds and TypeScript
4
- declarations. Node: `import * as tamil from 'tamil-toolkit'`. Browser:
5
- `import { init, get_letters } from 'tamil-toolkit/web'; await init();`.
6
- Install the experimental MIT-licensed alpha on npm with `npm install tamil-toolkit@alpha`.
7
- These adapters serialize calls into the shared Rust dispatcher. Planned modules
8
- are excluded. APIs may change before stability. Node 22+ is supported; browser
9
- consumers must initialize the WASM module before calling its functions.
3
+ # tamil-toolkit for JavaScript and TypeScript
4
+
5
+ **Rust-backed Tamil text tools for Node.js and browsers.**
6
+
7
+ [![npm alpha version](https://img.shields.io/npm/v/tamil-toolkit/alpha?style=flat-square&label=npm%20alpha)](https://www.npmjs.com/package/tamil-toolkit)
8
+ [![Monthly downloads](https://img.shields.io/npm/dm/tamil-toolkit?style=flat-square&label=monthly)](https://www.npmjs.com/package/tamil-toolkit)
9
+ [![CI](https://img.shields.io/github/actions/workflow/status/abishtakan/tamil-toolkit/ci.yml?branch=master&style=flat-square&label=CI)](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
10
+ [![MIT license](https://img.shields.io/github/license/abishtakan/tamil-toolkit?style=flat-square)](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 4 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.4`; 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:
10
52
 
11
53
  ```javascript
12
- import { format_fraction, format_currency } from "tamil-toolkit";
54
+ import { init, get_letters } from "tamil-toolkit/web";
13
55
 
14
- console.log(format_fraction(2, 4)); // 1/2
15
- console.log(format_currency(102550, "LKR", "SL")); // LKR 1,025.50
56
+ await init();
57
+ console.log(get_letters("தமிழ்").join(" | "));
16
58
  ```
17
59
 
18
- The package includes core Unicode/Ezhuthu functions, Agara collation, bounded
19
- TN/SL integer and currency words, fractions, Gregorian dates, and explicit
20
- Bamini and bounded TSCII, TAB, TAM and Anjal byte conversion. For browser code use the `/web` entry point, `await init()`,
21
- then call the same methods. Hosts must serve the packaged WASM file with the
22
- generated loader; bundlers must support WebAssembly assets and ES modules.
23
- See LICENSE, THIRD_PARTY_NOTICES.md, and bundled dependency license notices.
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 4 scope
64
+
65
+ The npm `0.1.0-alpha.4` 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.
24
71
 
25
- Both entry points expose `compare`, `sort_words`, `sort_key`, and `search_key`.
26
- Use the comparison result or numeric-array keys for ordering; comparing their
27
- JSON string representation is incorrect. The versioned `agara-v1` profile and
28
- its mixed-script fallback are specified at
29
- https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs/collate-v0.1.md.
72
+ Other planned linguistic modules, the private PDF extraction utility, and
73
+ Dart/Pub distribution are not published.
30
74
 
31
- This distribution provides `tscii_bytes_to_unicode(new Uint8Array([0xba, 0xa2, 0xc5, 0xfd]))`.
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
+ ```
32
81
 
33
- `unicode_to_tscii_bytes(text)` returns an array of byte values.
82
+ ## Documentation
34
83
 
35
- This distribution provides `tab_bytes_to_unicode(bytes)` and `unicode_to_tab_bytes(text)`.
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-4.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)
36
92
 
37
- This distribution provides `tam_bytes_to_unicode(bytes)` and `unicode_to_tam_bytes(text)`; TAM bytes do not preserve Latin letters.
93
+ ## License
38
94
 
39
- This distribution provides `anjal_bytes_to_unicode(bytes)` and `unicode_to_anjal_bytes(text)`; ambiguous legacy bytes raise an error.
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).
@@ -8,6 +8,10 @@ Unicode 17 and CLDR 49 data: https://www.unicode.org/ and https://cldr.unicode.o
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
10
  TSCII mapping source: https://github.com/mayooresan/Android-TamilUtil
11
+ LT-TM and Vanavil mapping references: Azhagi+ Portable configurations; source
12
+ digests and scope are recorded in docs/specs/codec-lt-tm.md and
13
+ docs/specs/codec-vanavil.md. Their bundled terms remain applicable to the
14
+ derived mapping tables.
11
15
  Exact sources, revisions, digests and profile limits are recorded at:
12
16
  https://github.com/abishtakan/tamil-toolkit/tree/HEAD/tests/reference
13
17
  and https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs
package/dist/api.d.ts CHANGED
@@ -49,6 +49,14 @@ export declare function createApi(nativeExecute: (request: string) => string): {
49
49
  unicode_to_tab_bytes: (text: string) => number[];
50
50
  tscii_bytes_to_unicode: (bytes: Uint8Array | number[]) => string;
51
51
  unicode_to_tscii_bytes: (text: string) => number[];
52
+ lt_tm_codes_to_unicode: (codes: Uint16Array | number[], errors?: CodecErrorPolicy) => string;
53
+ lt_tm_text_to_unicode: (text: string, errors?: CodecErrorPolicy) => string;
54
+ unicode_to_lt_tm_codes: (text: string) => number[];
55
+ unicode_to_lt_tm_text: (text: string) => string;
56
+ vanavil_codes_to_unicode: (codes: Uint16Array | number[], errors?: CodecErrorPolicy) => string;
57
+ vanavil_text_to_unicode: (text: string, errors?: CodecErrorPolicy) => string;
58
+ unicode_to_vanavil_codes: (text: string) => number[];
59
+ unicode_to_vanavil_text: (text: string) => string;
52
60
  format_fraction: (numerator: number, denominator: number, digits?: DigitStyle) => string;
53
61
  fraction_to_words: (numerator: number, denominator: number, locale?: Locale) => string;
54
62
  fraction_symbol: (numerator: number, denominator: number) => string;
package/dist/api.js CHANGED
@@ -26,6 +26,14 @@ export function createApi(nativeExecute) {
26
26
  unicode_to_tab_bytes: (text) => execute({ op: "unicode_to_tab_bytes", input: { text } }),
27
27
  tscii_bytes_to_unicode: (bytes) => execute({ op: "tscii_bytes_to_unicode", input: { bytes: Array.from(bytes) } }),
28
28
  unicode_to_tscii_bytes: (text) => execute({ op: "unicode_to_tscii_bytes", input: { text } }),
29
+ lt_tm_codes_to_unicode: (codes, errors = "strict") => execute({ op: "lt_tm_codes_to_unicode", input: { codes: Array.from(codes), errors } }),
30
+ lt_tm_text_to_unicode: (text, errors = "strict") => execute({ op: "lt_tm_text_to_unicode", input: { text, errors } }),
31
+ unicode_to_lt_tm_codes: (text) => execute({ op: "unicode_to_lt_tm_codes", input: { text } }),
32
+ unicode_to_lt_tm_text: (text) => execute({ op: "unicode_to_lt_tm_text", input: { text } }),
33
+ vanavil_codes_to_unicode: (codes, errors = "strict") => execute({ op: "vanavil_codes_to_unicode", input: { codes: Array.from(codes), errors } }),
34
+ vanavil_text_to_unicode: (text, errors = "strict") => execute({ op: "vanavil_text_to_unicode", input: { text, errors } }),
35
+ unicode_to_vanavil_codes: (text) => execute({ op: "unicode_to_vanavil_codes", input: { text } }),
36
+ unicode_to_vanavil_text: (text) => execute({ op: "unicode_to_vanavil_text", input: { text } }),
29
37
  format_fraction: (numerator, denominator, digits = "latin") => execute({ op: "format_fraction", input: { numerator, denominator, digits } }),
30
38
  fraction_to_words: (numerator, denominator, locale = "TN") => execute({ op: "fraction_to_words", input: { numerator, denominator, locale } }),
31
39
  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, 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;
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[], lt_tm_codes_to_unicode: (codes: Uint16Array | number[], errors?: import("./api.js").CodecErrorPolicy) => string, lt_tm_text_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_lt_tm_codes: (text: string) => number[], unicode_to_lt_tm_text: (text: string) => string, vanavil_codes_to_unicode: (codes: Uint16Array | number[], errors?: import("./api.js").CodecErrorPolicy) => string, vanavil_text_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_vanavil_codes: (text: string) => number[], unicode_to_vanavil_text: (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;
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, 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);
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, lt_tm_codes_to_unicode, lt_tm_text_to_unicode, unicode_to_lt_tm_codes, unicode_to_lt_tm_text, vanavil_codes_to_unicode, vanavil_text_to_unicode, unicode_to_vanavil_codes, unicode_to_vanavil_text, 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, 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;
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[], lt_tm_codes_to_unicode: (codes: Uint16Array | number[], errors?: import("./api.js").CodecErrorPolicy) => string, lt_tm_text_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_lt_tm_codes: (text: string) => number[], unicode_to_lt_tm_text: (text: string) => string, vanavil_codes_to_unicode: (codes: Uint16Array | number[], errors?: import("./api.js").CodecErrorPolicy) => string, vanavil_text_to_unicode: (text: string, errors?: import("./api.js").CodecErrorPolicy) => string, unicode_to_vanavil_codes: (text: string) => number[], unicode_to_vanavil_text: (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;
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, 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);
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, lt_tm_codes_to_unicode, lt_tm_text_to_unicode, unicode_to_lt_tm_codes, unicode_to_lt_tm_text, vanavil_codes_to_unicode, vanavil_text_to_unicode, unicode_to_vanavil_codes, unicode_to_vanavil_text, 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.2",
3
+ "version": "0.1.0-alpha.4",
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",
@@ -1,39 +1,97 @@
1
- # tamil-toolkit for TypeScript / WASM
1
+ <div align="center">
2
2
 
3
- `just sync-bindings` produces Node and browser WASM builds and TypeScript
4
- declarations. Node: `import * as tamil from 'tamil-toolkit'`. Browser:
5
- `import { init, get_letters } from 'tamil-toolkit/web'; await init();`.
6
- Install the experimental MIT-licensed alpha on npm with `npm install tamil-toolkit@alpha`.
7
- These adapters serialize calls into the shared Rust dispatcher. Planned modules
8
- are excluded. APIs may change before stability. Node 22+ is supported; browser
9
- consumers must initialize the WASM module before calling its functions.
3
+ # tamil-toolkit for JavaScript and TypeScript
4
+
5
+ **Rust-backed Tamil text tools for Node.js and browsers.**
6
+
7
+ [![npm alpha version](https://img.shields.io/npm/v/tamil-toolkit/alpha?style=flat-square&label=npm%20alpha)](https://www.npmjs.com/package/tamil-toolkit)
8
+ [![Monthly downloads](https://img.shields.io/npm/dm/tamil-toolkit?style=flat-square&label=monthly)](https://www.npmjs.com/package/tamil-toolkit)
9
+ [![CI](https://img.shields.io/github/actions/workflow/status/abishtakan/tamil-toolkit/ci.yml?branch=master&style=flat-square&label=CI)](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
10
+ [![MIT license](https://img.shields.io/github/license/abishtakan/tamil-toolkit?style=flat-square)](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 4 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.4`; 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:
10
52
 
11
53
  ```javascript
12
- import { format_fraction, format_currency } from "tamil-toolkit";
54
+ import { init, get_letters } from "tamil-toolkit/web";
13
55
 
14
- console.log(format_fraction(2, 4)); // 1/2
15
- console.log(format_currency(102550, "LKR", "SL")); // LKR 1,025.50
56
+ await init();
57
+ console.log(get_letters("தமிழ்").join(" | "));
16
58
  ```
17
59
 
18
- The package includes core Unicode/Ezhuthu functions, Agara collation, bounded
19
- TN/SL integer and currency words, fractions, Gregorian dates, and explicit
20
- Bamini and bounded TSCII, TAB, TAM and Anjal byte conversion. For browser code use the `/web` entry point, `await init()`,
21
- then call the same methods. Hosts must serve the packaged WASM file with the
22
- generated loader; bundlers must support WebAssembly assets and ES modules.
23
- See LICENSE, THIRD_PARTY_NOTICES.md, and bundled dependency license notices.
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 4 scope
64
+
65
+ The npm `0.1.0-alpha.4` 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.
24
71
 
25
- Both entry points expose `compare`, `sort_words`, `sort_key`, and `search_key`.
26
- Use the comparison result or numeric-array keys for ordering; comparing their
27
- JSON string representation is incorrect. The versioned `agara-v1` profile and
28
- its mixed-script fallback are specified at
29
- https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs/collate-v0.1.md.
72
+ Other planned linguistic modules, the private PDF extraction utility, and
73
+ Dart/Pub distribution are not published.
30
74
 
31
- This distribution provides `tscii_bytes_to_unicode(new Uint8Array([0xba, 0xa2, 0xc5, 0xfd]))`.
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
+ ```
32
81
 
33
- `unicode_to_tscii_bytes(text)` returns an array of byte values.
82
+ ## Documentation
34
83
 
35
- This distribution provides `tab_bytes_to_unicode(bytes)` and `unicode_to_tab_bytes(text)`.
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-4.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)
36
92
 
37
- This distribution provides `tam_bytes_to_unicode(bytes)` and `unicode_to_tam_bytes(text)`; TAM bytes do not preserve Latin letters.
93
+ ## License
38
94
 
39
- This distribution provides `anjal_bytes_to_unicode(bytes)` and `unicode_to_anjal_bytes(text)`; ambiguous legacy bytes raise an error.
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).
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tamil-wasm",
3
3
  "description": "Thin WASM bindings for tamil-toolkit",
4
- "version": "0.1.0-alpha.2",
4
+ "version": "0.1.0-alpha.4",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
Binary file
package/pkg-web/README.md CHANGED
@@ -1,39 +1,97 @@
1
- # tamil-toolkit for TypeScript / WASM
1
+ <div align="center">
2
2
 
3
- `just sync-bindings` produces Node and browser WASM builds and TypeScript
4
- declarations. Node: `import * as tamil from 'tamil-toolkit'`. Browser:
5
- `import { init, get_letters } from 'tamil-toolkit/web'; await init();`.
6
- Install the experimental MIT-licensed alpha on npm with `npm install tamil-toolkit@alpha`.
7
- These adapters serialize calls into the shared Rust dispatcher. Planned modules
8
- are excluded. APIs may change before stability. Node 22+ is supported; browser
9
- consumers must initialize the WASM module before calling its functions.
3
+ # tamil-toolkit for JavaScript and TypeScript
4
+
5
+ **Rust-backed Tamil text tools for Node.js and browsers.**
6
+
7
+ [![npm alpha version](https://img.shields.io/npm/v/tamil-toolkit/alpha?style=flat-square&label=npm%20alpha)](https://www.npmjs.com/package/tamil-toolkit)
8
+ [![Monthly downloads](https://img.shields.io/npm/dm/tamil-toolkit?style=flat-square&label=monthly)](https://www.npmjs.com/package/tamil-toolkit)
9
+ [![CI](https://img.shields.io/github/actions/workflow/status/abishtakan/tamil-toolkit/ci.yml?branch=master&style=flat-square&label=CI)](https://github.com/abishtakan/tamil-toolkit/actions/workflows/ci.yml)
10
+ [![MIT license](https://img.shields.io/github/license/abishtakan/tamil-toolkit?style=flat-square)](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 4 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.4`; 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:
10
52
 
11
53
  ```javascript
12
- import { format_fraction, format_currency } from "tamil-toolkit";
54
+ import { init, get_letters } from "tamil-toolkit/web";
13
55
 
14
- console.log(format_fraction(2, 4)); // 1/2
15
- console.log(format_currency(102550, "LKR", "SL")); // LKR 1,025.50
56
+ await init();
57
+ console.log(get_letters("தமிழ்").join(" | "));
16
58
  ```
17
59
 
18
- The package includes core Unicode/Ezhuthu functions, Agara collation, bounded
19
- TN/SL integer and currency words, fractions, Gregorian dates, and explicit
20
- Bamini and bounded TSCII, TAB, TAM and Anjal byte conversion. For browser code use the `/web` entry point, `await init()`,
21
- then call the same methods. Hosts must serve the packaged WASM file with the
22
- generated loader; bundlers must support WebAssembly assets and ES modules.
23
- See LICENSE, THIRD_PARTY_NOTICES.md, and bundled dependency license notices.
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 4 scope
64
+
65
+ The npm `0.1.0-alpha.4` 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.
24
71
 
25
- Both entry points expose `compare`, `sort_words`, `sort_key`, and `search_key`.
26
- Use the comparison result or numeric-array keys for ordering; comparing their
27
- JSON string representation is incorrect. The versioned `agara-v1` profile and
28
- its mixed-script fallback are specified at
29
- https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs/collate-v0.1.md.
72
+ Other planned linguistic modules, the private PDF extraction utility, and
73
+ Dart/Pub distribution are not published.
30
74
 
31
- This distribution provides `tscii_bytes_to_unicode(new Uint8Array([0xba, 0xa2, 0xc5, 0xfd]))`.
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
+ ```
32
81
 
33
- `unicode_to_tscii_bytes(text)` returns an array of byte values.
82
+ ## Documentation
34
83
 
35
- This distribution provides `tab_bytes_to_unicode(bytes)` and `unicode_to_tab_bytes(text)`.
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-4.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)
36
92
 
37
- This distribution provides `tam_bytes_to_unicode(bytes)` and `unicode_to_tam_bytes(text)`; TAM bytes do not preserve Latin letters.
93
+ ## License
38
94
 
39
- This distribution provides `anjal_bytes_to_unicode(bytes)` and `unicode_to_anjal_bytes(text)`; ambiguous legacy bytes raise an error.
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).
@@ -2,7 +2,7 @@
2
2
  "name": "tamil-wasm",
3
3
  "type": "module",
4
4
  "description": "Thin WASM bindings for tamil-toolkit",
5
- "version": "0.1.0-alpha.2",
5
+ "version": "0.1.0-alpha.4",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
Binary file