diff --git a/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift b/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift index 676907b0..e5aca9f7 100644 --- a/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift +++ b/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift @@ -62,8 +62,9 @@ extension vChewing { for (lineID, lineContent) in arrData.enumerated() { if !lineContent.hasPrefix("#") { + let lineContent = lineContent.replacingOccurrences(of: "\t", with: " ") if lineContent.components(separatedBy: " ").count < 2 { - if arrData.last != "" { + if lineContent != "", lineContent != " " { IME.prtDebugIntel("Line #\(lineID + 1) Wrecked: \(lineContent)") } continue diff --git a/Source/Modules/LangModelRelated/SubLMs/lmCore.swift b/Source/Modules/LangModelRelated/SubLMs/lmCore.swift index 158fd3ef..8e63ceee 100644 --- a/Source/Modules/LangModelRelated/SubLMs/lmCore.swift +++ b/Source/Modules/LangModelRelated/SubLMs/lmCore.swift @@ -77,7 +77,7 @@ extension vChewing { if !lineContent.hasPrefix("#") { let lineContent = lineContent.replacingOccurrences(of: "\t", with: " ") if lineContent.components(separatedBy: " ").count < 2 { - if arrData.last != "" { + if lineContent != "", lineContent != " " { IME.prtDebugIntel("Line #\(lineID + 1) Wrecked: \(lineContent)") } continue diff --git a/Source/Modules/LangModelRelated/SubLMs/lmLite.swift b/Source/Modules/LangModelRelated/SubLMs/lmLite.swift index b3e8875c..62e3ebac 100644 --- a/Source/Modules/LangModelRelated/SubLMs/lmLite.swift +++ b/Source/Modules/LangModelRelated/SubLMs/lmLite.swift @@ -66,8 +66,9 @@ extension vChewing { for (lineID, lineContent) in arrData.enumerated() { if !lineContent.hasPrefix("#") { + let lineContent = lineContent.replacingOccurrences(of: "\t", with: " ") if lineContent.components(separatedBy: " ").count < 2 { - if arrData.last != "" { + if lineContent != "", lineContent != " " { IME.prtDebugIntel("Line #\(lineID + 1) Wrecked: \(lineContent)") } continue diff --git a/Source/Modules/LangModelRelated/SubLMs/lmReplacements.swift b/Source/Modules/LangModelRelated/SubLMs/lmReplacements.swift index 15793cd3..6b04ac45 100644 --- a/Source/Modules/LangModelRelated/SubLMs/lmReplacements.swift +++ b/Source/Modules/LangModelRelated/SubLMs/lmReplacements.swift @@ -63,8 +63,9 @@ extension vChewing { for (lineID, lineContent) in arrData.enumerated() { if !lineContent.hasPrefix("#") { + let lineContent = lineContent.replacingOccurrences(of: "\t", with: " ") if lineContent.components(separatedBy: " ").count < 2 { - if arrData.last != "" { + if lineContent != "", lineContent != " " { IME.prtDebugIntel("Line #\(lineID + 1) Wrecked: \(lineContent)") } continue