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) {
let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), builderLength)
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
// in the user override model.
var addToUserOverrideModel = true
if selectedNode.spanningLength != value.count {
IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.")
addToUserOverrideModel = false
}
if addToUserOverrideModel {
if let theNode = selectedNode.node {
// SymbolLM Score -12
if theNode.scoreFor(candidate: value) <= -12 {
IME.prtDebugIntel("UOM: Score <= -12, dismissing.")
addToUserOverrideModel = false
}
}
}
if addToUserOverrideModel {
IME.prtDebugIntel("UOM: Start Observation.")
_userOverrideModel.observe(
walkedNodes: _walkedNodes, cursorIndex: cursorIndex, candidate: value,
timestamp: NSDate().timeIntervalSince1970
)
}
}
_builder.grid.fixNodeSelectedCandidate(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
// // in the user override model.
// var addToUserOverrideModel = true
// if selectedNode.spanningLength != value.count {
// IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.")
// addToUserOverrideModel = false
// }
// if addToUserOverrideModel {
// if let theNode = selectedNode.node {
// // SymbolLM Score -12
// if theNode.scoreFor(candidate: value) <= -12 {
// IME.prtDebugIntel("UOM: Score <= -12, dismissing.")
// addToUserOverrideModel = false
// }
// }
// }
// if addToUserOverrideModel {
// IME.prtDebugIntel("UOM: Start Observation.")
// _userOverrideModel.observe(
// walkedNodes: _walkedNodes, cursorIndex: cursorIndex, candidate: value,
// timestamp: NSDate().timeIntervalSince1970
// )
// }
// }
walk()
if mgrPrefs.moveCursorAfterSelectingCandidate, respectCursorPushing {

View File

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