LMCoreEX // Fix the method of detecting leading sharp.

This commit is contained in:
ShikiSuen 2022-06-20 09:25:09 +08:00
parent 450eec2156
commit be0142a481
1 changed files with 3 additions and 3 deletions

View File

@ -88,9 +88,9 @@ extension vChewing {
strData = try String(contentsOfFile: path, encoding: .utf8).replacingOccurrences(of: "\t", with: " ")
strData.ranges(splitBy: "\n").forEach {
let neta = strData[$0].split(separator: " ")
if neta.count >= 2 {
let theKey = shouldReverse ? String(neta[1]) : String(neta[0])
if !neta[0].isEmpty, !neta[1].isEmpty, theKey.first != "#" {
if neta.count >= 2, String(neta[0]).first != "#" {
if !neta[0].isEmpty, !neta[1].isEmpty {
let theKey = shouldReverse ? String(neta[1]) : String(neta[0])
let theValue = $0
rangeMap[theKey, default: []].append(theValue)
}