mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
fix: fix failed tests and update for clarity
This commit is contained in:
@ -20,8 +20,11 @@ public enum KeyboardLanguage: String, Codable, Equatable, Sendable {
|
||||
}
|
||||
|
||||
public enum LearningType: Int, CaseIterable, Sendable {
|
||||
/// 学習情報は変換結果(output)に反映され、学習情報は更新(input)されます
|
||||
case inputAndOutput
|
||||
/// 学習情報は変換結果(output)に反映されるのみで、学習情報は更新されません
|
||||
case onlyOutput
|
||||
/// 学習情報は一切用いません
|
||||
case nothing
|
||||
|
||||
package var needUpdateMemory: Bool {
|
||||
|
@ -18,8 +18,9 @@ final class LearningMemoryTests: XCTestCase {
|
||||
FileManager.default.createFile(atPath: pauseURL.path, contents: Data())
|
||||
XCTAssertTrue(LongTermLearningMemory.memoryCollapsed(directoryURL: dir))
|
||||
|
||||
// `init`に副作用がある
|
||||
_ = LearningManager()
|
||||
|
||||
// 学習の破壊状態が回復されていることを確認
|
||||
XCTAssertFalse(LongTermLearningMemory.memoryCollapsed(directoryURL: dir))
|
||||
try? FileManager.default.removeItem(at: pauseURL)
|
||||
}
|
||||
@ -29,13 +30,13 @@ final class LearningMemoryTests: XCTestCase {
|
||||
try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
|
||||
defer { try? FileManager.default.removeItem(at: dir) }
|
||||
|
||||
var manager = LearningManager()
|
||||
let manager = LearningManager()
|
||||
var options = ConvertRequestOptions.default
|
||||
options.dictionaryResourceURL = Self.resourceURL
|
||||
options.memoryDirectoryURL = dir
|
||||
options.learningType = .onlyOutput
|
||||
options.learningType = .inputAndOutput
|
||||
options.maxMemoryCount = 32
|
||||
manager.setRequestOptions(options: options)
|
||||
_ = manager.setRequestOptions(options: options)
|
||||
|
||||
let element = DicdataElement(word: "テスト", ruby: "テスト", cid: CIDData.一般名詞.cid, mid: MIDData.一般.mid, value: -10)
|
||||
manager.update(data: [element])
|
||||
|
Reference in New Issue
Block a user