LMI // Simplified the construction of the filtered list.

This commit is contained in:
ShikiSuen 2022-10-30 11:32:17 +08:00
parent d8762d78a0
commit 71aafba1c5
1 changed files with 2 additions and 11 deletions

View File

@ -283,14 +283,6 @@ extension vChewingLM {
//
rawAllUnigrams.append(contentsOf: queryDateTimeUnigrams(with: key))
// Swift 使 NSOrderedSet
var filteredList: Set<String> = []
// KeyValuePair
for unigram in lmFiltered.unigramsFor(key: key) {
filteredList.insert(unigram.value)
}
//
if isPhraseReplacementEnabled {
for i in 0..<rawAllUnigrams.count {
@ -300,9 +292,8 @@ extension vChewingLM {
}
}
//
//
rawAllUnigrams.consolidate(filter: filteredList)
//
rawAllUnigrams.consolidate(filter: .init(lmFiltered.unigramsFor(key: key).map(\.value)))
return rawAllUnigrams
}
}