From d5b36c762d46069213066753b013d22cbb791acf Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 24 Jul 2022 12:59:22 +0800 Subject: [PATCH] LMAssoc. // Remove useless symbols. --- .../LangModelRelated/LMInstantiator.swift | 8 -------- .../LangModelRelated/SubLMs/lmAssociates.swift | 16 ---------------- 2 files changed, 24 deletions(-) diff --git a/Source/Modules/LangModelRelated/LMInstantiator.swift b/Source/Modules/LangModelRelated/LMInstantiator.swift index 96e2bf07..21b4164d 100644 --- a/Source/Modules/LangModelRelated/LMInstantiator.swift +++ b/Source/Modules/LangModelRelated/LMInstantiator.swift @@ -248,14 +248,6 @@ extension vChewing { return !unigramsFor(key: key).isEmpty } - public func associatedPhrasesFor(key: String) -> [String] { - lmAssociates.valuesFor(key: key) - } - - public func hasAssociatedPhrasesFor(key: String) -> Bool { - lmAssociates.hasValuesFor(key: key) - } - public func associatedPhrasesFor(pair: Megrez.KeyValuePaired) -> [String] { lmAssociates.valuesFor(pair: pair) } diff --git a/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift b/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift index bc0776e7..47f15b8c 100644 --- a/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift +++ b/Source/Modules/LangModelRelated/SubLMs/lmAssociates.swift @@ -94,22 +94,6 @@ extension vChewing { // This function will be implemented only if further hard-necessity comes. } - public func valuesFor(key: String) -> [String] { - var pairs: [String] = [] - if let arrRangeRecords: [(Range, Int)] = rangeMap[key] { - for (netaRange, index) in arrRangeRecords { - let neta = strData[netaRange].split(separator: " ") - let theValue: String = .init(neta[index]) - pairs.append(theValue) - } - } - return pairs - } - - public func hasValuesFor(key: String) -> Bool { - rangeMap[key] != nil - } - public func valuesFor(pair: Megrez.KeyValuePaired) -> [String] { var pairs: [String] = [] if let arrRangeRecords: [(Range, Int)] = rangeMap[pair.toNGramKey] {