improve garbage words being created in batch input mode

this likely depends on library
This commit is contained in:
Helium314 2023-07-26 16:17:06 +02:00
parent 0918935e09
commit 965038744b

View file

@ -917,6 +917,10 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
// this may not be the most efficient way, but getting suggestions is much slower anyway
for (SuggestedWordInfo info : dictionarySuggestions) {
if (!isBlacklisted(info.getWord())) {
// for some reason, user history produces garbage words in batch mode
// this also happens for other dictionaries, but for those the score usually is much lower, so they are less visible
if (composedData.mIsBatchMode && dictType.equals(Dictionary.TYPE_USER_HISTORY) && !dictionary.isInDictionary(info.getWord()))
continue;
suggestions.add(info);
}
}