hex/android/app/src/main/assets/typing
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel f4bd1c6ca7
Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271)
* Android typing: your own word gets a strip slot after two letters

With "Zorbex" in Android's personal dictionary, typing "zor" showed
"zor" | or | sir (checked live by the keyboard helper): the fix and the
decoder's runner-up filled both slots before your own completions came.
strip() now adds your likeliest own completion right after the fix (and
English's suggest-only contraction) once two letters are typed, so "zor"
shows "zor" | or | Zorbex. One-letter words and the rest of your
completions keep their place after the dictionary's readings.

Verified: testDebugUnitTest passes, with the case ("zo", "zor" typed by
taps beside a fix) added to NeverSuggestTest's personal-words test.

* Android typing: real-word lists for Spanish, German, Bokmal, French, Italian

iOS asks Apple's spelling dictionary whether a spelling outside its model
is a real word; Android had that only for English (SCOWL en.valid). Rare
words and names were corrected or split ("cochecito" -> "coche cito",
"vanesa" -> "van es a", "caminad" -> "caminado", "maktspråk" -> "makt
språk").

Lists (build-valid-words.py, now with a language argument):
- es, de, fr, it: every spelling the Google Books v3 1-grams (CC BY 3.0,
  1980-2019, the counts build-capitals.py caches; German's counted the
  same way) use at least 3,000 times (German 10,000), outside the model.
- nb: Norsk ordbank bokmal 2005 standard full forms (2022-02-01 release,
  CC BY 4.0) outside the model that the NB N-gram 2026 books (CC0) use at
  least 1,000 times.
- Left out: two model words run together whose pair is ten times as
  common, French/Italian elisions without their apostrophe ("cest"), and
  model words with an accent changed or left out ("volvere", "brulant").
- Each line is word<TAB>cost (eighths of a nat from the count).
  en.valid is unchanged (no cost column).
Sizes, stored uncompressed: es 1.29 MB, de 2.14, nb 0.84, fr 1.45, it
1.11; 6.83 MB together.

Decoder: a listed word costs what its count says instead of 22 nats; a
one-word fix still needs only the 2-nat margin, splitting it into words
needs a known word's 7, and the missed-space fallback skips it. A list
without costs keeps the old flat known-word reading (15 nats, 7-nat
margin); a flat reading for these lists was measured and rejected
(Spanish 1,058 -> 1,227 errors). validLiteral now compares UTF-8 bytes;
TypingModel loads <lang>.valid for any language; replay.sh pushes them;
the gradle verify list and SHA256SUMS name them; credits.txt credits
them. Replay.java gains a memory mode (every language kept loaded in one
process, resident memory before and after).

Cut-offs were chosen on both rare words kept and typos wrongly kept, not
on word errors alone (README has the sweep).

Verified on the Studio (API 35 emulator, installed debug APK, 2,000
held-out sentences each), word errors: English 707 (unchanged), Spanish
1,058 -> 1,033, German 729 -> 714, Bokmal 631 -> 627, French 939 -> 935,
Italian 763 -> 753. Rare words typed exactly and kept: es 228 -> 242 of
262, de 83 -> 94 of 107, nb 35 -> 39 of 104, fr 201 -> 201 of 211, it
82 -> 89 of 99; typos wrongly kept: 3, 3, 1, 0, 0. Latency unchanged in
an A/B on the API 31 emulator. testDebugUnitTest: 54 tests pass; the new
NeverSuggestTest case fails without the lists (checked against a copy of
the models without them).
2026-11-21 17:27:04 -05:00
..
de.capitals Android typing: names and capitals, the strip, and your personal dictionary (#2251) 2026-11-21 16:04:05 -05:00
de.hextm Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
de.valid Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00
en.capitals Android typing: names and capitals, the strip, and your personal dictionary (#2251) 2026-11-21 16:04:05 -05:00
en.hextm Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
en.valid Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
es.capitals Android typing: names and capitals, the strip, and your personal dictionary (#2251) 2026-11-21 16:04:05 -05:00
es.hextm Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
es.valid Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00
fr.capitals Android typing: next-letter touch areas, and French and Italian (#2260) 2026-11-21 16:31:32 -05:00
fr.hextm Android typing: next-letter touch areas, and French and Italian (#2260) 2026-11-21 16:31:32 -05:00
fr.valid Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00
it.capitals Android typing: next-letter touch areas, and French and Italian (#2260) 2026-11-21 16:31:32 -05:00
it.hextm Android typing: next-letter touch areas, and French and Italian (#2260) 2026-11-21 16:31:32 -05:00
it.valid Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00
nb.hextm Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
nb.valid Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00
never-suggest.tsv Android typing: next-letter touch areas, and French and Italian (#2260) 2026-11-21 16:31:32 -05:00
SHA256SUMS Android typing: real-word lists for Spanish, German, Bokmål, French and Italian (#2271) 2026-11-21 17:27:04 -05:00