Nepali orthography tooling based on Nepal Academy standards.
Varnavinyas checks Nepali text for spelling, punctuation, and writing-convention issues. It turns the Academy's written rules into portable software for editors, websites, scripts, and language tooling.
This repository contains the core Rust engine, a browser UI, a CLI, editor support, and bindings for other platforms. This README will show you how to build the project, run the checker, and find the deeper implementation notes.
- Quickstart
- Web app
- Architecture
- Documentation
- Contributing
This quickstart will show you how to:
- build the Rust workspace
- run the command-line checker
- run the test suite
Install Rust 1.85.0 or newer, then build the workspace:
git clone https://github.com/nepalibhasha/varnavinyas.git
cd varnavinyas
cargo build --workspaceThe first build may take a little while because the workspace includes the checker engine, CLI, LSP server, and several binding crates.
You can check a file:
cargo run -p varnavinyas -- check path/to/document.txtOr pipe text directly into the checker:
printf "राजनैतिक गल्ति छ.\n" | cargo run -q -p varnavinyas -- check - --explainUse JSON output when integrating with scripts or other tools:
cargo run -p varnavinyas -- check path/to/document.txt --format jsonThe CLI also includes small utility commands:
cargo run -p varnavinyas -- akshar "शब्द"
cargo run -p varnavinyas -- lipi "नेपाल" --to IASTRun the main test suite:
cargo test --workspace -qBefore opening a pull request, also run formatting and clippy:
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warningsThe browser app includes a text checker, word inspector, and rules reference. If you just want to try Varnavinyas, use the hosted app linked from the repository homepage.
To build and serve the web app locally:
bash web/build.sh
python3 -m http.server 8080 --directory web/Then open http://localhost:8080.
The web build uses wasm-pack and wasm-bindgen-cli. If the installed wasm-bindgen-cli version does not match the generated package, web/build.sh prints the exact version to install.
For a static consistency check of the web app and WASM bundle, run:
bash web/smoke-test.shSee web/README.md for more detail.
The core flow is intentionally small:
kosha lexicon lookup and word metadata
prakriya token-level correction and rule tracing
parikshak full-text diagnostics with spans and categories
surfaces CLI, LSP, web UI, and platform bindings
The most important crates are:
crates/kosha: FST-backed lexicon and headword metadatacrates/prakriya: token-level orthography enginecrates/parikshak: end-to-end text checkercrates/lekhya: punctuation diagnosticscrates/cli: command-line interfacecrates/lsp: language servercrates/bindings-*: Python, WebAssembly, C, and UniFFI bindings
For the full design, read docs/ARCHITECTURE.md. The two most useful crate-level guides are crates/prakriya/ARCHITECTURE.md and crates/parikshak/ARCHITECTURE.md.
The docs folder covers architecture, development, rule policy, datasets, and current backlog. Rule implementation details live near the code: start with crates/prakriya for token-level corrections, crates/parikshak for text-level diagnostics, and crates/bindings-wasm for browser/JavaScript exports.
The Academy references used for rule alignment are kept in docs/Notices-pages-77-99.md and docs/PS-Saisanik-Vyakaran-Varnavinyas-Page-327-349.md.
Both linguistic reports and code contributions are welcome. Good issue reports with examples, expected corrections, and source citations are especially useful.
For the contribution process, see .github/CONTRIBUTING.md. For support, security, and community expectations, see .github/SUPPORT.md, .github/SECURITY.md, and .github/CODE_OF_CONDUCT.md.
Varnavinyas is dual-licensed under MIT or Apache-2.0.