KeyHandler // Completely disable UOM since it doesn't work at all.

- Assuming that there is no way to make this module work anymore.
This commit is contained in:
ShikiSuen 2022-06-07 19:26:24 +08:00
parent b0650de948
commit 85c8c3b275
2 changed files with 33 additions and 31 deletions

View File

@ -162,36 +162,38 @@ class KeyHandler {
func fixNode(value: String, respectCursorPushing: Bool = true) { func fixNode(value: String, respectCursorPushing: Bool = true) {
let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), builderLength) let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), builderLength)
let selectedNode: Megrez.NodeAnchor = _builder.grid.fixNodeSelectedCandidate( _builder.grid.fixNodeSelectedCandidate(location: cursorIndex, value: value)
location: cursorIndex, value: value // //
) // let selectedNode: Megrez.NodeAnchor = _builder.grid.fixNodeSelectedCandidate(
// // location: cursorIndex, value: value
if !mgrPrefs.useSCPCTypingMode { // )
// If the length of the readings and the characters do not match, // //
// it often means it is a special symbol and it should not be stored // if !mgrPrefs.useSCPCTypingMode {
// in the user override model. // // If the length of the readings and the characters do not match,
var addToUserOverrideModel = true // // it often means it is a special symbol and it should not be stored
if selectedNode.spanningLength != value.count { // // in the user override model.
IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.") // var addToUserOverrideModel = true
addToUserOverrideModel = false // if selectedNode.spanningLength != value.count {
} // IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.")
if addToUserOverrideModel { // addToUserOverrideModel = false
if let theNode = selectedNode.node { // }
// SymbolLM Score -12 // if addToUserOverrideModel {
if theNode.scoreFor(candidate: value) <= -12 { // if let theNode = selectedNode.node {
IME.prtDebugIntel("UOM: Score <= -12, dismissing.") // // SymbolLM Score -12
addToUserOverrideModel = false // if theNode.scoreFor(candidate: value) <= -12 {
} // IME.prtDebugIntel("UOM: Score <= -12, dismissing.")
} // addToUserOverrideModel = false
} // }
if addToUserOverrideModel { // }
IME.prtDebugIntel("UOM: Start Observation.") // }
_userOverrideModel.observe( // if addToUserOverrideModel {
walkedNodes: _walkedNodes, cursorIndex: cursorIndex, candidate: value, // IME.prtDebugIntel("UOM: Start Observation.")
timestamp: NSDate().timeIntervalSince1970 // _userOverrideModel.observe(
) // walkedNodes: _walkedNodes, cursorIndex: cursorIndex, candidate: value,
} // timestamp: NSDate().timeIntervalSince1970
} // )
// }
// }
walk() walk()
if mgrPrefs.moveCursorAfterSelectingCandidate, respectCursorPushing { if mgrPrefs.moveCursorAfterSelectingCandidate, respectCursorPushing {

View File

@ -188,7 +188,7 @@ extension KeyHandler {
let poppedText = popOverflowComposingTextAndWalk let poppedText = popOverflowComposingTextAndWalk
// ... get and tweak override model suggestion if possible... // ... get and tweak override model suggestion if possible...
dealWithOverrideModelSuggestions() // dealWithOverrideModelSuggestions() // 使
// ... then update the text. // ... then update the text.
_composer.clear() _composer.clear()