nepalibhasha/varnavinyas
About
वर्णविन्यास — Nepali orthography toolkit. Spell checking, sandhi analysis, punctuation diagnostics, and more.
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalVarnavinyas
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
By default the checker uses Academy-strict orthography. To treat reviewed
common forms such as संघीय, संसद, and कांग्रेस as editorial variants
rather than hard errors, pass:
cargo run -p varnavinyas -- check path/to/document.txt --orthography-mode common-editorial
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 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.
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.
Explore related projects
Loading…