mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix input connection termination crash case
This commit is contained in:
parent
88403fad79
commit
14a846673d
@ -177,11 +177,17 @@ public class LanguageModelFacilitator(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!inputLogic.mConnection.isConnected) return
|
||||||
|
|
||||||
|
try {
|
||||||
val wordComposer = inputLogic.mWordComposer
|
val wordComposer = inputLogic.mWordComposer
|
||||||
val ngramContext = inputLogic.getNgramContextFromNthPreviousWordForSuggestion(settingsValues.mSpacingAndPunctuations, 2)
|
val ngramContext = inputLogic.getNgramContextFromNthPreviousWordForSuggestion(
|
||||||
|
settingsValues.mSpacingAndPunctuations,
|
||||||
|
2
|
||||||
|
)
|
||||||
|
|
||||||
val values = PredictionInputValues(
|
val values = PredictionInputValues(
|
||||||
wordComposer.getComposedDataSnapshot(),
|
wordComposer.composedDataSnapshot,
|
||||||
ngramContext,
|
ngramContext,
|
||||||
inputStyle,
|
inputStyle,
|
||||||
++currentSequenceId
|
++currentSequenceId
|
||||||
@ -191,6 +197,10 @@ public class LanguageModelFacilitator(
|
|||||||
println("LatinIME: Emitting values")
|
println("LatinIME: Emitting values")
|
||||||
sharedFlow.emit(values)
|
sharedFlow.emit(values)
|
||||||
}
|
}
|
||||||
|
} catch(e: Exception) {
|
||||||
|
println("Failed to get context, composed data snapshot, etc: $e")
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val historyLog: MutableList<HistoryLogForTraining> = mutableListOf()
|
private val historyLog: MutableList<HistoryLogForTraining> = mutableListOf()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user