ICU-23401 Correctly implement rule LB3, thereby removing a few more states#3975
Draft
eggrobin wants to merge 13 commits into
Draft
ICU-23401 Correctly implement rule LB3, thereby removing a few more states#3975eggrobin wants to merge 13 commits into
eggrobin wants to merge 13 commits into
Conversation
eggrobin
added a commit
to eggrobin/unicodetools
that referenced
this pull request
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The line.txt rules have rule statuses distinguishing mandatory breaks (status UBRK_LINE_HARD=100) from break opportunities (status UBRK_LINE_SOFT=0).
However, they incorrectly return UBRK_LINE_SOFT at end of text unless the last character is a hard line break, contrary to https://www.unicode.org/reports/tr14/#LB3. This is unlikely to matter to callers, as the start and end of text would most likely be special-cased in any actual implementation, but it results in unnecessary splitting of states.
Correcting the rules to treat eot as a hard break removes four states from the state machine, as it no longer needs to make unnecessary distinctions between eot and LF etc.: eggrobin/unicodetools@496e9a0...cb6c98a
Checklist