Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68c650fb authored by Satoshi Kataoka's avatar Satoshi Kataoka
Browse files

Do not add profanity to user history bigram dicitonary

Change-Id: I864c4206e3e6cde4d6ed687a9759e98901e16b9a
parent 62b1e672
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2089,10 +2089,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
            } else {
                secondWord = suggestion.toString();
            }
            // We demote unrecognized word and words with 0-frequency (assuming they would be
            // profanity etc.) by specifying them as "invalid".
            // We demote unrecognized words (frequency < 0, below) by specifying them as "invalid".
            // We don't add words with 0-frequency (assuming they would be profanity etc.).
            final int maxFreq = AutoCorrection.getMaxFrequency(
                    mSuggest.getUnigramDictionaries(), suggestion);
            if (maxFreq == 0) return null;
            mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(),
                    secondWord, maxFreq > 0);
            return prevWord;