mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* 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).
17 lines
1.3 KiB
Text
17 lines
1.3 KiB
Text
14370569c747a7efb5cd2f8e75b70d2899937c12e149671fe7a0929c5e0c4028 en.hextm
|
|
02ffcac185eb832d766b300a7454ba069d0b26251469ea7cdc6eda36926ad5ad es.hextm
|
|
7854e9a3c6788f9ff568a476d84c9f9a0f7b6b2c794df4375424252860998355 de.hextm
|
|
badc2e919a0238926d2935c750b9a21047e264edeb8987a85967133ed1350067 nb.hextm
|
|
d2b7c27ddd7da701cab7bffd1468f51061bf569d7dc81bfcaacf29beeea0d6cf en.valid
|
|
4e14038216fdfd43b71627c247ea5d032ec2aa28d82d30e10694bcb16c350f6e en.capitals
|
|
90f2e774d0bcf02b1e0667a4e4d207adf7e0d5291aee45203fbe8b7dd8282e98 es.capitals
|
|
7b1b24ff18868fb32e049502806ef3737ad91bde685239a4cc28ae38185f3ef9 de.capitals
|
|
11315e5087befcb598274a6fb5a05a6ff281db29be97a7999d5f3d6cd544f436 fr.hextm
|
|
102b73373eec17d901f64ec4c6f62307fc967ff7bf5fc91f6f2de97cf6835b02 it.hextm
|
|
4a1525710d62fc2a5c98951923153c8dfb3c72377c2ea47629d64a7dbf4a15a8 fr.capitals
|
|
e37a8663e8fa153574aa9863a76694eb83ac8430d2b2c75ae59dfbaded2ab9d5 it.capitals
|
|
fa47df56029370c3e17498d56970478bb9dee0335bda64c441f2a257c8382b08 es.valid
|
|
029c329c7eb5f7ee2855bf5717f73b9a66da116c8f3c1524e8f2d83e8116c00c fr.valid
|
|
2b8d6f840a7ffd608d6b4e2c28fc6f44db9159f84b9132ebe60e29579a1d676f it.valid
|
|
5633ec7bd91a4c43cafb5d62bea57409cebae47c6e8352f7e4b7b806da6916f6 de.valid
|
|
fa44f63d8d21411a36fb09e4c3be401420bf0c6b96518824123f2928ea732191 nb.valid
|