mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Do not add profanity to user history bigram dicitonary" into jb-dev
This commit is contained in:
commit
5caaf1b9e9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user