A platform-agnostic phonetic typing engine for Bengali.
Akshara is a next-generation phonetic typing engine designed for high performance and portability. Built with Haskell, it follows the Unix philosophy of providing a specialized, high-quality core that can be integrated into diverse environments.
Unlike traditional Input Method Editors (IMEs) that are coupled to specific operating systems, Akshara operates as a portable library. It exposes a robust C-compatible Foreign Function Interface (FFI), enabling integration with Windows System Tray applications, macOS Input Methods, Linux Wayland compositors, and Web Extensions.
- Universal Core: A native library available as a dynamic link library (DLL) or shared object (SO).
- Avro Phonetic 2.0 Compatibility: High-fidelity implementation of the Avro Phonetic scheme with improved throughput.
- Intelligent Dictionary: Built-in support for a comprehensive dictionary of over 150,000 words.
- Automated Correction: Context-aware typographical correction (e.g.,
abdomentoঅ্যাবডোমেন). - Linguistic Processing: Advanced handling of Bengali suffixes and phonetic edge cases.
- Extensible API: Simplified C interface for custom frontend integrations.
Akshara is optimized for low-latency, real-time text processing:
-
Trie-based Engine: Phonetic pattern matching and dictionary lookups utilize an optimized Prefix Tree (Trie), ensuring
$O(L)$ complexity for candidate generation. - Efficient Validation: Word validation is performed using high-speed Set structures, providing constant-time or logarithmic-time verification regardless of dictionary size.
- Incremental Parsing: The engine supports incremental re-parsing of text buffers, minimizing re-computation during active typing.
- Resilient FFI: The C interface includes robust error handling to manage IO failures and resource constraints gracefully.
Akshara follows a modular architecture separating the core logic ("The Brain") from the presentation layer ("The Body").
- Akshara Core: Implemented in Haskell. Manages keystroke state, dictionary traversal, and phonetic rule application.
- Frontend Integration: Frontends can be implemented in any language supporting C interop (e.g., C++, Rust, Swift, or JavaScript).
To build the project from source:
git clone https://github.com/rottenbff/Akshara.git
cd Akshara
cabal buildThe build process generates the dynamic library in the dist-newstyle directory.
Akshara exports a C-compatible API. For detailed implementation instructions and function signatures, refer to INTEGRATION.md.
- Project Inception: 2021
- Migration Date: January 2026
This project has been in active development since 2021. For the first 4 years, the source code was managed and hosted on a local home server using Clay (a custom VCS I built). The GitHub commit history represents the migration snapshot and recent development.
GNU General Public License