A transliteration library for Indic/Brahmic and Latin scripts, implemented as a C++23 engine compiled to a shared library (native) and WASM (Web/Node.js). The same phoneme-level pipeline is exposed to Flutter/Dart and JavaScript/TypeScript.
- No server required. FFI (native) or WASM (Web/Node.js) for near-native performance.
- ITRANS toggle transliteration — wrap any region in
##…##to pass it through unchanged. - XML/HTML tag pass-through — tags are never transliterated.
- Special handling for Tamil, Malayalam, Gurmukhi, and other scripts tuned for readability.
- Vedic accent support for Vedic scriptures.
Indic/Brahmic: Assamese, Bengali, Burmese, Devanagari, Gujarati, Gurmukhi, Kannada, Khmer, Malayalam, Oriya, Sinhala, Tamil, Tamil-Extended, Telugu, Thai, Tibetan
Standard Latin notations: IAST · IPA · ISO 15919 · ITRANS · TITUS · Harvard-Kyoto · Velthuis · SLP1 · WX
Custom Latin notations: ReadableLatin
inditrans implements uniform phonemic vowel mapping adhering to the ITRANS specification:
-
Short vowels:
eandoencode short vowels across all scripts (e.g. Kannadaಎ/ೆ, Teluguఎ/ె, Tamilஎ/ெ, Malayalamഎ/െ, Devanagariऎ/ॆ). The legacy markers^eand^oremain supported as aliases foreando. -
Long vowels:
EandOencode long vowels (e.g. Kannadaಏ/ೇ, Teluguఏ/ే, Tamilஏ/ே, Malayalamഏ/േ, Devanagariए/े).eeandooalso continue to represent long vowels where standard. -
Examples:
-
te$\to$ तॆ/ತೆ(short e);tE$\to$ ते/ತೇ(long e) -
to$\to$ तॊ/ತೊ(short o);tO$\to$ तो/ತೋ(long o) -
tere bina$\to$ ತೆರೆ ಬಿನ(Kannada),तॆरॆ बिन(Devanagari) -
tErE bina$\to$ ತೇರೇ ಬಿನ(Kannada),तेरे बिन(Devanagari)
-
| Platform | Package | Install |
|---|---|---|
| Flutter / Dart | pub.dev/packages/inditrans | flutter pub add inditrans |
| Node.js / Browser | npmjs.com/@vm75/inditrans | npm install @vm75/inditrans |
flutter/ Flutter FFI plugin (Dart + C++ shared library + WASM)
nodejs/ TypeScript/JavaScript package (WASM via Emscripten)
js/ WASM build output consumed by nodejs/
native/ Canonical C++23 engine (source, tests, CLI, and benchmarks)
tool/ Code-generation utilities (script data, bindings, version bump)
test-files/ Shared test-case JSON used by all distributions
make all # build native CLI, WASM, and Flutter plugin
make test # run C++ native tests
make testall # run native, Flutter, and Node.js tests
make bench-all # run the native benchmark summary
make dll # cross-compile Windows x86-64 DLL using MinGW-w64
make validate # validate version consistency and changelogRequires: CMake ≥ 3.20, Clang/LLVM ≥ 17 (or C++23-capable compiler), Emscripten 6.0.10, Flutter ≥ 3.38.10 / Dart ≥ 3.10.8, Node.js ≥ 18.3 / Yarn.
See platform support for the declared platform matrix, tested toolchains, and current acceptance evidence.
The native benchmark suite measures throughput (MB/s and ns/call), per-call latency, output-size expansion, and—on Linux with glibc—heap allocation events, requested allocation bytes, peak requested live bytes, and bytes still live after the measured call.
make bench-all # run all available benchmarks and print a formatted summary
make bench # throughput benchmark (10 cases × 3 approximate target sizes)
make bench-short # per-call latency benchmark, including result destruction
make output-size-bench # report input/output bytes and expansion ratio
make mem-bench # backward-compatible alias for output-size-bench
make bench-alloc-linux # Linux/glibc allocation probeThe allocator probe is optional. bench-all, bench-save, and bench-compare still run on other platforms and skip allocation metrics instead of failing during setup.
To compare an optimization against a saved baseline:
make bench-save # capture baseline metrics before making changes
# ... make changes ...
make bench-compare # report changes; always fails on output-hash mismatch
BENCH_STRICT=1 make bench-compare # also fail on regressions at or above the thresholdbench-compare validates the FNV-1a output hash for every throughput and short-call case before treating timing changes as meaningful. Performance regressions are flagged at 5% by default; override the threshold with BENCH_REGRESSION_THRESHOLD=<percent>.
To cross-compile the 64-bit Windows shared library (inditrans.dll) from Linux:
sudo apt-get install mingw-w64 cmake
make dll- Target: Windows x86-64 (
inditrans.dll), copied toflutter/example.dart/inditrans.dll. - Toolchain: Cross-compiled using MinGW-w64 (
x86_64-w64-mingw32-g++) with CMake toolchaintool/cmake/mingw64.cmake. - Language standard: Enforces C++23 internally (GCC ≥ 13).
- Public ABI: Plain C interface (
extern "C") exposingtransliterate,isScriptSupported, andreleaseBuffer. No C++ types (std::string, STL containers, exceptions) cross the boundary, ensuring full compatibility with MSVC callers, Dart FFI, and other runtimes. - Runtime dependencies: Linked with
-static-libgcc -static-libstdc++to eliminate MinGW C++ runtime DLL dependencies (libstdc++-6.dll,libgcc_s_seh-1.dll).