Skip to content

nepalibhasha/varnavinyas

Varnavinyas

CI

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.

Contents

  • Quickstart
  • Web app
  • Architecture
  • Documentation
  • Contributing

Quickstart

This quickstart will show you how to:

  • build the Rust workspace
  • run the command-line checker
  • run the test suite

Building Varnavinyas

Install Rust 1.85.0 or newer, then build the workspace:

git clone https://github.com/nepalibhasha/varnavinyas.git
cd varnavinyas
cargo build --workspace

The first build may take a little while because the workspace includes the checker engine, CLI, LSP server, and several binding crates.

Running the checker

You can check a file:

cargo run -p varnavinyas -- check path/to/document.txt

Or pipe text directly into the checker:

printf "राजनैतिक गल्ति छ.\n" | cargo run -q -p varnavinyas -- check - --explain

Use JSON output when integrating with scripts or other tools:

cargo run -p varnavinyas -- check path/to/document.txt --format json

The CLI also includes small utility commands:

cargo run -p varnavinyas -- akshar "शब्द"
cargo run -p varnavinyas -- lipi "नेपाल" --to IAST

Running tests

Run the main test suite:

cargo test --workspace -q

Before opening a pull request, also run formatting and clippy:

cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings

Web app

The 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.sh

See web/README.md for more detail.

Architecture

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 metadata
  • crates/prakriya: token-level orthography engine
  • crates/parikshak: end-to-end text checker
  • crates/lekhya: punctuation diagnostics
  • crates/cli: command-line interface
  • crates/lsp: language server
  • crates/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.

Documentation

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.

Contributing

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.

License

Varnavinyas is dual-licensed under MIT or Apache-2.0.

About

वर्णविन्यास — Open-source Nepali orthography toolkit based on Nepal Academy standards. Spell checking, sandhi analysis, punctuation diagnostics, and more.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors