Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure from zapping overlapped spans. #6

Closed
ShikiSuen opened this issue Apr 29, 2022 · 2 comments
Closed

Failure from zapping overlapped spans. #6

ShikiSuen opened this issue Apr 29, 2022 · 2 comments

Comments

@ShikiSuen
Copy link
Collaborator

ShikiSuen commented Apr 29, 2022

Test Suite 'All tests' started at 2022-04-30 00:12:54.866
Test Suite 'MegrezTests.xctest' started at 2022-04-30 00:12:54.867
Test Suite 'MegrezTests' started at 2022-04-30 00:12:54.867
Test Case '-[MegrezTests.MegrezTests testInput]' started.
// Start processing
["高科技", "公司", "的", "年中", "獎金", "你這", "這樣"]
 - The generated line above is supposed to be identical to this one. If not, throw:
["高科技", "公司", "的", "年中", "獎金", "你", "這樣"]
@ShikiSuen
Copy link
Collaborator Author

ShikiSuen commented Apr 29, 2022

Memo a modified function block here:

mutating func removeNodeOfLengthGreaterThan(_ length: Int) {
  if length > mutMaximumLength { return }
  var max = 0
  var removalList: Set<Int> = []
  for map in mutLengthNodeMap {
    if map.0 > length {
      removalList.insert(map.0)
    } else if map.0 > max {
      max = map.0
    }
  }
  for (i, key) in removalList.enumerated() {
    mutLengthNodeMap.removeValue(forKey: key)
  }
  mutMaximumLength = max
}

Starting discussion at:
https://forums.swift.org/t/how-to-remove-an-entry-from-an-ordered-dictionary-at-given-index/57051

@ShikiSuen
Copy link
Collaborator Author

原因找到了:Grid.swift 有一處迴圈條件當中的 <= 被寫成 <。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant