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:
@@ -0,0 +1,18 @@
|
||||
// TypingHabitStore.swift
|
||||
// OSGKeyboard · Shared
|
||||
//
|
||||
// Cross-language "forget" for implicit typing habits. Ranking stays
|
||||
// language-specific (EnglishLearningStore vs librime userdb).
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum TypingHabitStore {
|
||||
/// Clears English boosts and Chinese Rime user dictionaries.
|
||||
/// Does not touch PersonalDictionary / osg_personal.
|
||||
public static func clearAll(
|
||||
englishStore: EnglishLearningStore = EnglishLearningStore()
|
||||
) async throws {
|
||||
englishStore.clear()
|
||||
try await RimeResourceInstaller.shared.clearUserDictionary()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user