hex/android/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel f94e2c8c9d Android: dictate in Polish and Russian
What changed
- DictationLanguage gains Polski (pl) and Русский (ru), named as Android's
  language list writes them. Neither has a layout of its own, so the keyboard
  stays English QWERTY: Polish letters (ą ć ę ł ń ó ś ź ż) are already held
  there; there are no Cyrillic keys yet, so a Russian speaker dictates with Hex
  and types on another keyboard. Both appear in Settings › Dictation language
  and the Hex menu's language page (also reached by holding the space bar), and
  Automatic picks them on a phone whose languages include pl or ru.
- Mid-sentence dictation knows short Polish and Russian function-word lists,
  so "To jest" after "i" goes in lowercase; names keep their capital.
- README: the space-bar list, the layout note and the scope line (ten
  dictation languages).

Why
People with Polish and Russian phones were told these would come. Automatic on
those phones fell back to English (DictationLanguage.automatic(null, ["pl"])
== English), and Whisper told "en" writes an English translation: small turned
10/10 Polish and 10/10 Russian clips into English.

What they get from the text rules (none falls back to English)
- Cleanup, lists, spoken symbols and counts, hesitation trimming and spoken
  punctuation have no Polish or Russian rules, so the words stay as said.
- Styles: spacing, sentence capitals and the closing period (Polished),
  lowercase (Casual), bullets (Notes), unchanged words (Verbatim).

Measured (native macOS CPU build of the app's whisper.cpp d1be6fd with
hexspeech.cpp's parameters at d83d73cf5: greedy, translate off, no context, no
timestamps, suppress_nst, model kept loaded, small's short window on clips up
to 8 s, audio_ctx = min(512, roundup64(ceil(n*50/16000) + 192)); 2 threads;
pinned small Q5_1 and bundled tiny Q5_1; 10 macOS say clips per language,
Zosia and Milena, 2.2-3.5 s, 2 with a music bed; no emulator)
- Published threshold, Whisper small on FLEURS (Radford et al. 2022, Table 13)
  at most 15%: Russian 11.4, Polish 14.7.
- Russian, small: told ru 3.8% WER (2/53 words); told en 10/10 English;
  auto-detect 3.8%, 10/10 right. Tiny told ru 20.8%.
- Polish, small: told pl 11.1% (6/54; two are masculine verb forms for a
  female voice); told en 10/10 English; auto-detect 11.1%, 10/10 right. Tiny
  told pl 31.5%.
- Not added, for missing the threshold: Ukrainian (published 19.3; clips
  25.5%, auto sent 4/10 to Russian or Polish), Swedish (20.8; 20.0%), Czech
  (37.6; 17.3%, auto 6/10 wrong), Danish (32.8; 32.8%).
- A phone listing Ukrainian then Russian now gets Russian, as Automatic's rule
  says: on Ukrainian clips, small told ru is 84.3% WER (Russian-ish text),
  where told en (before) was 139.2%, an English translation.

Verified
- ./gradlew --no-daemon :app:testDebugUnitTest on the Studio: InsertionTest
  41/41 (new test: Automatic and matching for pl and ru, no layouts,
  Polished/Casual/Verbatim with cleanup, lists and spoken punctuation on,
  mid-sentence case in both scripts), NeverSuggestTest 27/27.
- Not run on an emulator or phone: the Studio's emulator is in use and has no
  audio input. No new strings: language names are not translated.
2026-11-23 15:37:03 -05:00
..
src Android: dictate in Polish and Russian 2026-11-23 15:37:03 -05:00
build.gradle.kts Android: Hex Preview, an APK outside Google Play that updates itself (#2531) 2026-11-23 11:37:51 -05:00
proguard-rules.pro Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00