X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/3d1f044b704633e2e541231cd17ae9ecf9ad5c7a..340931cb2e044a2141d11567dd0f782524e32994:/icuSources/data/brkitr/rules/line_loose.txt diff --git a/icuSources/data/brkitr/rules/line_loose.txt b/icuSources/data/brkitr/rules/line_loose.txt index f38ea1b5..2794554e 100644 --- a/icuSources/data/brkitr/rules/line_loose.txt +++ b/icuSources/data/brkitr/rules/line_loose.txt @@ -8,7 +8,7 @@ # # Line Breaking Rules # Implement default line breaking as defined by -# Unicode Standard Annex #14 Revision 42 for Unicode 12.0 +# Unicode Standard Annex #14 Revision 44 for Unicode 13.0 # http://www.unicode.org/reports/tr14/, with the following modification: # # Boundaries between hyphens and following letters are suppressed when @@ -76,6 +76,13 @@ $XX = [:LineBreak = Unknown:]; $ZW = [:LineBreak = ZWSpace:]; $ZWJ = [:LineBreak = ZWJ:]; +# OP30 and CP30 are variants of OP and CP that appear in-line in rule LB30 from UAX 14, +# without a formal name. Because ICU rules require multiple uses of the expressions, +# give them a single definition with a name + +$OP30 = [$OP - [\p{ea=F}\p{ea=W}\p{ea=H}]]; +$CP30 = [$CP - [\p{ea=F}\p{ea=W}\p{ea=H}]]; + # By LB9, a ZWJ also behaves as a CM. Including it in the definition of CM avoids having to explicitly # list it in the numerous rules that use CM. # By LB1, SA characters with general categor of Mn or Mc also resolve to CM. @@ -115,7 +122,7 @@ $CANT_CM = [ $SP $BK $CR $LF $NL $ZW $CM]; # Bases that can't take CMs # AL_FOLLOW set of chars that can unconditionally follow an AL # Needed in rules where stand-alone $CM s are treated as AL. # -$AL_FOLLOW = [$BK $CR $LF $NL $ZW $SP $CL $CP $EX $HL $IS $SY $WJ $GL $OP $QU $BA $HY $NS $IN $NU $PR $PO $ALPlus]; +$AL_FOLLOW = [$BK $CR $LF $NL $ZW $SP $CL $CP $EX $HL $IS $SY $WJ $GL $OP30 $QU $BA $HY $NS $IN $NU $PR $PO $ALPlus]; # @@ -218,7 +225,7 @@ $OP $CM* $SP+ $CM+ $AL_FOLLOW?; # by rule 10, stand-alone CM behaves as AL # See issue ICU-20303 -$CanFollowIS = [$BK $CR $LF $NL $SP $ZW $WJ $GL $CL $CP $EX $IS $SY $QU $BA $HY $NS $ALPlus $HL]; +$CanFollowIS = [$BK $CR $LF $NL $SP $ZW $WJ $GL $CL $CP $EX $IS $SY $QU $BA $HY $NS $ALPlus $HL $IN]; $SP $IS / [^ $CanFollowIS $NU $CM]; $SP $IS $CM* $CMX / [^ $CanFollowIS $NU $CM]; @@ -292,16 +299,14 @@ $HL $CM* ($HY | $BA) $CM* [^$CB]?; # (break between HL and SY already disallowed by LB 13 above) $SY $CM* $HL; -# LB 22 -($ALPlus | $HL) $CM* $IN; -^$CM+ $IN; # by rule 10, any otherwise unattached CM behaves as AL -$EX $CM* $IN; -($ID | $EB | $EM) $CM* $IN; -# $IN $CM* $IN; # delete this rule for CSS loose -$NU $CM* $IN; + +# LB 22 Do not break before ellipses +# +[$LB20NonBreaks - $IN] $CM* $IN; # line_loose tailoring +^$CM+ $IN; -# $LB 23 +# LB 23 # ($ALPlus | $HL) $CM* $NU; ^$CM+ $NU; # Rule 10, any otherwise unattached CM behaves as AL @@ -347,15 +352,15 @@ $PR $CM* ($JL | $JV | $JT | $H2 | $H3); $IS $CM* ($ALPlus | $HL); # LB 30 -($ALPlus | $HL | $NU) $CM* $OP; -^$CM+ $OP; # The $CM+ is from rule 10, an unattached CM is treated as AL. -$CP $CM* ($ALPlus | $HL | $NU); +($ALPlus | $HL | $NU) $CM* $OP30; +^$CM+ $OP30; # The $CM+ is from rule 10, an unattached CM is treated as AL. +$CP30 $CM* ($ALPlus | $HL | $NU); # LB 30a Do not break between regional indicators. Break after pairs of them. # Tricky interaction with LB8a: ZWJ x . together with ZWJ acting like a CM. -$RI $CM* $RI / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $CM]]; -$RI $CM* $RI $CM* [$CM-$ZWJ] / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $CM]]; -$RI $CM* $RI $CM* [$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $ZWJ {eof}]; +$RI $CM* $RI / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $CM]]; +$RI $CM* $RI $CM* [$CM-$ZWJ] / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $CM]]; +$RI $CM* $RI $CM* [$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $ZWJ {eof}]; # note: the preceding rule includes {eof} rather than having the last [set] term qualified with '?' # because of the chain-out behavior difference. The rule must chain out only from the [set characters], # not from the preceding $RI or $CM, which it would be able to do if the set were optional.