diff --git a/Source/Data b/Source/Data
index 345b21db..32ae1957 160000
--- a/Source/Data
+++ b/Source/Data
@@ -1 +1 @@
-Subproject commit 345b21db6510caf63184716178837c5563e68123
+Subproject commit 32ae1957bdbbb1daabf108f6352708677aec27fa
diff --git a/Source/Modules/ControllerModules/KeyHandler_Core.swift b/Source/Modules/ControllerModules/KeyHandler_Core.swift
index 4caf14b5..5ab32f12 100644
--- a/Source/Modules/ControllerModules/KeyHandler_Core.swift
+++ b/Source/Modules/ControllerModules/KeyHandler_Core.swift
@@ -332,6 +332,7 @@ class KeyHandler {
mgrPrefs.mandarinParser = MandarinParser.ofStandard.rawValue
}
composer.clear()
+ composer.phonabetCombinationCorrectionEnabled = mgrPrefs.autoCorrectReadingCombination
}
// MARK: - Extracted methods and functions (Megrez).
diff --git a/Source/Modules/ControllerModules/SyllableComposer.swift b/Source/Modules/ControllerModules/SyllableComposer.swift
index d76d4636..abfa4e11 100644
--- a/Source/Modules/ControllerModules/SyllableComposer.swift
+++ b/Source/Modules/ControllerModules/SyllableComposer.swift
@@ -221,6 +221,9 @@ public struct Tekkon {
/// 注音排列種類。預設情況下是大千排列(Windows / macOS 預設注音排列)。
public var parser: MandarinParser = .ofDachen
+ /// 是否對錯誤的注音讀音組合做出自動糾正處理。
+ public var phonabetCombinationCorrectionEnabled = false
+
/// 內容值,會直接按照正確的順序拼裝自己的聲介韻調內容、再回傳。
/// 注意:直接取這個參數的內容的話,陰平聲調會成為一個空格。
/// 如果是要取不帶空格的注音的話,請使用「.getComposition()」而非「.value」。
@@ -285,7 +288,9 @@ public struct Tekkon {
/// - Parameters:
/// - input: 傳入的 String 內容,用以處理單個字符。
/// - arrange: 要使用的注音排列。
- public init(_ input: String = "", arrange parser: MandarinParser = .ofDachen) {
+ /// - correction: 是否對錯誤的注音讀音組合做出自動糾正處理。
+ public init(_ input: String = "", arrange parser: MandarinParser = .ofDachen, correction: Bool = false) {
+ phonabetCombinationCorrectionEnabled = correction
ensureParser(arrange: parser)
receiveKey(fromString: input)
}
@@ -379,15 +384,24 @@ public struct Tekkon {
/// - Parameters:
/// - fromPhonabet: 傳入的單個注音符號字串。
public mutating func receiveKey(fromPhonabet phonabet: String = "") {
- let thePhone: Phonabet = .init(phonabet)
- switch phonabet {
- case "ㄛ", "ㄥ":
- if "ㄅㄆㄇㄈ".contains(consonant.value), semivowel.value == "ㄨ" { semivowel.clear() }
- case "ㄨ":
- if "ㄅㄆㄇㄈ".contains(consonant.value), "ㄛㄥ".contains(vowel.value) { vowel.clear() }
- case "ㄅ", "ㄆ", "ㄇ", "ㄈ":
- if ["ㄨㄛ", "ㄨㄥ"].contains(semivowel.value + vowel.value) { semivowel.clear() }
- default: break
+ var thePhone: Phonabet = .init(phonabet)
+ if phonabetCombinationCorrectionEnabled {
+ switch phonabet {
+ case "ㄧ", "ㄩ":
+ if vowel.value == "ㄜ" { vowel = "ㄝ" }
+ case "ㄜ":
+ if "ㄧㄩ".contains(semivowel.value) { thePhone = "ㄝ" }
+ case "ㄛ", "ㄥ":
+ if "ㄅㄆㄇㄈ".contains(consonant.value), semivowel.value == "ㄨ" { semivowel.clear() }
+ case "ㄟ":
+ if "ㄋㄌ".contains(consonant.value), semivowel.value == "ㄨ" { semivowel.clear() }
+ case "ㄨ":
+ if "ㄅㄆㄇㄈ".contains(consonant.value), "ㄛㄥ".contains(vowel.value) { vowel.clear() }
+ if "ㄋㄌ".contains(consonant.value), "ㄟ".contains(vowel.value) { vowel.clear() }
+ case "ㄅ", "ㄆ", "ㄇ", "ㄈ":
+ if ["ㄨㄛ", "ㄨㄥ"].contains(semivowel.value + vowel.value) { semivowel.clear() }
+ default: break
+ }
}
switch thePhone.type {
case .consonant: consonant = thePhone
@@ -880,6 +894,23 @@ public struct Tekkon {
return arrReturn.joined(separator: newSeparator)
}
+ /// 該函式用來將漢語拼音轉為注音。
+ /// - Parameter target: 要轉換的漢語拼音內容,要求必須帶有 12345 數字標調。
+ /// - Returns: 轉換結果。
+ static func cnvHanyuPinyinToPhona(target: String) -> String {
+ if target.contains("_") { return target }
+ var result = target
+ for key in Tekkon.mapHanyuPinyin.keys.sorted(by: { $0.count > $1.count }) {
+ guard let value = Tekkon.mapHanyuPinyin[key] else { continue }
+ result = result.replacingOccurrences(of: key, with: value)
+ }
+ for key in Tekkon.mapArayuruPinyinIntonation.keys.sorted(by: { $0.count > $1.count }) {
+ guard let value = Tekkon.mapArayuruPinyinIntonation[key] else { continue }
+ result = result.replacingOccurrences(of: key, with: value)
+ }
+ return result
+ }
+
/// 原始轉換對照表資料貯存專用佇列(數字標調格式)
static let arrPhonaToHanyuPinyin = [ // 排序很重要。先處理最長的,再處理短的。不然會出亂子。
[" ", "1"], ["ˊ", "2"], ["ˇ", "3"], ["ˋ", "4"], ["˙", "5"],
diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift
index 017a4320..138df186 100644
--- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift
+++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift
@@ -41,7 +41,7 @@ class ctlInputMethod: IMKInputController {
static var areWeDeleting = false
/// 目前在用的的選字窗副本。
- var ctlCandidateCurrent = ctlCandidateUniversal.init(.horizontal)
+ static var ctlCandidateCurrent = ctlCandidateUniversal.init(.horizontal)
/// 工具提示視窗的副本。
static let tooltipController = TooltipController()
@@ -96,6 +96,10 @@ class ctlInputMethod: IMKInputController {
_ = sender // 防止格式整理工具毀掉與此對應的參數。
UserDefaults.standard.synchronize()
+ // 因為偶爾會收到與 activateServer 有關的以「強制拆 nil」為理由的報錯,
+ // 所以這裡添加這句、來試圖應對這種情況。
+ if keyHandler.delegate == nil { keyHandler.delegate = self }
+
keyHandler.clear()
keyHandler.ensureParser()
diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift b/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift
index d3f60594..c930bffd 100644
--- a/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift
+++ b/Source/Modules/ControllerModules/ctlInputMethod_Delegates.swift
@@ -29,7 +29,7 @@ import Foundation
// MARK: - KeyHandler Delegate
extension ctlInputMethod: KeyHandlerDelegate {
- func ctlCandidate() -> ctlCandidate { ctlCandidateCurrent }
+ func ctlCandidate() -> ctlCandidate { ctlInputMethod.ctlCandidateCurrent }
func keyHandler(
_: KeyHandler, didSelectCandidateAt index: Int,
diff --git a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift
index 0f180a79..03bb2c47 100644
--- a/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift
+++ b/Source/Modules/ControllerModules/ctlInputMethod_HandleDisplay.swift
@@ -72,7 +72,7 @@ extension ctlInputMethod {
// 上面這句如果是 true 的話,就會是縱排;反之則為橫排。
}
- ctlCandidateCurrent.delegate = nil
+ ctlInputMethod.ctlCandidateCurrent.delegate = nil
/// 下面這一段本可直接指定 currentLayout,但這樣的話翻頁按鈕位置無法精準地重新繪製。
/// 所以只能重新初期化。壞處就是得在 ctlCandidate() 當中與 SymbolTable 控制有關的地方
@@ -81,11 +81,11 @@ extension ctlInputMethod {
/// 該問題徹底解決的價值並不大,直接等到 macOS 10.x 全線淘汰之後用 SwiftUI 重寫選字窗吧。
if isCandidateWindowVertical { // 縱排輸入時強制使用縱排選字窗
- ctlCandidateCurrent = .init(.vertical)
+ ctlInputMethod.ctlCandidateCurrent = .init(.vertical)
} else if mgrPrefs.useHorizontalCandidateList {
- ctlCandidateCurrent = .init(.horizontal)
+ ctlInputMethod.ctlCandidateCurrent = .init(.horizontal)
} else {
- ctlCandidateCurrent = .init(.vertical)
+ ctlInputMethod.ctlCandidateCurrent = .init(.vertical)
}
// set the attributes for the candidate panel (which uses NSAttributedString)
@@ -113,10 +113,10 @@ extension ctlInputMethod {
return finalReturnFont
}
- ctlCandidateCurrent.keyLabelFont = labelFont(
+ ctlInputMethod.ctlCandidateCurrent.keyLabelFont = labelFont(
name: mgrPrefs.candidateKeyLabelFontName, size: keyLabelSize
)
- ctlCandidateCurrent.candidateFont = candidateFont(
+ ctlInputMethod.ctlCandidateCurrent.candidateFont = candidateFont(
name: mgrPrefs.candidateTextFontName, size: textSize
)
@@ -124,14 +124,14 @@ extension ctlInputMethod {
let keyLabels =
candidateKeys.count > 4 ? Array(candidateKeys) : Array(mgrPrefs.defaultCandidateKeys)
let keyLabelSuffix = state is InputState.AssociatedPhrases ? "^" : ""
- ctlCandidateCurrent.keyLabels = keyLabels.map {
+ ctlInputMethod.ctlCandidateCurrent.keyLabels = keyLabels.map {
CandidateKeyLabel(key: String($0), displayedText: String($0) + keyLabelSuffix)
}
- ctlCandidateCurrent.delegate = self
- ctlCandidateCurrent.reloadData()
+ ctlInputMethod.ctlCandidateCurrent.delegate = self
+ ctlInputMethod.ctlCandidateCurrent.reloadData()
- ctlCandidateCurrent.visible = true
+ ctlInputMethod.ctlCandidateCurrent.visible = true
var lineHeightRect = NSRect(x: 0.0, y: 0.0, width: 16.0, height: 16.0)
var cursor = 0
@@ -151,14 +151,14 @@ extension ctlInputMethod {
}
if isTypingVertical {
- ctlCandidateCurrent.set(
+ ctlInputMethod.ctlCandidateCurrent.set(
windowTopLeftPoint: NSPoint(
x: lineHeightRect.origin.x + lineHeightRect.size.width + 4.0, y: lineHeightRect.origin.y - 4.0
),
bottomOutOfScreenAdjustmentHeight: lineHeightRect.size.height + 4.0
)
} else {
- ctlCandidateCurrent.set(
+ ctlInputMethod.ctlCandidateCurrent.set(
windowTopLeftPoint: NSPoint(x: lineHeightRect.origin.x, y: lineHeightRect.origin.y - 4.0),
bottomOutOfScreenAdjustmentHeight: lineHeightRect.size.height + 4.0
)
diff --git a/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift b/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift
index 20f2ba73..b772cbe5 100644
--- a/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift
+++ b/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift
@@ -132,8 +132,8 @@ extension ctlInputMethod {
private func handle(state: InputState.Deactivated, previous: InputStateProtocol) {
_ = state // 防止格式整理工具毀掉與此對應的參數。
- ctlCandidateCurrent.delegate = nil
- ctlCandidateCurrent.visible = false
+ ctlInputMethod.ctlCandidateCurrent.delegate = nil
+ ctlInputMethod.ctlCandidateCurrent.visible = false
ctlInputMethod.tooltipController.hide()
if let previous = previous as? InputState.NotEmpty {
commit(text: previous.composingBuffer)
@@ -143,7 +143,7 @@ extension ctlInputMethod {
private func handle(state: InputState.Empty, previous: InputStateProtocol) {
_ = state // 防止格式整理工具毀掉與此對應的參數。
- ctlCandidateCurrent.visible = false
+ ctlInputMethod.ctlCandidateCurrent.visible = false
ctlInputMethod.tooltipController.hide()
// 全專案用以判斷「.EmptyIgnoringPreviousState」的地方僅此一處。
if let previous = previous as? InputState.NotEmpty,
@@ -165,7 +165,7 @@ extension ctlInputMethod {
private func handle(state: InputState.Committing, previous: InputStateProtocol) {
_ = previous // 防止格式整理工具毀掉與此對應的參數。
- ctlCandidateCurrent.visible = false
+ ctlInputMethod.ctlCandidateCurrent.visible = false
ctlInputMethod.tooltipController.hide()
let textToCommit = state.textToCommit
if !textToCommit.isEmpty {
@@ -176,7 +176,7 @@ extension ctlInputMethod {
private func handle(state: InputState.Inputting, previous: InputStateProtocol) {
_ = previous // 防止格式整理工具毀掉與此對應的參數。
- ctlCandidateCurrent.visible = false
+ ctlInputMethod.ctlCandidateCurrent.visible = false
ctlInputMethod.tooltipController.hide()
let textToCommit = state.textToCommit
if !textToCommit.isEmpty {
@@ -193,7 +193,7 @@ extension ctlInputMethod {
private func handle(state: InputState.Marking, previous: InputStateProtocol) {
_ = previous // 防止格式整理工具毀掉與此對應的參數。
- ctlCandidateCurrent.visible = false
+ ctlInputMethod.ctlCandidateCurrent.visible = false
setInlineDisplayWithCursor()
if state.tooltip.isEmpty {
ctlInputMethod.tooltipController.hide()
diff --git a/Source/Modules/IMEModules/mgrPrefs.swift b/Source/Modules/IMEModules/mgrPrefs.swift
index 61ef3134..1a8b9e4d 100644
--- a/Source/Modules/IMEModules/mgrPrefs.swift
+++ b/Source/Modules/IMEModules/mgrPrefs.swift
@@ -58,6 +58,7 @@ struct UserDef {
static let kInlineDumpPinyinInLieuOfZhuyin = "InlineDumpPinyinInLieuOfZhuyin"
static let kFetchSuggestionsFromUserOverrideModel = "FetchSuggestionsFromUserOverrideModel"
static let kUseFixecCandidateOrderOnSelection = "UseFixecCandidateOrderOnSelection"
+ static let kAutoCorrectReadingCombination = "AutoCorrectReadingCombination"
static let kCandidateTextFontName = "CandidateTextFontName"
static let kCandidateKeyLabelFontName = "CandidateKeyLabelFontName"
@@ -278,6 +279,9 @@ public enum mgrPrefs {
UserDefaults.standard.setDefault(
mgrPrefs.useFixecCandidateOrderOnSelection, forKey: UserDef.kUseFixecCandidateOrderOnSelection
)
+ UserDefaults.standard.setDefault(
+ mgrPrefs.autoCorrectReadingCombination, forKey: UserDef.kAutoCorrectReadingCombination
+ )
UserDefaults.standard.setDefault(mgrPrefs.usingHotKeySCPC, forKey: UserDef.kUsingHotKeySCPC)
UserDefaults.standard.setDefault(mgrPrefs.usingHotKeyAssociates, forKey: UserDef.kUsingHotKeyAssociates)
@@ -360,6 +364,9 @@ public enum mgrPrefs {
@UserDefault(key: UserDef.kUseFixecCandidateOrderOnSelection, defaultValue: false)
static var useFixecCandidateOrderOnSelection: Bool
+ @UserDefault(key: UserDef.kAutoCorrectReadingCombination, defaultValue: true)
+ static var autoCorrectReadingCombination: Bool
+
static var minCandidateLength: Int {
mgrPrefs.allowBoostingSingleKanjiAsUserPhrase ? 1 : 2
}
diff --git a/Source/Modules/LangModelRelated/SubLMs/lmCoreEX.swift b/Source/Modules/LangModelRelated/SubLMs/lmCoreEX.swift
index 6a91e82a..eb049aea 100644
--- a/Source/Modules/LangModelRelated/SubLMs/lmCoreEX.swift
+++ b/Source/Modules/LangModelRelated/SubLMs/lmCoreEX.swift
@@ -91,10 +91,9 @@ extension vChewing {
let neta = strData[$0].split(separator: " ")
if neta.count >= 2, String(neta[0]).first != "#" {
if !neta[0].isEmpty, !neta[1].isEmpty {
- var theKey = shouldReverse ? String(neta[1]) : String(neta[0])
- theKey.cnvPinyinToPhonabet()
+ let theKey = shouldReverse ? String(neta[1]) : String(neta[0])
let theValue = $0
- rangeMap[theKey, default: []].append(theValue)
+ rangeMap[Tekkon.cnvHanyuPinyinToPhona(target: theKey), default: []].append(theValue)
}
}
}
@@ -192,19 +191,3 @@ extension String {
}
}
}
-
-// MARK: - 拼音轉注音
-
-extension String {
- fileprivate mutating func cnvPinyinToPhonabet() {
- if contains("_") { return }
- for key in Tekkon.mapHanyuPinyin.keys {
- guard let value = Tekkon.mapHanyuPinyin[key] else { continue }
- self = replacingOccurrences(of: key, with: value)
- }
- for key in Tekkon.mapArayuruPinyinIntonation.keys {
- guard let value = Tekkon.mapArayuruPinyinIntonation[key] else { continue }
- self = replacingOccurrences(of: key, with: value)
- }
- }
-}
diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings
index e8ca421a..a1f1968f 100644
--- a/Source/Resources/Base.lproj/Localizable.strings
+++ b/Source/Resources/Base.lproj/Localizable.strings
@@ -95,6 +95,7 @@
"at the rear of the phrase (like Microsoft New Phonetic)" = "at the rear of the phrase (like Microsoft New Phonetic)";
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "Auto-convert traditional Chinese glyphs to JIS Shinjitai characters";
"Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters";
+"Automatically correct reading combinations when typing" = "Automatically correct reading combinations when typing";
"Automatically reload user data files if changes detected" = "Automatically reload user data files if changes detected";
"Basic Keyboard Layout:" = "Basic Keyboard Layout:";
"Buffer Limit:" = "Buffer Limit:";
diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings
index e8ca421a..a1f1968f 100644
--- a/Source/Resources/en.lproj/Localizable.strings
+++ b/Source/Resources/en.lproj/Localizable.strings
@@ -95,6 +95,7 @@
"at the rear of the phrase (like Microsoft New Phonetic)" = "at the rear of the phrase (like Microsoft New Phonetic)";
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "Auto-convert traditional Chinese glyphs to JIS Shinjitai characters";
"Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters";
+"Automatically correct reading combinations when typing" = "Automatically correct reading combinations when typing";
"Automatically reload user data files if changes detected" = "Automatically reload user data files if changes detected";
"Basic Keyboard Layout:" = "Basic Keyboard Layout:";
"Buffer Limit:" = "Buffer Limit:";
diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings
index 60618e9b..3c77f330 100644
--- a/Source/Resources/ja.lproj/Localizable.strings
+++ b/Source/Resources/ja.lproj/Localizable.strings
@@ -95,6 +95,7 @@
"at the rear of the phrase (like Microsoft New Phonetic)" = "単語の後で // Microsoft 新注音入力のやり方";
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "入力した繁体字を日文 JIS 新字体と自動変換";
"Auto-convert traditional Chinese glyphs to KangXi characters" = "入力した繁体字を康熙字体と自動変換";
+"Automatically correct reading combinations when typing" = "入力中で打ち間違った発音組み合わせを自動的に訂正する";
"Automatically reload user data files if changes detected" = "ユーザー辞書データの変更を自動検出し、自動的に再読込";
"Basic Keyboard Layout:" = "基礎キーボード:";
"Buffer Limit:" = "緩衝列の容量:";
diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings
index a5ccdf70..653d52fa 100644
--- a/Source/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Source/Resources/zh-Hans.lproj/Localizable.strings
@@ -95,6 +95,7 @@
"at the rear of the phrase (like Microsoft New Phonetic)" = "将游标置于词语后方 // Windows 微软新注音风格";
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "自动将繁体中文字转为日文 JIS 新字体";
"Auto-convert traditional Chinese glyphs to KangXi characters" = "自动将繁体中文字转为康熙正体字";
+"Automatically correct reading combinations when typing" = "敲字时自动纠正读音组合";
"Automatically reload user data files if changes detected" = "自动检测并载入使用者语汇档案变更";
"Basic Keyboard Layout:" = "基础键盘布局:";
"Buffer Limit:" = "组字区容量:";
diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings
index 733e49fa..45698072 100644
--- a/Source/Resources/zh-Hant.lproj/Localizable.strings
+++ b/Source/Resources/zh-Hant.lproj/Localizable.strings
@@ -95,6 +95,7 @@
"at the rear of the phrase (like Microsoft New Phonetic)" = "將游標置於詞語後方 // Windows 微軟新注音風格";
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "自動將繁體中文字轉為日文 JIS 新字體";
"Auto-convert traditional Chinese glyphs to KangXi characters" = "自動將繁體中文字轉為康熙正體字";
+"Automatically correct reading combinations when typing" = "敲字時自動糾正讀音組合";
"Automatically reload user data files if changes detected" = "自動檢測並載入使用者語彙檔案變更";
"Basic Keyboard Layout:" = "基礎鍵盤佈局:";
"Buffer Limit:" = "組字區容量:";
diff --git a/Source/UI/PrefUI/suiPrefPaneExperience.swift b/Source/UI/PrefUI/suiPrefPaneExperience.swift
index e6273f1c..43f46668 100644
--- a/Source/UI/PrefUI/suiPrefPaneExperience.swift
+++ b/Source/UI/PrefUI/suiPrefPaneExperience.swift
@@ -46,6 +46,8 @@ struct suiPrefPaneExperience: View {
forKey: UserDef.kEscToCleanInputBuffer)
@State private var selEnableSCPCTypingMode = UserDefaults.standard.bool(forKey: UserDef.kUseSCPCTypingMode)
@State private var selComposingBufferSize = UserDefaults.standard.integer(forKey: UserDef.kComposingBufferSize)
+ @State private var selAutoCorrectReadingCombination = UserDefaults.standard.bool(
+ forKey: UserDef.kAutoCorrectReadingCombination)
private let contentWidth: Double = {
switch mgrPrefs.appleLanguages[0] {
case "ja":
@@ -165,6 +167,12 @@ struct suiPrefPaneExperience: View {
}
}
Preferences.Section(label: { Text(LocalizedStringKey("Typing Style:")) }) {
+ Toggle(
+ LocalizedStringKey("Automatically correct reading combinations when typing"),
+ isOn: $selAutoCorrectReadingCombination
+ ).onChange(of: selAutoCorrectReadingCombination) { value in
+ mgrPrefs.autoCorrectReadingCombination = value
+ }
Toggle(
LocalizedStringKey("Emulating select-candidate-per-character mode"), isOn: $selEnableSCPCTypingMode
).onChange(of: selEnableSCPCTypingMode) { value in
diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
index ae6afabc..ef7de2c3 100644
--- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
+++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
@@ -30,16 +30,16 @@
-
+
-
+
-
+
@@ -229,13 +229,13 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -359,7 +359,7 @@
-
+
@@ -378,7 +378,7 @@
-
+
@@ -386,7 +386,7 @@
-
+
@@ -394,7 +394,7 @@
-
+
@@ -419,7 +419,7 @@
-
+
@@ -456,7 +456,7 @@
-
+
@@ -464,7 +464,7 @@
-
+
@@ -489,7 +489,7 @@
-
+
@@ -507,7 +507,7 @@
-
+
@@ -535,7 +535,7 @@
-
+
@@ -591,12 +591,22 @@
+
-
+
@@ -610,17 +620,20 @@
+
+
+
@@ -631,6 +644,7 @@
+
@@ -645,17 +659,17 @@
-
+
-
+
-
+
-
+
@@ -666,7 +680,7 @@
-
+
@@ -681,7 +695,7 @@
-
+
-
+
-
+
-
+
@@ -854,7 +868,7 @@
-
+
@@ -866,7 +880,7 @@
-
+
@@ -878,7 +892,7 @@
-
+
@@ -909,7 +923,7 @@
-
+
@@ -923,7 +937,7 @@
-
+
@@ -953,9 +967,8 @@
-
-
-
+
+
@@ -1045,10 +1058,13 @@
-
-
-
-
+
+
+
+
+
+
+
@@ -1056,15 +1072,13 @@
-
-
-
-
-
-
+
+
+
+
-
+
diff --git a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
index ef10205d..a41eb394 100644
--- a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
@@ -41,6 +41,7 @@
"BSK-bH-Gct.title" = "Auto-convert traditional Chinese glyphs to KangXi characters";
"cf2-se-PDO.title" = "Dictionary and Language Models";
"chkAllowBoostingSingleKanjiAsUserPhrase.title" = "Allow boosting / excluding a candidate of single kanji";
+"chkAutoCorrectReadingCombination.title" = "Automatically correct reading combinations when typing";
"chkFetchSuggestionsFromUserOverrideModel.title" = "Applying typing suggestions from half-life user override model";
"chkUseFixecCandidateOrderOnSelection.title" = "Always use fixed listing order in candidate window";
"dIN-TZ-67g.title" = "Space to +cycle candidates, Shift+Space to +cycle pages";
diff --git a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
index 0c36a8da..e14990c9 100644
--- a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
@@ -41,6 +41,7 @@
"BSK-bH-Gct.title" = "入力した繁体字を康熙字体と自動変換";
"cf2-se-PDO.title" = "辞書と言語モデル";
"chkAllowBoostingSingleKanjiAsUserPhrase.title" = "即排除/即最優先にできる候補の文字数の最低限は1字とする";
+"chkAutoCorrectReadingCombination.title" = "入力中で打ち間違った発音組み合わせを自動的に訂正する";
"chkFetchSuggestionsFromUserOverrideModel.title" = "入力中で臨時記憶モジュールからお薦めの候補を自動的に選ぶ";
"chkUseFixecCandidateOrderOnSelection.title" = "候補文字を固定順番で陳列する";
"dIN-TZ-67g.title" = "Shift+Space で次のページ、Space で次の候補文字を";
diff --git a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
index 18d49824..930f0ec1 100644
--- a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
@@ -41,6 +41,7 @@
"BSK-bH-Gct.title" = "自动将繁体中文字转换为康熙正体字";
"cf2-se-PDO.title" = "辞典&語言模型";
"chkAllowBoostingSingleKanjiAsUserPhrase.title" = "将可以就地升权/排除的候选字词的最短词长设为单个汉字";
+"chkAutoCorrectReadingCombination.title" = "敲字时自动纠正读音组合";
"chkFetchSuggestionsFromUserOverrideModel.title" = "在敲字时自动套用来自半衰记忆模组的建议";
"chkUseFixecCandidateOrderOnSelection.title" = "以固定顺序来陈列选字窗内的候选字";
"dIN-TZ-67g.title" = "Shift+Space 换下一页,Space 换选下一个候选字。";
diff --git a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
index 0bedda26..c25db2ec 100644
--- a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
@@ -41,6 +41,7 @@
"BSK-bH-Gct.title" = "自動將繁體中文字轉換為康熙正體字";
"cf2-se-PDO.title" = "辭典&語言模型";
"chkAllowBoostingSingleKanjiAsUserPhrase.title" = "將可以就地升權/排除的候選字詞的最短詞長設為單個漢字";
+"chkAutoCorrectReadingCombination.title" = "敲字時自動糾正讀音組合";
"chkFetchSuggestionsFromUserOverrideModel.title" = "在敲字時自動套用來自半衰記憶模組的建議";
"chkUseFixecCandidateOrderOnSelection.title" = "以固定順序來陳列選字窗內的候選字";
"dIN-TZ-67g.title" = "Shift+Space 換下一頁,Space 換選下一個候選字";
diff --git a/Update-Info.plist b/Update-Info.plist
index 38db6ae9..a533f61a 100644
--- a/Update-Info.plist
+++ b/Update-Info.plist
@@ -3,9 +3,9 @@
CFBundleShortVersionString
- 1.8.1
+ 1.8.2
CFBundleVersion
- 1981
+ 1982
UpdateInfoEndpoint
https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist
UpdateInfoSite
diff --git a/vChewing.pkgproj b/vChewing.pkgproj
index 91b0b9f3..1a74a316 100644
--- a/vChewing.pkgproj
+++ b/vChewing.pkgproj
@@ -726,7 +726,7 @@
USE_HFS+_COMPRESSION
VERSION
- 1.8.1
+ 1.8.2
TYPE
0
diff --git a/vChewing.xcodeproj/project.pbxproj b/vChewing.xcodeproj/project.pbxproj
index b758fc05..1b14118b 100644
--- a/vChewing.xcodeproj/project.pbxproj
+++ b/vChewing.xcodeproj/project.pbxproj
@@ -1389,7 +1389,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -1399,7 +1399,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewingTests;
@@ -1428,13 +1428,13 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewingTests;
@@ -1465,7 +1465,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
@@ -1486,7 +1486,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewing.vChewingPhraseEditor;
@@ -1515,7 +1515,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -1532,7 +1532,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.vChewing.vChewingPhraseEditor;
@@ -1642,7 +1642,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
@@ -1673,7 +1673,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.inputmethod.vChewing;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1700,7 +1700,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = "";
@@ -1725,7 +1725,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = org.atelierInmu.inputmethod.vChewing;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1747,7 +1747,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -1768,7 +1768,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.atelierInmu.vChewing.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1790,7 +1790,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1981;
+ CURRENT_PROJECT_VERSION = 1982;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -1805,7 +1805,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MARKETING_VERSION = 1.8.1;
+ MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = "org.atelierInmu.vChewing.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";