tamil-language-tools-and-assets
v2.0.0
Published
Tamil ASCII font to Unicode and reverse regex mappings
Maintainers
Readme
Tamil Language Tools and Assets
Regular expression mappings and helper functions for converting between legacy Tamil ASCII encodings and Unicode Tamil.
This package is published as ESM and currently exposes four main runtime exports:
applyMapping: a generic utility for applying any mapping tableregExpList: all regex mapping tablesavailableRegExp: the list of available mapping namesregExpHelper: helper functions grouped by font/direction
Install
npm install tamil-language-tools-and-assetsExports
applyMapping
applyMapping applies a mapping table to a string in sequence.
import { applyMapping, regExpList } from "tamil-language-tools-and-assets";
const converted = applyMapping("fp fh f", regExpList.Bamini);
console.log(converted);regExpList
regExpList is an object whose keys are mapping names such as Bamini, Anjal, UniBamini, and UniTscii.
import { regExpList } from "tamil-language-tools-and-assets";
const bamini = regExpList.Bamini;
const unicodeToBamini = regExpList.UniBamini;Forward mappings use names like Bamini or Anjal. Reverse mappings use Uni* names when available.
availableRegExp
availableRegExp contains all supported mapping names.
import { availableRegExp } from "tamil-language-tools-and-assets";
console.log(availableRegExp);regExpHelper
regExpHelper exposes ready-to-use conversion helpers such as BaminiToUnicode and UnicodeToBamini.
These helpers are generated from regExpList, so the mapping tables and helper behavior stay in sync.
import { regExpHelper } from "tamil-language-tools-and-assets";
const converted = regExpHelper.BaminiToUnicode("fp fh f");
console.log(converted);Usage
Use a mapping table directly
import { applyMapping, regExpList } from "tamil-language-tools-and-assets";
console.log(applyMapping("fp fh f", regExpList.Bamini));Use a helper function
import { regExpHelper } from "tamil-language-tools-and-assets";
console.log(regExpHelper.BaminiToUnicode("fp fh f"));
console.log(regExpHelper.UnicodeToBamini("தமிழ்"));Available Mappings
The package includes forward mappings for:
AnjalAnjal1BaminiBoomiDinakaranDinamaniIndowebKeymanKoelnLibiMurasoliMylaiNakkeeeranOldvikatanRomanSenthamizhTabTamThanthyTsciiWebulagam
Reverse mappings are currently available for:
UniBaminiUniKeymanUniTabUniTscii
Types
The main exported types are:
export type RegExpMapping = [RegExp | string, string][];
export type RegExpListType = {
[key: string]: [RegExp | string, string][];
};
export type RegExpHelperType = {
[helperName: string]: (text: string) => string;
};Development
This repo uses a single TypeScript config and builds ESM output into dist.
The published build includes JavaScript and declaration files, without source maps or declaration maps.
npm run buildRun the API-level test suite with:
bun testRun the Bun-native TypeScript tests explicitly with:
npm run test:bunRun the Node-based built-output tests with:
npm testOr directly:
npm run test:nodeTests also run automatically in GitHub Actions on pushes to main and on pull requests.
Releases
This repo uses Changesets for controlled version PRs.
To add a release note entry for a change:
npm run changesetWhen changesets land on main, GitHub Actions opens or updates a Version Packages PR with the version bump. Merging that PR updates version files in git, and publishing can still happen separately through the npm publish workflow.
License
Licensed under the GNU Affero General Public License v3.0. See LICENSE.
