Warabi Engine は KeyNako IME の変換エンジンです。 ひらがなを受け取って、漢字(変換候補)を返す。 それがこのコアの契約です。
Cross-platform Japanese IME core (Rust workspace): given a hiragana reading and the committed context, it returns ranked conversion candidates. Input methods (flick, romaji, kana keyboards) live upstream in platform frontends; OS integration (TSF, fcitx5, InputMethodService, iOS keyboard) lives downstream in platform shells. Targets Windows, Linux, Android, iOS; inference via Burn (wgpu Vulkan/DX12/Metal planned, CPU fallback implemented).
| crate | contents |
|---|---|
ime-lexicon |
Lexicon trait + SQLite packs, reading normalization, romaji table (composer building block) |
ime-scoring |
algorithmic cost model |
ime-lattice |
lazy k-best candidate generation (byte-parity with the Python reference) |
ime-tokenizer |
character tokenizer for the reranker ([CLS] context [SEP] reading [SEP] candidate [SEP]) |
ime-reranker |
Reranker trait + Burn cross-encoder (--features burn-cpu); parity gate at load |
ime-core |
engine, sessions, AI+dictionary score fusion |
ime-ffi |
UniFFI (Kotlin/Swift/Python) + extern "C" surface (--features c-api) |
ime-cli |
dev binary: normalize / lexicon-dump / convert-dump |
The engine takes a normalized hiragana reading and performs no silent folding — an unnormalized input simply finds no candidates, so frontend bugs surface immediately. Normalization is the frontend's responsibility:
- flick / kana keyboards produce hiragana natively — pass through
- desktop romaji composers use the exported helpers
(
ime_lexicon::normalize_readingfor NFKC/katakana folding,ime_lexicon::romaji_to_hiraganafor the romaji table; both also exposed over FFI asreading()/romaji_to_kana())
Trained/exported models and golden fixtures are produced by the sibling
ime-context-tools (Python) checkout, which depends on this repo's layout:
parity tests read tests/fixtures/ here and exported models from
../ime-context-tools/artifacts/ (override with IME_RERANKER_DIR).
.cargo/config.toml (gitignored) may redirect target-dir to C: when D: is
low on disk.