SessionCtl // Do currentLM.insertTemporaryData() when necessary.

This commit is contained in:
ShikiSuen 2022-12-01 12:38:27 +08:00
parent 5a23c63cfb
commit 82f7b2477a
1 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,13 @@ extension SessionCtl: InputHandlerDelegate {
//
//
_ = inputHandler.updateUnigramData()
//
//
let temporaryScore: Double = SessionCtl.areWeNerfing ? -114.514 : 0
LMMgr.currentLM.insertTemporaryData(
key: rawPair.0, unigram: .init(value: rawPair.1, score: temporaryScore), isFiltering: SessionCtl.areWeNerfing
)
// 使
LMMgr.bleachSpecifiedSuggestions(targets: [valueCurrent], mode: IMEApp.currentInputMode)
LMMgr.bleachSpecifiedSuggestions(targets: [valueReversed], mode: IMEApp.currentInputMode.reversed)
@ -189,6 +196,13 @@ extension SessionCtl: CtlCandidateDelegate {
succeeded = false
}
//
//
let temporaryScore: Double = (action == .toNerf) ? -114.514 : 0
LMMgr.currentLM.insertTemporaryData(
key: rawPair.0, unigram: .init(value: rawPair.1, score: temporaryScore), isFiltering: action == .toFilter
)
// 使
LMMgr.bleachSpecifiedSuggestions(targets: [valueCurrent], mode: IMEApp.currentInputMode)
LMMgr.bleachSpecifiedSuggestions(targets: [valueReversed], mode: IMEApp.currentInputMode.reversed)