Skip to content

feat: add Khipro compositional input method#49

Open
qomarhsn wants to merge 1 commit into
OpenBangla:masterfrom
qomarhsn:feature/khipro-compositional
Open

feat: add Khipro compositional input method#49
qomarhsn wants to merge 1 commit into
OpenBangla:masterfrom
qomarhsn:feature/khipro-compositional

Conversation

@qomarhsn

Copy link
Copy Markdown

Introduce a third input-method category alongside phonetic and fixed: "compositional", which turns a roman key sequence into Bengali through a deterministic engine. Khipro is the first such layout, driven by an embedded m17n .mim spec.

  • src/compositional/: CompositionalEngine trait, Method impl (tape replay
    • backspace), and a pure-Rust port of the khipro library's s-expression parser, spec AST, and FSM interpreter (mim/).
  • config: add LayoutMethod + compositional_suggestion setting; recognize the built-in "khipro" layout name.
  • context: dispatch to CompositionalMethod via layout_method().
  • ffi: riti_config_set_compositional_suggestion (+ riti.h declaration).

The first candidate is the exact Khipro composition; dictionary/emoji suggestions follow, as with the fixed method. The candidate-window auxiliary text shows the raw roman keystrokes.

Vendored data (data/khipro/), MIT licensed:

  • bn-khipro.mim (c) 2024 rank_coder - embedded at runtime
  • khipro-testcases.csv - used only by the #[cfg(test)] conformance test

Introduce a third input-method category alongside phonetic and fixed:
"compositional", which turns a roman key sequence into Bengali through a
deterministic engine. Khipro is the first such layout, driven by an
embedded m17n `.mim` spec.

- src/compositional/: CompositionalEngine trait, Method impl (tape replay
  + backspace), and a pure-Rust port of the khipro library's s-expression
  parser, spec AST, and FSM interpreter (mim/).
- config: add LayoutMethod + compositional_suggestion setting; recognize
  the built-in "khipro" layout name.
- context: dispatch to CompositionalMethod via layout_method().
- ffi: riti_config_set_compositional_suggestion (+ riti.h declaration).

The first candidate is the exact Khipro composition; dictionary/emoji
suggestions follow, as with the fixed method. The candidate-window
auxiliary text shows the raw roman keystrokes.

Vendored data (data/khipro/), MIT licensed:
- bn-khipro.mim  (c) 2024 rank_coder  - embedded at runtime
- khipro-testcases.csv  - used only by the #[cfg(test)] conformance test
@mominul

mominul commented Jun 27, 2026

Copy link
Copy Markdown
Member

@qomarhsn Hi!

Thanks for the pull request! But have you checked the OpenBangla/OpenBangla-Keyboard#426 ticket beforehand? We already have Khipro support in the Okkhor crate. The remaining work was about generating suggestions for Khipro, which I have done initially in the khipro branch in the upodesh repo.

Can you give me the rationale why we should proceed to have a .mim based layout system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants