Skip to content

Rottenbff/Akshara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Akshara (অক্ষর)

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.

Features

  • 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., abdomen to অ্যাবডোমেন).
  • Linguistic Processing: Advanced handling of Bengali suffixes and phonetic edge cases.
  • Extensible API: Simplified C interface for custom frontend integrations.

Technical Design

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.

Architecture

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

Installation

To build the project from source:

git clone https://github.com/rottenbff/Akshara.git
cd Akshara
cabal build

The build process generates the dynamic library in the dist-newstyle directory.

Integration

Akshara exports a C-compatible API. For detailed implementation instructions and function signatures, refer to INTEGRATION.md.

Version History & Legacy

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

License

GNU General Public License

About

Platform-agnostic Bengali phonetic typing engine in Haskell with C FFI. Avro Phonetic 2.0 compatible, 150k+ word dictionary, cross-platform (Windows/macOS/Linux/Web). High-performance Trie-based core.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors