KeyHandler // Re-enable UOM.

This commit is contained in:
ShikiSuen 2022-06-21 00:33:17 +08:00
parent 465d0a9845
commit 7754a29925
2 changed files with 32 additions and 32 deletions

View File

@ -170,37 +170,37 @@ class KeyHandler {
func fixNode(value: String, respectCursorPushing: Bool = true) { func fixNode(value: String, respectCursorPushing: Bool = true) {
let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), compositorLength) let cursorIndex = min(actualCandidateCursorIndex + (mgrPrefs.useRearCursorMode ? 1 : 0), compositorLength)
compositor.grid.fixNodeSelectedCandidate(location: cursorIndex, value: value) compositor.grid.fixNodeSelectedCandidate(location: cursorIndex, value: value)
// // //
// let selectedNode: Megrez.NodeAnchor = compositor.grid.fixNodeSelectedCandidate( let selectedNode: Megrez.NodeAnchor = compositor.grid.fixNodeSelectedCandidate(
// location: cursorIndex, value: value location: cursorIndex, value: value
// ) )
// // //
// if !mgrPrefs.useSCPCTypingMode { if !mgrPrefs.useSCPCTypingMode {
// // //
// var addToUserOverrideModel = true var addToUserOverrideModel = true
// if selectedNode.spanningLength != value.count { if selectedNode.spanningLength != value.count {
// IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.") IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.")
// addToUserOverrideModel = false addToUserOverrideModel = false
// } }
// if addToUserOverrideModel { if addToUserOverrideModel {
// if let theNode = selectedNode.node { if let theNode = selectedNode.node {
// // SymbolLM Score -12 // SymbolLM Score -12
// if theNode.scoreFor(candidate: value) <= -12 { if theNode.scoreFor(candidate: value) <= -12 {
// IME.prtDebugIntel("UOM: Score <= -12, dismissing.") IME.prtDebugIntel("UOM: Score <= -12, dismissing.")
// addToUserOverrideModel = false addToUserOverrideModel = false
// } }
// } }
// } }
// if addToUserOverrideModel { if addToUserOverrideModel {
// IME.prtDebugIntel("UOM: Start Observation.") IME.prtDebugIntel("UOM: Start Observation.")
// // trigram // trigram
// // trigram // trigram
// currentUOM.observe( currentUOM.observe(
// walkedAnchors: walkedAnchors, cursorIndex: cursorIndex, candidate: value, walkedAnchors: walkedAnchors, cursorIndex: cursorIndex, candidate: value,
// timestamp: NSDate().timeIntervalSince1970 timestamp: NSDate().timeIntervalSince1970
// ) )
// } }
// } }
walk() walk()
/// ///

View File

@ -195,7 +195,7 @@ extension KeyHandler {
let textToCommit = popOverflowComposingTextAndWalk let textToCommit = popOverflowComposingTextAndWalk
// //
// dealWithOverrideModelSuggestions() // 使 dealWithOverrideModelSuggestions()
// //
markNodesFixedIfNecessary() markNodesFixedIfNecessary()