mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
* English typing model: SCOWL's names, days and places join the words
The English builder kept only the spellings SCOWL writes in lowercase, so
en.hextm (iPhone and Android, byte-identical) had no names at all. Swipe reads
only model words, so "Claude" (reported on X), "Monday", "Mary", "London" and
"Christmas" could never be swiped ("clause", "noonday", "marry", "kingdom",
"christenings"), and typos of them were never corrected to them. 4.84% of the
held-out sentences' words were such names; the swipe benchmark skipped them.
- build-typing-model.py (both copies): SCOWL's upper and proper-names lists
(sizes <= 70) join, each word spelled with one capital first, 3+ letters, in
lowercase, ranked by its Google Books count. MAX_WORDS en 90,000 -> 100,000,
whose 400,000-word pool keeps every earlier word (90,000 would drop 8,379).
en.hextm: 86,247 -> 100,110 words, 417,182 -> 371,883 pairs, same
3,599,995 bytes. en.capitals (20,464 words) and en.valid rebuilt.
- The 589 bigram shards (323.8 GB) were re-read once over a superset of words;
with the old rules those counts rebuild c23e9c54 and the old en.capitals and
en.valid byte for byte. New model b5e83bc1, rebuilt again from the committed
builder.
- A name the decoder corrects to takes its capital on both platforms
("mray" -> "Mary"): TypingWord (Android) and AutocorrectEngine (iOS) now
capitalise English corrections as they did German's.
- Swipe: English drops the 4-nat rare-name cost (Android SwipeReader.ranked,
iPhone SwipeTyping.ranked). It existed for the lowercase list's accidental
names ("kent", "gs"); with real names at real counts it kept "Claude" behind
"clause" half the time. Removed behavior: English rare names are no longer
ranked 4 nats lower; other languages keep it. The iPhone test asserting that
ranking now asserts decoder order for English.
- swipe-bench.py/SwipeReplay --outside: the 208 held-out words (666 swipes)
1.0.5's model lacked are swiped and scored apart (swipe-outside-en.txt).
Verified (Android host JVM, Studio): quality-gate en 680 -> 583 word errors
(85.50% -> 87.57%), correct words changed 45 -> 48 (Adriano->Adrian x2,
Edmundo->Edmund x2, Liisa->Lisa; Gabor, Fadil now kept), critical 2/2.
Swipe old set typical 96.9 -> 96.8, neat 99.0 -> 99.0, sloppy 82.0 -> 81.4
(first word); the 666 lacked: 0 -> 54.2 / 55.9 / 44.4. Claude vs clause
(20 neat / 20 typical): 20/18 first, clause 20/20. Known trade: a swiped
"marry" gives "Mary" without a word before ("to marry": marry 19/20).
Android unit tests: 399 passed. iPhone gate and suite: pending (simboxes
blocked by Studio swap).
* English typing model: spellings beside the model, and newer words from the news
The model is lowercase and the capitals mechanisms give only a first capital
("Mary"), so "iPhone", "GitHub" or "ChatGPT" had no way to come out right, and
words newer than Google Books (1980-2019) were missing: a swiped "chatgpt"
read "chatbot", "openai" "penal", "iphone" "uphold".
- en.spellings (new, beside en.hextm on both platforms, byte-identical; 299
lines, 4.6 KB): word<TAB>spelling, sorted by UTF-8 bytes, read in place on
Android (Capitals.kt Spellings, TypingModel) and iPhone (HexWordList.text,
AutocorrectEngine+Spellings). A listed word takes its spelling typed in
lowercase, corrected to, swiped and in the strip; the iPhone strip also shows
names with their capital. Android dictation keeps Whisper's capitals for
listed words (KeyboardEngine, Whisper/SentenceEnds).
- build-typing-model.py (both copies): SCOWL's spellings with a capital inside
that aren't acronyms join with the names (115 in the model: "iPhone",
"PayPal"); then, after pairs are counted, words the vocabulary lacks from
the Leipzig Corpora Collection's 2023-2025 English news (CC BY 4.0, pinned
by URL, date, size, SHA-256 in ENGLISH_NEWS) that 100+ news sites use, 4+
letters, not acronyms: 243 ("ChatGPT", "OpenAI", "TikTok", "offline"), at
the count their news share stands for. Hex's own chat words keep no
spelling ("wifi"). en-extra-words.tsv's "no brand names" rule is replaced.
- Credits: Android credits.txt, iPhone Acknowledgements and its doc.
- Removed behavior: "github" typed without your own words now becomes
"GitHub" (the model's spelling); NeverSuggestTest expects that.
Why 4 letters: with 3, the news added "Eid", "Isa", "Ole", which took "did"
(x2), "is a" (x2) and "Oleg" (x3) in the gate.
Verified (Android host JVM, Studio): quality-gate en 583 -> 582 word errors
(87.59% fewer than raw taps; 680 before the PR), correct words changed
48 -> 48, critical 2/2. Swipe old set typical/neat/sloppy 96.8/99.0/81.4
(unchanged), the 666 1.0.5 lacked 54.2 -> 54.7 typical. ChatGPT, OpenAI,
GitHub, iPhone 20/20 neat and typical, YouTube 20/19. en.hextm f503d6d1 and
en.spellings 4d244e9b rebuilt from the committed builder. Android unit tests
399 passed. iPhone: build-for-testing succeeds on the Studio; gate and suite
pending (simboxes blocked by Studio swap).
* English typing model: names and newer words need four letters
The iPhone suite on the branch failed testThisIsATestSwipedWithASingleLetterBetween:
an "a" dragged a little too far and back typed "asa". A slid tap reads a word
that starts and ends on its key ("lol" on l), and SCOWL's three-letter names
added such words ("Asa", "Ada", "Ava", "Nan", "Ede"). Three-letter names also
took ordinary words in sloppy swipes ("the" -> "Tyr", "is" -> "Ira"), as
three-letter news words did in the gate ("did" -> "Eid").
- build-typing-model.py (both copies): NAME_LETTERS = 4 for SCOWL's names and
the news words alike (replaces NEWS_LETTERS). Removed behavior: 138
three-letter names ("Joe", "Amy", "Jan", "Aug") are no longer model words,
so they can't be swiped; typed, they keep the capital en.capitals or the
phone's dictionary gives them, as in 1.0.5. Spellings with a capital inside
keep three letters ("iOS", "PhD").
- en.hextm 98c8da8f (100,357 words, 370,951 pairs, 3,599,997 bytes),
en.capitals and en.valid rebuilt from the committed builder; en.spellings
unchanged (4d244e9b).
Verified: Android quality-gate en 582 -> 582 word errors, 48 changed (680 and
45 before the PR); swipe old set typical/neat/sloppy 96.8/99.0/81.4 ->
96.9/99.0/81.7, the 666 1.0.5 lacked 54.7 -> 54.4 typical; Claude vs clause
20/18 of 20 unchanged; with no name penalty the old set now loses 0 typical
and 25 sloppy swipes (was 9 and 40). Android unit tests 399 passed.
iPhone (simbox, iPhone 18 Pro): typing-gate en 735 (1.0.5 model) -> 633 word
errors, 37 -> 35 changed, names capitalised 418 -> 421; full suite 1014
tests, 0 failures, 5 skipped (it failed 1 before this commit).
1.8 KiB
1.8 KiB
| 1 | # Chat and tech words for the English typing model (build-typing-model.py), written for Hex |
|---|---|
| 2 | # by its developers: ours, not copied from any corpus, dictionary or other keyboard. |
| 3 | # Each line: word<TAB>tier. Tier 1 costs 10 nats (about the model's 2,000th word), tier 2 |
| 4 | # 12, tier 3 13.5; a word the books already have only gets commoner. Lowercase a-z and ' |
| 5 | # only, no names: names come from SCOWL, and newer ones from the 2023-2025 news, with their |