UOM // Fix an issue which generates wrecked trigram keys.
This commit is contained in:
parent
16750e4bde
commit
bddbca6413
|
@ -363,20 +363,24 @@ extension vChewingLM.LMUserOverride {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if arrNodes.count >= 2,
|
func checkKeyValueValidityInThisContext(_ target: Megrez.KeyValuePaired) -> Bool {
|
||||||
!kvPrevious.joinedKey().contains("_"),
|
!target.joinedKey().contains("_") && target.joinedKey().split(separator: "-").count == target.value.count
|
||||||
kvPrevious.joinedKey().split(separator: "-").count == kvPrevious.value.count
|
|
||||||
{
|
|
||||||
kvPrevious = arrNodes[1].currentPair
|
|
||||||
readingStack = kvPrevious.joinedKey() + readingStack
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if arrNodes.count >= 3,
|
if arrNodes.count >= 2 {
|
||||||
!kvAnterior.joinedKey().contains("_"),
|
let maybeKvPrevious = arrNodes[1].currentPair
|
||||||
kvAnterior.joinedKey().split(separator: "-").count == kvAnterior.value.count
|
if checkKeyValueValidityInThisContext(maybeKvPrevious) {
|
||||||
{
|
kvPrevious = maybeKvPrevious
|
||||||
kvAnterior = arrNodes[2].currentPair
|
readingStack = kvPrevious.joinedKey() + readingStack
|
||||||
readingStack = kvAnterior.joinedKey() + readingStack
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if arrNodes.count >= 3 {
|
||||||
|
let maybeKvAnterior = arrNodes[2].currentPair
|
||||||
|
if checkKeyValueValidityInThisContext(maybeKvAnterior) {
|
||||||
|
kvAnterior = maybeKvAnterior
|
||||||
|
readingStack = kvAnterior.joinedKey() + readingStack
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue