Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ime-context-core — Warabi Engine

Warabi EngineKeyNako 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).

Crates

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

Input contract (strict)

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_reading for NFKC/katakana folding, ime_lexicon::romaji_to_hiragana for the romaji table; both also exposed over FFI as reading() / romaji_to_kana())

Models & goldens

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).

Machine-local note

.cargo/config.toml (gitignored) may redirect target-dir to C: when D: is low on disk.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages