LMs // Ensuring Hanyu-Pinyin keys are read in lowercase.

This commit is contained in:
ShikiSuen 2022-08-10 09:00:07 +08:00
parent 5468aad663
commit 79ffff39f4
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ extension vChewing {
} }
let arrTarget = target.dropLast().dropFirst().split(separator: ",") let arrTarget = target.dropLast().dropFirst().split(separator: ",")
guard arrTarget.count == 2 else { return target } guard arrTarget.count == 2 else { return target }
return "(\(Tekkon.cnvHanyuPinyinToPhona(target: String(arrTarget[0]))),\(arrTarget[1]))" return "(\(Tekkon.cnvHanyuPinyinToPhona(target: String(arrTarget[0]).lowercased())),\(arrTarget[1]))"
} }
@discardableResult public mutating func open(_ path: String) -> Bool { @discardableResult public mutating func open(_ path: String) -> Bool {

View File

@ -77,7 +77,7 @@ extension vChewing {
if !neta[0].isEmpty, !neta[1].isEmpty { if !neta[0].isEmpty, !neta[1].isEmpty {
let theKey = shouldReverse ? String(neta[1]) : String(neta[0]) let theKey = shouldReverse ? String(neta[1]) : String(neta[0])
let theValue = $0 let theValue = $0
rangeMap[Tekkon.cnvHanyuPinyinToPhona(target: theKey), default: []].append(theValue) rangeMap[Tekkon.cnvHanyuPinyinToPhona(target: theKey.lowercased()), default: []].append(theValue)
} }
} }
} }