autocorrect for shortcuts specified in user dictionary

This commit is contained in:
Helium314 2023-09-10 15:44:42 +02:00
parent 169e0feb20
commit 52d50a6de6
2 changed files with 3 additions and 6 deletions

View file

@ -375,11 +375,7 @@ public final class Suggest {
// list, "will" would always auto-correct to "Will" which is unwanted. Hence, no
// main dict => no auto-correct. Also, it would probably get obnoxious quickly.
// TODO: now that we have personalization, we may want to re-evaluate this decision
|| !dictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()
// If the first suggestion is a shortcut we never auto-correct to it, regardless
// of how strong it is (whitelist entries are not KIND_SHORTCUT but KIND_WHITELIST).
// TODO: we may want to have shortcut-only entries auto-correct in the future.
|| suggestionResults.first().isKindOf(SuggestedWordInfo.KIND_SHORTCUT)) {
|| !dictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()) {
hasAutoCorrection = false;
} else {
final SuggestedWordInfo firstSuggestion = suggestionResults.first();

View file

@ -348,7 +348,8 @@ public class SuggestedWords {
}
public boolean isAppropriateForAutoCorrection() {
return (mKindAndFlags & KIND_FLAG_APPROPRIATE_FOR_AUTO_CORRECTION) != 0;
return (mKindAndFlags & KIND_FLAG_APPROPRIATE_FOR_AUTO_CORRECTION) != 0
|| isKindOf(KIND_SHORTCUT);
}
public void setDebugString(final String str) {