# Gomanize Hindi JavaScript adaptation and data

## Implementation code — MIT

Gomanize 1.2.1, Copyright (c) 2023-2026 Budhaditya
(budhash@gmail.com).

Original source revision:
[3e519d5cfb689c2444545396e4cfab24d3a2d84a](https://github.com/budhash/gomanize/tree/3e519d5cfb689c2444545396e4cfab24d3a2d84a).
Full original license: [LICENSE-MIT.txt](LICENSE-MIT.txt).

`symbols.js` and `hindi-engine.js` are JavaScript adaptations made directly
from the original MIT Go implementation: `lang/hindi/symbols.go`, `rules.go`,
`schwa_model.go`, `lexicon.go`, `reranker.go`; `script/brahmic/parser.go`,
`runs.go`, `schwa_rules.go`, `renderer.go`; and the ordering/candidate-selection
logic in `core/engine.go` and `core/rule.go`.

Local adaptations (2026-11-17): static ES modules; a fixed Hindi profile with
lexicon lookup and default/learned-schwa candidate ranking; JavaScript maps and
arrays in place of Go structures; bounded JSON-tree validation; and NFC/format
character normalization before lookup. The scorer retains upstream UTF-8 byte
windows and first-candidate tie behavior. Other upstream style switches and
debug/rule-management APIs are not exposed. No upstream authorship is claimed
for these adaptations. No WASM, Go runtime, or FluentRead source is included.

The local optional gg rendering of ज्ञ is applied after dictionary lookup
or candidate selection. It retains the inherent vowel between gg and a
following consonant unless the spelling uses a virama.

## Hindi data — CC BY-SA 4.0

The following files are unmodified copies from the same Gomanize revision.
Their separate data license is
[Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/).
Full license text: [LICENSE-CC-BY-SA-4.0.txt](LICENSE-CC-BY-SA-4.0.txt).
These data and any adaptations of them retain that license; the MIT code
license and AynAyn's license do not replace it.

| File | Bytes | Upstream transformation |
| --- | ---: | --- |
| `data/lexicon.tsv` | 208,827 | High-attestation Hindi training spellings from Dakshina; Shabd frequencies for ranking; TSV serialization. |
| `data/schwa_tree.json` | 34,463 | Decision tree learned from aligned schwa positions in Dakshina Hindi training data. |
| `data/roman_ngrams.tsv` | 228,964 | Character n-gram counts from Dakshina Hindi training romanizations. |

Original dataset: [Google Dakshina](https://github.com/google-research-datasets/dakshina),
by Brian Roark, Lawrence Wolf-Sonkin, Christo Kirov, Sabrina J. Mielke,
Cibu Johny, Işın Demirşahin, and Keith Hall (2020),
[Processing South Asian Languages Written in the Latin Script: the Dakshina Dataset](https://aclanthology.org/2020.lrec-1.294/),
LREC 2020, pp. 2413–2423. Dakshina is distributed under CC BY-SA 4.0.

Frequency source: [Shabd psycholinguistic database](https://osf.io/xfbhd/),
[CC0](https://creativecommons.org/publicdomain/zero/1.0/), credited for
transparency. See upstream
[research and data preparation](https://github.com/budhash/gomanize/blob/3e519d5cfb689c2444545396e4cfab24d3a2d84a/docs/RESEARCH.md).
These credits do not imply endorsement by any author or data contributor.

### Imported data checksums (SHA-256)

```text
6fc9955ed159d1237ae28efec2ce762bca44dd50c964f307944fb8d8a27aa517  data/lexicon.tsv
29d9e05cde8aa5cb44ce79810479cf7df8b86baafcf27fa95a8f8d10fe052d16  data/roman_ngrams.tsv
d071eeb37f1abdb4461e5fb5379ca47d8e4120865a11c8cb6a3716396a1334ff  data/schwa_tree.json
```

All three data files are stored uncompressed and bundled locally. No text or
data needs to be sent to an external service for Hindi reading.
