perf: 同じloudsに対する検索をバルク処理することによって、処理の効率化を実現 (#208)

* perf: 同じloudsに対する検索をバルク処理することによって、処理の効率化を実現

* fix: bug

* test: add typo correction test

* chore: finalize imp;
This commit is contained in:
Miwa
2025-06-27 22:32:46 +09:00
committed by GitHub
parent f60a9a8738
commit f5037e393c
3 changed files with 99 additions and 11 deletions

View File

@ -155,6 +155,26 @@ final class DicdataStoreTests: XCTestCase {
}
}
///
func testMustCorrectTypo() throws {
let dicdataStore = DicdataStore(convertRequestOptions: requestOptions())
let mustWords = [
("タイカクセイ", "大学生"),
("シヨック", "ショック"),
("キヨクイン", "局員"),
("シヨーク", "ジョーク"),
("サリカニ", "ザリガニ"),
("ノクチヒテヨ", "野口英世"),
("オタノフナカ", "織田信長"),
]
for (key, word) in mustWords {
var c = ComposingText()
c.insertAtCursorPosition(key, inputStyle: .direct)
let result = dicdataStore.getLOUDSData(inputData: c, from: 0, to: c.input.endIndex - 1, needTypoCorrection: true)
XCTAssertEqual(result.first(where: {$0.data.word == word})?.data.word, word)
}
}
func testGetLOUDSDataInRange() throws {
let dicdataStore = DicdataStore(convertRequestOptions: requestOptions())
do {