Romenagri Transliteration System

A formal specification of the Unicode Devanagari ↔ ACII ↔ Romenagri pipeline, with Sanskrit and Vedic extensions and the nukta layer.

Documents

What goes with the converters: the specification, the three patches, the tests, a notebook that runs the C programs, and the licence. This site describes Romenagri/ of the hindawiai/chintamani repository as it was at commit 3ad87785a75dc2b18438a8b068807103cb920c81, plus the patches below.

The specification

Romenagri/TRANSLITERATION.md is the formal definition, 1,834 lines long. The recursive-descent parser, which is the hard part, is written down in it as a grammar that a program reads and runs, and a test holds the C parser to it. Its sections:

Statements in it are of three kinds: defined (the tables, generated from the headers, and the grammar), observed (a behaviour that was measured, with the test named next to it) and cited (a fact about an outside standard, with its source).

The patches

FileWhat it does
patches/0001-add-missing-sanskrit-characters.patchthe twelve missing Sanskrit and Vedic characters (ACII bytes 81-8C)
patches/0002-apply-underscore-guards.patchthe twelve guards of the parser against underscores
patches/0003-add-nukta-layer.patchthe nukta layer of the two Unicode converters: the rule, the forms, the warning

They apply in order to a clean Romenagri/ (patch -p1 < patches/0001-..., run in the directory that holds Romenagri/), and each has a script in tools/ that repeats its edits to the code.

The tests

tests/run_all.sh builds three trees (the unpatched one, one with patch 0001, one with all three) and runs every check against them: the table lint, the Unicode conversions, the nukta layer, the saral table, the parser against the grammar and against a hand-written parser on more than a million strings, the round trip, the corpus, the extension recipes, the limitations, the laws of the underscore, the reserved keys, the tables of the specification and an end-to-end build of Hindi programs. The exhaustive run is long, so it can be run in pieces, with --full --resume --only.

tests/run_all.sh                          the quick run
tests/run_all.sh --full --resume          the exhaustive run, restartable
python3 tools/check_tables.py Romenagri   the lint of the three tables
python3 tools/gen_doc_tables.py --check Romenagri    fail if a table of the specification is out of date

The runs that were recorded for this package are in results/, with the environment they ran in.

The notebook

romenagri-explainer.ipynb runs the compiled C programs on Devanagari text and shows what each stage writes: the four stages on one word, the eleven nukta letters in three forms, the other direction, the cases C1 to C8, the warning layer and the ways of choosing the form. Nothing in it is a model. It needs Python 3, gcc, make and flex; the first cell compiles a copy of Romenagri/ in a temporary directory, or you can set ROMENAGRI_BIN to a directory of built programs. The outputs stored in it are those of the build of this site. The same file is in romenagri-site/notebooks/ of the package.

This site

The pages, the notebook and romenagri.js are generated by romenagri-site/build_site.py from the headers of Romenagri/ and from runs of the compiled programs, and --check compares the JavaScript with them.

python3 romenagri-site/build_site.py            writes docs/ and notebooks/
python3 romenagri-site/build_site.py --check    builds in memory and compares with the files, then compares the JavaScript
                                                with the compiled C programs and with the Python models of tests/

It needs python3, gcc, make and flex (with -lfl); --check needs node. --cbin DIR uses the programs of a directory that is already built.

To publish it on GitHub Pages: copy the contents of romenagri-site/docs/ into a folder named docs/ at the root of the repository that is to host it, commit, and in the repository's settings, under Pages, choose “Deploy from a branch”, the branch and the /docs folder. The empty file .nojekyll tells Pages to serve the files as they are.

Sources

Licence

Copyright © 1993-2026 Abhishek Choudhary. The code of Romenagri/ is free software under the GNU General Public License, version 2 or (at your option) any later version; the text is in the files COPYING and LICENSE of the package, and NOTICE lists what each part is and where it comes from. The new files, these pages and the scripts that build them carry SPDX-License-Identifier: GPL-2.0-or-later. The corp_* text files of Romenagri/ come from Wikipedia and keep the terms of the original articles.