From 79f474549490324883248c19f65653a90b4e4827 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Thu, 21 Mar 2024 18:28:51 +0100 Subject: [PATCH] ICU-22707 UTC-179-C25 Limit LB21a to the Hebrew-hyphen-non-Hebrew case --- icu4c/source/data/brkitr/rules/line.txt | 6 +++--- icu4c/source/test/intltest/rbbitst.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/icu4c/source/data/brkitr/rules/line.txt b/icu4c/source/data/brkitr/rules/line.txt index 762adeb5ea0..098286f7c58 100644 --- a/icu4c/source/data/brkitr/rules/line.txt +++ b/icu4c/source/data/brkitr/rules/line.txt @@ -341,10 +341,10 @@ $LB20NonBreaks $CM* ($BA | $HY | $NS); $BB $CM* [^$CB]; # $BB x $BB $CM* $LB20NonBreaks; -# LB 21a Don't break after Hebrew + Hyphen -# HL (HY | BA) x +# LB 21a Do not break after the hyphen in Hebrew + Hyphen + non-Hebrew +# HL (HY | BA) x [^HL] # -$HL $CM* ($HY | $BA) $CM* [^$CB]?; +$HL $CM* ($HY | $BA) $CM* [^$CB $HL]?; # LB 21b (forward) Don't break between SY and HL # (break between HL and SY already disallowed by LB 13 above) diff --git a/icu4c/source/test/intltest/rbbitst.cpp b/icu4c/source/test/intltest/rbbitst.cpp index 03f74db4295..805887d6298 100644 --- a/icu4c/source/test/intltest/rbbitst.cpp +++ b/icu4c/source/test/intltest/rbbitst.cpp @@ -3343,9 +3343,9 @@ int32_t RBBILineMonkey::next(int32_t startPos) { continue; } - if (fHL->contains(prevCharX2) && - (fHY->contains(prevChar) || fBA->contains(prevChar))) { - setAppliedRule(pos, "LB 21a HL (HY | BA) x"); + if (fHL->contains(prevCharX2) && (fHY->contains(prevChar) || fBA->contains(prevChar)) && + !fHL->contains(thisChar)) { + setAppliedRule(pos, "LB 21a HL (HY | BA) x [^HL]"); continue; }