LMInstantiator // Fix a parameter name.
This commit is contained in:
parent
969977f09b
commit
1b86b1b609
|
@ -291,14 +291,14 @@ extension vChewingLM {
|
||||||
|
|
||||||
/// 根據給定的索引鍵和資料值,確認是否有該具體的資料值在庫。
|
/// 根據給定的索引鍵和資料值,確認是否有該具體的資料值在庫。
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - key: 索引鍵陣列。
|
/// - keyArray: 索引鍵陣列。
|
||||||
/// - value: 資料值。
|
/// - value: 資料值。
|
||||||
/// - factoryDictionaryOnly: 是否僅自原廠辭典確認在庫。
|
/// - factoryDictionaryOnly: 是否僅自原廠辭典確認在庫。
|
||||||
/// - Returns: 是否在庫。
|
/// - Returns: 是否在庫。
|
||||||
public func hasKeyValuePairFor(key: [String], value: String, factoryDictionaryOnly: Bool = false) -> Bool {
|
public func hasKeyValuePairFor(keyArray: [String], value: String, factoryDictionaryOnly: Bool = false) -> Bool {
|
||||||
factoryDictionaryOnly
|
factoryDictionaryOnly
|
||||||
? lmCore.unigramsFor(key: key.joined(separator: "-")).map(\.value).contains(value)
|
? lmCore.unigramsFor(key: keyArray.joined(separator: "-")).map(\.value).contains(value)
|
||||||
: unigramsFor(keyArray: key).map(\.value).contains(value)
|
: unigramsFor(keyArray: keyArray).map(\.value).contains(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 給定讀音字串,讓 LMI 給出對應的經過處理的單元圖陣列。
|
/// 給定讀音字串,讓 LMI 給出對應的經過處理的單元圖陣列。
|
||||||
|
|
|
@ -279,8 +279,8 @@ public class LMMgr {
|
||||||
key unigramKey: String
|
key unigramKey: String
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
switch mode {
|
switch mode {
|
||||||
case .imeModeCHS: return lmCHS.hasKeyValuePairFor(key: [unigramKey], value: userPhrase)
|
case .imeModeCHS: return lmCHS.hasKeyValuePairFor(keyArray: [unigramKey], value: userPhrase)
|
||||||
case .imeModeCHT: return lmCHT.hasKeyValuePairFor(key: [unigramKey], value: userPhrase)
|
case .imeModeCHT: return lmCHT.hasKeyValuePairFor(keyArray: [unigramKey], value: userPhrase)
|
||||||
case .imeModeNULL: return false
|
case .imeModeNULL: return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue