mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-18 07:53:07 +00:00
consider contacts dictionary when removing suggestions, fixes #114
This commit is contained in:
parent
6cac9e2512
commit
136f060d6a
1 changed files with 10 additions and 2 deletions
|
@ -982,8 +982,16 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
userDict.removeUnigramEntryDynamically(word);
|
||||
}
|
||||
|
||||
// add to blacklist if in main dictionary
|
||||
if (group.getDict(Dictionary.TYPE_MAIN).isValidWord(word) && group.blacklist.add(word)) {
|
||||
final ExpandableBinaryDictionary contactsDict = group.getSubDict(Dictionary.TYPE_CONTACTS);
|
||||
final boolean isInContacts;
|
||||
if (contactsDict != null) {
|
||||
isInContacts = contactsDict.isInDictionary(word);
|
||||
if (isInContacts)
|
||||
contactsDict.removeUnigramEntryDynamically(word); // will be gone until next reload of dict
|
||||
} else isInContacts = false;
|
||||
|
||||
// add to blacklist if in main or contacts dictionaries
|
||||
if ((isInContacts || group.getDict(Dictionary.TYPE_MAIN).isValidWord(word)) && group.blacklist.add(word)) {
|
||||
// write to file if word wasn't already in blacklist
|
||||
ExecutorUtils.getBackgroundExecutor(ExecutorUtils.KEYBOARD).execute(() -> {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue