mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
fix: now FullInputProcessing.swift natively works with new index system
This commit is contained in:
@ -14,19 +14,19 @@ final class ClauseDataUnitTests: XCTestCase {
|
||||
do {
|
||||
let unit1 = ClauseDataUnit()
|
||||
unit1.text = "僕が"
|
||||
unit1.range = .input(from: 0, to: 3)
|
||||
unit1.ranges = [.input(from: 0, to: 3)]
|
||||
unit1.mid = 0
|
||||
unit1.nextLcid = 0
|
||||
|
||||
let unit2 = ClauseDataUnit()
|
||||
unit2.text = "走る"
|
||||
unit2.range = .input(from: 3, to: 6)
|
||||
unit2.ranges = [.input(from: 3, to: 6)]
|
||||
unit2.mid = 1
|
||||
unit2.nextLcid = 1
|
||||
|
||||
unit1.merge(with: unit2)
|
||||
XCTAssertEqual(unit1.text, "僕が走る")
|
||||
XCTAssertEqual(unit1.range, .input(from: 0, to: 6))
|
||||
XCTAssertEqual(unit1.ranges, [.input(from: 0, to: 3), .input(from: 3, to: 6)])
|
||||
XCTAssertEqual(unit1.nextLcid, 1)
|
||||
XCTAssertEqual(unit1.mid, 0)
|
||||
}
|
||||
@ -34,19 +34,19 @@ final class ClauseDataUnitTests: XCTestCase {
|
||||
do {
|
||||
let unit1 = ClauseDataUnit()
|
||||
unit1.text = "君は"
|
||||
unit1.range = .input(from: 0, to: 3)
|
||||
unit1.ranges = [.input(from: 0, to: 3)]
|
||||
unit1.mid = 0
|
||||
unit1.nextLcid = 0
|
||||
|
||||
let unit2 = ClauseDataUnit()
|
||||
unit2.text = "笑った"
|
||||
unit2.range = .input(from: 3, to: 7)
|
||||
unit2.ranges = [.input(from: 3, to: 7)]
|
||||
unit2.mid = 3
|
||||
unit2.nextLcid = 3
|
||||
|
||||
unit1.merge(with: unit2)
|
||||
XCTAssertEqual(unit1.text, "君は笑った")
|
||||
XCTAssertEqual(unit1.range, .input(from: 0, to: 7))
|
||||
XCTAssertEqual(unit1.ranges, [.input(from: 0, to: 3), .input(from: 3, to: 7)])
|
||||
XCTAssertEqual(unit1.nextLcid, 3)
|
||||
XCTAssertEqual(unit1.mid, 0)
|
||||
}
|
||||
|
@ -58,13 +58,13 @@ final class RegisteredNodeTests: XCTestCase {
|
||||
let clause1 = ClauseDataUnit()
|
||||
clause1.text = "我輩は"
|
||||
clause1.nextLcid = CIDData.一般名詞.cid
|
||||
clause1.range = .input(from: 0, to: 5)
|
||||
clause1.ranges = [.input(from: 0, to: 5)]
|
||||
clause1.mid = 1
|
||||
|
||||
let clause2 = ClauseDataUnit()
|
||||
clause2.text = "猫です"
|
||||
clause2.nextLcid = CIDData.EOS.cid
|
||||
clause2.range = .input(from: 5, to: 9)
|
||||
clause2.ranges = [.input(from: 5, to: 9)]
|
||||
clause2.mid = 3
|
||||
|
||||
let expectedResult: CandidateData = CandidateData(
|
||||
|
Reference in New Issue
Block a user