From 2cabab808dc2aed49c6be91e640ce9d85379c0d9 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 21 Jun 2022 11:24:15 +0800 Subject: [PATCH] mgrLM // Update outdated symbol names. --- .../ctlInputMethod_Menu.swift | 12 ++++----- .../LangModelRelated/mgrLangModel.swift | 26 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift index a35664f9..d107903a 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Menu.swift @@ -318,9 +318,9 @@ extension ctlInputMethod { } @objc func openExcludedPhrases(_: Any?) { - IME.openPhraseFile(userFileAt: mgrLangModel.excludedPhrasesDataPath(IME.getInputMode())) + IME.openPhraseFile(userFileAt: mgrLangModel.userFilteredDataPath(IME.getInputMode())) if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled { - IME.openPhraseFile(userFileAt: mgrLangModel.excludedPhrasesDataPath(IME.getInputMode(isReversed: true))) + IME.openPhraseFile(userFileAt: mgrLangModel.userFilteredDataPath(IME.getInputMode(isReversed: true))) } } @@ -332,17 +332,17 @@ extension ctlInputMethod { } @objc func openPhraseReplacement(_: Any?) { - IME.openPhraseFile(userFileAt: mgrLangModel.phraseReplacementDataPath(IME.getInputMode())) + IME.openPhraseFile(userFileAt: mgrLangModel.userReplacementsDataPath(IME.getInputMode())) if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled { - IME.openPhraseFile(userFileAt: mgrLangModel.phraseReplacementDataPath(IME.getInputMode(isReversed: true))) + IME.openPhraseFile(userFileAt: mgrLangModel.userReplacementsDataPath(IME.getInputMode(isReversed: true))) } } @objc func openAssociatedPhrases(_: Any?) { - IME.openPhraseFile(userFileAt: mgrLangModel.userAssociatedPhrasesDataPath(IME.getInputMode())) + IME.openPhraseFile(userFileAt: mgrLangModel.userAssociatesDataPath(IME.getInputMode())) if NSEvent.modifierFlags.contains(.option), mgrPrefs.isDebugModeEnabled { IME.openPhraseFile( - userFileAt: mgrLangModel.userAssociatedPhrasesDataPath(IME.getInputMode(isReversed: true))) + userFileAt: mgrLangModel.userAssociatesDataPath(IME.getInputMode(isReversed: true))) } } diff --git a/Source/Modules/LangModelRelated/mgrLangModel.swift b/Source/Modules/LangModelRelated/mgrLangModel.swift index 08f74d5d..94111119 100644 --- a/Source/Modules/LangModelRelated/mgrLangModel.swift +++ b/Source/Modules/LangModelRelated/mgrLangModel.swift @@ -150,11 +150,11 @@ enum mgrLangModel { public static func loadUserPhrasesData() { gLangModelCHT.loadUserPhrasesData( path: userPhrasesDataPath(InputMode.imeModeCHT), - filterPath: excludedPhrasesDataPath(InputMode.imeModeCHT) + filterPath: userFilteredDataPath(InputMode.imeModeCHT) ) gLangModelCHS.loadUserPhrasesData( path: userPhrasesDataPath(InputMode.imeModeCHS), - filterPath: excludedPhrasesDataPath(InputMode.imeModeCHS) + filterPath: userFilteredDataPath(InputMode.imeModeCHS) ) gLangModelCHT.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHT)) gLangModelCHS.loadUserSymbolData(path: userSymbolDataPath(InputMode.imeModeCHS)) @@ -162,19 +162,19 @@ enum mgrLangModel { public static func loadUserAssociatesData() { gLangModelCHT.loadUserAssociatesData( - path: mgrLangModel.userAssociatedPhrasesDataPath(InputMode.imeModeCHT) + path: mgrLangModel.userAssociatesDataPath(InputMode.imeModeCHT) ) gLangModelCHS.loadUserAssociatesData( - path: mgrLangModel.userAssociatedPhrasesDataPath(InputMode.imeModeCHS) + path: mgrLangModel.userAssociatesDataPath(InputMode.imeModeCHS) ) } public static func loadUserPhraseReplacement() { gLangModelCHT.loadReplacementsData( - path: mgrLangModel.phraseReplacementDataPath(InputMode.imeModeCHT) + path: mgrLangModel.userReplacementsDataPath(InputMode.imeModeCHT) ) gLangModelCHS.loadReplacementsData( - path: mgrLangModel.phraseReplacementDataPath(InputMode.imeModeCHS) + path: mgrLangModel.userReplacementsDataPath(InputMode.imeModeCHS) ) } @@ -229,17 +229,17 @@ enum mgrLangModel { return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path } - static func userAssociatedPhrasesDataPath(_ mode: InputMode) -> String { + static func userAssociatesDataPath(_ mode: InputMode) -> String { let fileName = (mode == InputMode.imeModeCHT) ? "associatedPhrases-cht.txt" : "associatedPhrases-chs.txt" return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path } - static func excludedPhrasesDataPath(_ mode: InputMode) -> String { + static func userFilteredDataPath(_ mode: InputMode) -> String { let fileName = (mode == InputMode.imeModeCHT) ? "exclude-phrases-cht.txt" : "exclude-phrases-chs.txt" return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path } - static func phraseReplacementDataPath(_ mode: InputMode) -> String { + static func userReplacementsDataPath(_ mode: InputMode) -> String { let fileName = (mode == InputMode.imeModeCHT) ? "phrases-replacement-cht.txt" : "phrases-replacement-chs.txt" return URL(fileURLWithPath: dataFolderPath(isDefaultFolder: false)).appendingPathComponent(fileName).path } @@ -275,9 +275,9 @@ enum mgrLangModel { return false } if !ensureFileExists(userPhrasesDataPath(mode)) - || !ensureFileExists(userAssociatedPhrasesDataPath(mode)) - || !ensureFileExists(excludedPhrasesDataPath(mode)) - || !ensureFileExists(phraseReplacementDataPath(mode)) + || !ensureFileExists(userAssociatesDataPath(mode)) + || !ensureFileExists(userFilteredDataPath(mode)) + || !ensureFileExists(userReplacementsDataPath(mode)) || !ensureFileExists(userSymbolDataPath(mode)) { return false @@ -391,7 +391,7 @@ enum mgrLangModel { return false } - let path = areWeDeleting ? excludedPhrasesDataPath(mode) : userPhrasesDataPath(mode) + let path = areWeDeleting ? userFilteredDataPath(mode) : userPhrasesDataPath(mode) if areWeDuplicating, !areWeDeleting { // Do not use ASCII characters to comment here.