@goliapkg/wubi (WASM)
Browser / Node bindings for inputx-wubi — a
self-developed Wubi 86 (五笔字型) encoder + dictionary with built-in
L0 / L1+ ranking and per-user auto-learning. Pre-built into a ~3 MB
WebAssembly module (135K-entry dictionary embedded).
The web surface of the Inputx IME.
License: MIT OR Apache-2.0.
Install
Usage
import init from "@goliapkg/wubi";
await ; // load + instantiate the .wasm
const eng = ; // ~µs, header-parse only
// L0/L1-ranked lookup
console.log; // ["中国", "跑车", "跨国", ...]
console.log; // ["学"]
// Prefix lookup — for IME predictive candidates
const hits = eng.;
hits..;
// User picks a candidate → dict learns. After 3 picks of the same
// (code, word) the dict auto-pins it to L0.
eng.;
// Layer prefs (advanced; default Auto = 0.7, others = 1.0)
eng.;
// Persistence — caller chooses storage
const state = eng.;
localStorage.;
// later:
eng.;
What ships
wubi_wasm_bg.wasm— packed FST + ranking + L0 logic (~3 MB)wubi_wasm.js— ES-module wrapperwubi_wasm.d.ts— TypeScript types- 135,822 dictionary entries (字根 / 简码 / phrases / auto-decomposed CJK)
Build from source
# output in core/crates/inputx-wubi-wasm/pkg/
For Node-target bundles: wasm-pack build --target nodejs.
See also
- Native Rust crate:
inputx-wubi - Parent IME repo: Inputx
- Sibling pinyin engine:
@goliapkg/pinyin