LMAssoc. // Also check entries with Hanyu-pinyin key.
This commit is contained in:
parent
91eff4deb7
commit
affd330e91
|
@ -102,6 +102,8 @@ extension vChewing {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func valuesFor(pair: Megrez.KeyValuePaired) -> [String] {
|
public func valuesFor(pair: Megrez.KeyValuePaired) -> [String] {
|
||||||
|
var pairPinyin = pair
|
||||||
|
pairPinyin.key = Tekkon.cnvPhonaToHanyuPinyin(target: pairPinyin.key)
|
||||||
var pairs: [String] = []
|
var pairs: [String] = []
|
||||||
if let arrRangeRecords: [(Range<String.Index>, Int)] = rangeMap[pair.toNGramKey] {
|
if let arrRangeRecords: [(Range<String.Index>, Int)] = rangeMap[pair.toNGramKey] {
|
||||||
for (netaRange, index) in arrRangeRecords {
|
for (netaRange, index) in arrRangeRecords {
|
||||||
|
@ -110,6 +112,13 @@ extension vChewing {
|
||||||
pairs.append(theValue)
|
pairs.append(theValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let arrRangeRecords: [(Range<String.Index>, Int)] = rangeMap[pairPinyin.toNGramKey] {
|
||||||
|
for (netaRange, index) in arrRangeRecords {
|
||||||
|
let neta = strData[netaRange].split(separator: " ")
|
||||||
|
let theValue: String = .init(neta[index])
|
||||||
|
pairs.append(theValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
if let arrRangeRecords: [(Range<String.Index>, Int)] = rangeMap[pair.value] {
|
if let arrRangeRecords: [(Range<String.Index>, Int)] = rangeMap[pair.value] {
|
||||||
for (netaRange, index) in arrRangeRecords {
|
for (netaRange, index) in arrRangeRecords {
|
||||||
let neta = strData[netaRange].split(separator: " ")
|
let neta = strData[netaRange].split(separator: " ")
|
||||||
|
|
Loading…
Reference in New Issue