Add a personal dictionary with shortcuts - #1384
Open
Gareth-Rouse wants to merge 3 commits into
Open
Gareth-Rouse wants to merge 3 commits into
Gareth-Rouse wants to merge 3 commits into
Conversation
added 3 commits
August 9, 2026 17:05
Words added in Settings > Suggestions > Personal dictionary are suggested when a prefix of them is typed. Stored as a JSON string list in preferences, mirroring custom extra keys. Personal matches rank before dictionary matches and keep their stored casing; suggestions now also work when no compiled dictionary is installed.
An entry can have a shortcut attached, e.g. "aa" for an email address. Typing the shortcut exactly (case-insensitive) suggests the word, ranked before other matches and inserted verbatim. Entries without a shortcut are stored as before (plain strings), so existing preferences keep loading. Word-match capitalization moves into PersonalDictionary so shortcut expansions are never capitalized. Also includes: personal words leave one suggestion slot for the compiled dictionary, and a max<=0 guard.
- Match personal entries against the raw typed word with an explicit capitalize flag; substitutions lower-case A-Z, which made the capitalization path dead code and broke matching of accented words. Entries are now normalized once at load with the same substitution table used for typed text, so cafe matches café in both directions. - Fill suggestion slots left unused by the compiled dictionary with personal word matches instead of reserving a slot that may go empty. - Reject shortcuts that can never fire in the entry dialog. - Make StringSerializer tolerant of format changes (JSONObject items now throw JSONException, handled, instead of crashing Config.refresh). - Label the word/shortcut dialog fields.
Julow
reviewed
Aug 30, 2026
Julow
left a comment
Owner
There was a problem hiding this comment.
Sorry, I have to postpone reviewing your PR a bit more as I'm preparing for a new release and don't have enough time.
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.
Adds a user-maintained personal dictionary: words and abbreviations entered in settings appear in the suggestion bar, independent of the compiled dictionaries.
Features
ListGroupPreference; entries are stored as JSON (plain strings, or{word, shortcut}objects when a shortcut is attached — old plain-string lists keep loading).aa→ an email address). Expansions rank first and are returned verbatim.ComposeKey.transform_char(ComposeKeyData.substitutions, …)), normalized once at load time, so typingcafematches a storedcaféand vice-versa.CurrentlyTypedWord.is_word_char).Also in this PR
ListGroupPreference.StringSerializer.load_itemnow throwsJSONExceptioninstead ofClassCastExceptionwhen an item isn't a string, so a future format change degrades to an empty list instead of crashingConfig.refreshon downgrade/upgrade.PersonalDictionary(matching, ranking, capitalization, substitutions, dedup, truncation): 7 tests.Tested on-device (debug build, installed as a separate app id).