mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Do not add profanity to user history bigram dicitonary
Change-Id: I864c4206e3e6cde4d6ed687a9759e98901e16b9a
This commit is contained in:
parent
62b1e67215
commit
68c650fb2a
@ -2089,10 +2089,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||||||
} else {
|
} else {
|
||||||
secondWord = suggestion.toString();
|
secondWord = suggestion.toString();
|
||||||
}
|
}
|
||||||
// We demote unrecognized word and words with 0-frequency (assuming they would be
|
// We demote unrecognized words (frequency < 0, below) by specifying them as "invalid".
|
||||||
// profanity etc.) by specifying them as "invalid".
|
// We don't add words with 0-frequency (assuming they would be profanity etc.).
|
||||||
final int maxFreq = AutoCorrection.getMaxFrequency(
|
final int maxFreq = AutoCorrection.getMaxFrequency(
|
||||||
mSuggest.getUnigramDictionaries(), suggestion);
|
mSuggest.getUnigramDictionaries(), suggestion);
|
||||||
|
if (maxFreq == 0) return null;
|
||||||
mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(),
|
mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(),
|
||||||
secondWord, maxFreq > 0);
|
secondWord, maxFreq > 0);
|
||||||
return prevWord;
|
return prevWord;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user