feat(keyboard): rank pinyin by habit and persist user dictionaries

Erase dialect syllables before abbrev so wom prefers 我们, flush librime
on leave, and add a settings action to forget learned Chinese and English order.
This commit is contained in:
Rocky
2026-08-14 21:49:03 +08:00
parent 2c3a3f80f3
commit b13a1e904b
15 changed files with 588 additions and 5 deletions
@@ -35,6 +35,10 @@ public final class EnglishLearningStore: @unchecked Sendable {
(defaults.dictionary(forKey: Self.defaultsKey) as? [String: Int]) ?? [:]
}
public func clear() {
defaults.removeObject(forKey: Self.defaultsKey)
}
private func mutate(word: String, delta: Int) {
let key = word.lowercased()
guard !key.isEmpty else { return }