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:
@@ -370,6 +370,19 @@ final class EnglishTypingTests: XCTestCase {
|
||||
XCTAssertFalse(PeriodShortcut.shouldArm(afterSpaceFollowing: "hello "))
|
||||
}
|
||||
|
||||
func testLearningStoreClearRemovesBoosts() {
|
||||
let suiteName = "EnglishLearningStore.clear.\(UUID().uuidString)"
|
||||
let defaults = UserDefaults(suiteName: suiteName)!
|
||||
defer { defaults.removePersistentDomain(forName: suiteName) }
|
||||
|
||||
let store = EnglishLearningStore(defaults: defaults)
|
||||
store.recordAcceptance(of: "hello")
|
||||
XCTAssertGreaterThan(store.boost(for: "hello"), 0)
|
||||
store.clear()
|
||||
XCTAssertEqual(store.boost(for: "hello"), 0)
|
||||
XCTAssertTrue(store.snapshot().isEmpty)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func apply(_ typing: TypingSessionController, _ output: TypingOutput) {
|
||||
typing.syncAutocapitalization(
|
||||
|
||||
Reference in New Issue
Block a user