Bamboo Core (Rust)
A high-performance Vietnamese input method engine (IME) core written in Rust, inherited and optimized from the original bamboo-core in Go.
🚀 Version 0.3.2: The DFA Revolution
This version introduces a major architectural overhaul inspired by Deterministic Finite Automata (DFA) and high-performance engines like uvie-rs.
- Lazy JIT DFA Engine: 20x performance improvement (~490µs -> ~25µs per processing cycle).
- Zero-Allocation Core: Optimized transformation generation using stack buffers.
- Fast O(N) Validation: Improved spelling and syllable validation algorithm.
- Hybrid Architecture: Combines the flexibility of a rule engine with the speed of static lookups.
💡 Origin & Philosophy
This project is a high-performance Rust port of the Bamboo Vietnamese engine, originally developed by Luong Thanh Lam.
Bamboo aims to provide a flexible Vietnamese typing solution based on rule-based transformations rather than hardcoded logic. This approach allows the engine to easily adapt to various typing styles and support modern features like free-style typing and intelligent spell checking.
The core philosophy is inspired by:
- bogo.js: A pioneering project by Trung Ngo, introducing the transformation model.
- GoTiengViet: A classic engine by Tran Ky Nam, the gold standard for accuracy and user experience.
- NexusKey: Optimization techniques from Mai Thanh Phát.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.3.2"
🛠️ Quick Start
use ;
🧩 Delta API for IMEs
Efficiently update your IME buffer using the Delta API:
let = engine.process_key_delta;
// Result: backspaces = 1 (delete 'a'), inserted = "á"
👥 Credits
- Rust Port & Optimization: Dao Trong Nguyen (@nguyen10t2)
- Original Author (Go): Luong Thanh Lam (@lamtq)
- Technical Consultant: Mai Thanh Phát (@phatMT97) - Author of NexusKey.
📜 License
This project is licensed under the MIT License. See LICENSE for details.