ko·to·shu 言修 n.
The fixing and embellishing of words.
Kotoshu checks spelling and grammar in the terminal, the editor, and CI. The engine is pure Ruby, and the checker detects the language of the text before it resolves the dictionary and the language model that the text needs; it downloads nothing without an explicit setup action.
Client + wasm engine
npm install @kotoshu/client @kotoshu/wasm実演See it work
The checker surfaces misspellings and offers a fix in place
The demo runs the same engine that the editor extension and the CLI run against a full installation.
Click a wavy word to see ranked suggestions, then a chip to apply the fix.
The playground runs this engine in the browser, and it can connect to a self-hosted server instead.
訂正Grammar models
Grammar correction for 16 languages, measured on held-out benchmarks
Each language ships one fp16 ONNX artifact, decoded from the shipped file and scored on the fixed held-out benchmark that its earlier weights measured on. The scorecard records both numbers, so every comparison names its data.
0.5458
English · CoNLL-14
official M² scorer — 3.4× LanguageTool
0.9803
French · held-out
strict span scorer, fp16 weights
0.5558
Korean · held-out
recall 2.3× its earlier weights
0.8035
Italian · held-out
the largest gain: +115% on the same benchmark
The full scorecard — protocols, artifacts, and platform verification →
使う人Who it serves
One engine serves five audiences
Five audiences start from five entry points, which range from a Ruby API to a one-line GitHub Action.
Ruby developers
The checker behaves like the Ruby library that it is
gem install kotoshu
文Writers & editors
The editor shows the correction, and one keystroke applies it
gem install kotoshu-lsp
検Maintainers & CI
The CI check fails the build with an actionable report
uses: kotoshu/action-kotoshu@v2
橋Non-Ruby teams
One HTTP service serves every language ecosystem
gem install kotoshu-server # or docker run ghcr.io/kotoshu/ci
言葉Multilingual writers
The checker resolves the language of each text on demand
gem install kotoshu
生態系The ecosystem
The gem sits at the center of the ecosystem
Every other surface is a thin adapter over the same engine, so the checking logic exists in one place.
kotoshu
liveThe core spell checker
Pure-Ruby, Hunspell-compatible spell checking with affix morphology, frequency-ranked suggestions, and an optional FastText/ONNX semantic layer. Two-stage resources: explicit setup, cache-only hot path.
kotoshu-lsp
liveLanguage Server Protocol server
Inline squiggles, quick-fixes, and hover suggestions in every LSP-capable editor — VS Code, Neovim, Emacs (lsp-mode / eglot), JetBrains, Helix, Zed. Diagnostics carry ranked suggestions as code actions.
kotoshu-server
liveSelf-hostable HTTP API
A Sinatra/Puma service exposing /v1/check, /v1/suggest, /v1/detect over JSON, with an OpenAPI 3.1 spec and a Docker image. The deployment surface for every non-Ruby SDK.
action-kotoshu
liveGitHub Action
One line to spell-check a repo in CI: caches dictionaries between runs, runs kotoshu check, uploads SARIF to the GitHub Security tab. Tagged v1.
言葉Language support
36 languages are fully featured, and 98 more have dictionaries staged
A fully featured language carries spelling with affixes, semantic reranking, and keyboard-aware suggestions; frequency ranking accompanies the languages for which Kelly data exists.
see also zh — frequency tiers only
36
full feature
98
dictionaries staged
176
auto-detected
思想Principles
How Kotoshu is built
Pure Ruby
No shelling out to hunspell or aspell. The only native dependency is the optional onnxruntime — everything else is Ruby that ships in the gem.
Two-stage resources
Setup is explicit and downloads once; the hot path is cache-only and raises instead of ever touching the network. Metered and air-gapped hosts are safe.
Semantic when you want it
FastText embeddings via ONNX rerank candidates by context and rescue out-of-vocabulary words. Install onnxruntime to enable; everything works without it.
Every language, on demand
Given any text, Kotoshu detects the language and resolves the dictionary, frequency list, and model it needs — cached, verified, with TTLs.