Fix a crash with long words

This commit is contained in:
Aleksandras Kostarevas 2024-06-15 13:38:10 +03:00
parent 13f81556ad
commit b935db017c

View File

@ -18,6 +18,7 @@ import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeout
import org.futo.inputmethod.keyboard.KeyboardSwitcher
import org.futo.inputmethod.latin.BinaryDictionary
import org.futo.inputmethod.latin.DictionaryFacilitator
import org.futo.inputmethod.latin.NgramContext
import org.futo.inputmethod.latin.Suggest
@ -238,6 +239,10 @@ public class LanguageModelFacilitator(
inputLogic.mWordComposer.setAutoCorrection(null)
if(values.composedData.mTypedWord.length > BinaryDictionary.DICTIONARY_MAX_WORD_LENGTH) {
inputLogic.mSuggestionStripViewAccessor.setNeutralSuggestionStrip()
}
try {
var transformerWeight = context.getSetting(BinaryDictTransformerWeightSetting)