mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
perf: 同じloudsに対する検索をバルク処理することによって、処理の効率化を実現 (#208)
* perf: 同じloudsに対する検索をバルク処理することによって、処理の効率化を実現 * fix: bug * test: add typo correction test * chore: finalize imp;
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user