Repository navigation
stoa-predict: choose prediction languages in Stoa Settings, frequency-ranked suggestions - #210
Merged
Merged
Conversation
Super+S → Keyboard → Text prediction now turns prediction on/off and
opens a checklist of 21 languages. Ticked languages are downloaded on
demand (FrequencyWords, OpenSubtitles 2018, CC BY-SA 4.0, ~600 KB each)
into ~/.local/share/stoa/predict and listed in
~/.config/stoa/predict-languages; prediction restarts to use them.
The word engine changes with it: suggestions are ranked by how often a
word is used ("wh" → what, who, why…; "obr" → obrigado, obra…) instead
of alphabetically, languages are merged by relative frequency, and the
lookup ignores accents ("nao" → não). Accent-only typos that are rare
next to the common spelling and UTF-8-as-Latin-1 noise in the lists are
dropped. The system word list stays as the fallback.
install.sh starts a fresh install with pt_br + en. The checklist runs
yad under C.UTF-8 when the session locale is not UTF-8: GTK otherwise
rejects the language names in argv.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CrdbH4MCHhLKimzdRSzXZp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Super+S → Keyboard → Text prediction is a new submenu with:
When you save,
stoa-predict set-languagesdownloads any missing list into~/.local/share/stoa/predict/and writes the choice to~/.config/stoa/predict-languages. It then restarts prediction if it is on. If a download fails, nothing is saved and the previous choice keeps working.Word lists
FrequencyWords gives the 50k most common words per language with their counts (OpenSubtitles 2018, CC BY-SA 4.0, ~600 KB each). The lists are downloaded on demand rather than vendored, and the README credits the source.
aspell was considered and rejected:
aspell -d pt_BR dump | expandproduces about 10.5M forms with no usage ranking, and Latin-1 output by default.Engine (
WordDictionaryinstoa-predict.py)wh→ what, who, why, when, where;obr→ obrigado, obrigada, obra.nao→ não andacao→ ação.nâo/näonext tonão). Real pairs such asesta/estásurvive.vocãª).~/.config/stoa/predict-words.txtstill works, and those words rank first./usr/share/dict/wordsis used when no language list is downloaded.install.shstarts withpt_br en; offline it skips this quietly.Verification
th→ the, that, this, there, they.voc→ você, vocês;est→ está, estou, estava.co→ com, como, come, coisa, could.languageslists the catalog;set-languages pt_br endownloads and saves; an unknown code exits 2 and leaves the previous choice intact.es.txt, saveden pt_br esand showed the success notification.obr→ ↓ Enter gaveobrigado,naogavenão, andgracigavegracias(from Español).tests/run.sh18 passed; ruff and config-integrity are clean; shellcheck shows no new findings.Generated by Claude Code