Developers

The engine is a library first

Everything the keyboard does, your program can do. One Rust crate, no word list inside it, and the same output on every platform.

The Rust crate

Deterministic Roman to Bangla transliteration, plus the layers above it: tokenizing, autocorrect and next-word suggestion. The default feature set is empty, so a native dependant pays for none of the browser or CLI tooling.

  • Crate

    obadh_engine 0.9.1

  • License

    MIT

  • Size

    About 390 KB compiled to WebAssembly

  • Data

    No word list and no data files in the core

Cargo.toml toml
[dependencies]
obadh_engine = "0.9.1"
Transliterating rust
use obadh_engine::ObadhEngine;

let engine = ObadhEngine::new();
let bangla = engine.transliterate("aji e probhate robir kor");

assert_eq!(bangla, "আজি  প্রভাতে রবির কর");
Reusing a buffer, for an editor rust
use obadh_engine::{ObadhEngine, PhoneticUnit};

let engine = ObadhEngine::new();
let mut units: Vec<PhoneticUnit> = Vec::new();

engine.tokenize_phonetic_into("rrkSh", &mut units);

Documentation on docs.rscrates.io

From other languages

Two optional features carry the engine out of Rust. Both are built and shipping: the iOS and macOS apps go through the C ABI, and the typing box on this site goes through the WebAssembly build.

  • Native code

    cabi

    A stable, versioned C ABI. UTF-8 buffers in, packed records out, no objects and no callbacks. This is how both Apple apps reach the engine.

  • The browser

    wasm

    wasm-bindgen bindings, exposing ObadhaWasm with transliterate and the autosuggest session methods. This is what runs the box on the writing guide.

  • A terminal

    cli

    The obadh binary. Every Bangla string on this site was generated by piping through it, which is why the site cannot disagree with the keyboard.

Nobody has started this

A JavaScript package, planned

There is no npm package today, no repository and no date.

The hard part already exists. The wasm feature compiles the engine to WebAssembly and exposes it to JavaScript, and this site has been running that build in production since it launched.

What is missing is the layer on top: a published package that wraps those bindings, loads the WebAssembly without ceremony, and binds to an ordinary text field so a web app gets Bangla input in a few lines instead of a few hundred. That is a real project and a well-scoped one, and it is open.

Say you are taking it on

The repositories

  • obadh_engine

    The Rust engine, the C ABI, the WebAssembly build and the command-line tool.

  • obadh-ios

    The iPhone and iPad keyboard, in Swift.

  • obadh-macos

    The Mac input method, through InputMethodKit.