← all repositories
bminixhofer/nlprule

Grammar checking without the JVM tax

A Rust port of LanguageTool's rule engine that runs lean enough for browsers and background tasks.

662 stars Rust Other AILanguage Models
nlprule
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does nlprule is a Rust rewrite of LanguageTool’s grammar and text correction engine. It checks English, German, and Spanish for grammatical errors, does tokenization, POS tagging, lemmatization, and chunking — all without touching Java or a heavy ML model.

The interesting bit The project piggybacks on LanguageTool’s meticulously hand-crafted rule sets (thousands of them) but reimplements the execution engine in pure Rust. The payoff: roughly 1.7–2.8x faster than LanguageTool on the same rules, with an eye toward WebAssembly and embedded use. It’s grammar by committee, speed by compiler.

Key highlights

  • ~3,700 English grammar rules, ~3,000 German, with 100% of disambiguation rules ported
  • Static binary embedding via nlprule-build — compile the rules into your binary, no runtime file juggling
  • Python bindings available on PyPI for quick scripting
  • Spellchecking marked as “in progress”
  • Already integrated into cargo-spellcheck and a VSCode language server (prosemd)

Caveats

  • Spanish support is experimental and not fully tested
  • Spellchecking is incomplete; the README calls it “in progress”
  • The binary data files are LGPLv2.1-derived, which adds a licensing footnote even though the Rust code itself is MIT/Apache-2.0

Verdict Grab this if you need fast, offline grammar correction in Rust, Python, or WASM — especially as preprocessing for heavier NLP pipelines. Skip it if you need mature spellchecking or a fully-baked Spanish implementation today.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.