From 2708c38d8e01569155f2fc4ad5bb5977b6d21fb0 Mon Sep 17 00:00:00 2001 From: Frank Yung-Fong Tang Date: Tue, 4 Jan 2022 10:51:45 -0800 Subject: [PATCH] Revert "ICU-21878 Sync icu4j's CjkBreakEngine to icu4c's" This reverts commit 08c3f99c0882ea84aebadd0fdb73f4d92fad859e. --- icu4c/source/common/dictbe.cpp | 13 ++----------- icu4c/source/test/testdata/rbbitst.txt | 3 --- .../core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt | 3 --- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/icu4c/source/common/dictbe.cpp b/icu4c/source/common/dictbe.cpp index 6b6d4297ad4..36a35c411a9 100644 --- a/icu4c/source/common/dictbe.cpp +++ b/icu4c/source/common/dictbe.cpp @@ -1361,7 +1361,6 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText, // while reversing t_boundary and pushing values to foundBreaks. int32_t prevCPPos = -1; int32_t prevUTextPos = -1; - int correctedNumBreaks = 0; for (int32_t i = numBreaks-1; i >= 0; i--) { int32_t cpPos = t_boundary.elementAti(i); U_ASSERT(cpPos > prevCPPos); @@ -1370,10 +1369,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText, if (utextPos > prevUTextPos) { // Boundaries are added to foundBreaks output in ascending order. U_ASSERT(foundBreaks.size() == 0 || foundBreaks.peeki() < utextPos); - if (!(foundBreaks.contains(utextPos) || utextPos == rangeStart)) { - foundBreaks.push(utextPos, status); - correctedNumBreaks++; - } + foundBreaks.push(utextPos, status); } else { // Normalization expanded the input text, the dictionary found a boundary // within the expansion, giving two boundaries with the same index in the @@ -1385,14 +1381,9 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText, } (void)prevCPPos; // suppress compiler warnings about unused variable - if (!foundBreaks.isEmpty() && foundBreaks.peeki() == rangeEnd) { - foundBreaks.popi(); - correctedNumBreaks--; - } - // inString goes out of scope // inputMap goes out of scope - return correctedNumBreaks; + return numBreaks; } #endif diff --git a/icu4c/source/test/testdata/rbbitst.txt b/icu4c/source/test/testdata/rbbitst.txt index 1948360277d..7fb30c9e8e3 100644 --- a/icu4c/source/test/testdata/rbbitst.txt +++ b/icu4c/source/test/testdata/rbbitst.txt @@ -796,9 +796,6 @@ •ジョージア<400> • - -•[<0>携帯<400>電話<400>]<0>お金<400>が<400>かかる<400>ん<400>です<400>。<0> - # Test for #11723 •アレルギー性<400>結膜炎<400> diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt index 1948360277d..7fb30c9e8e3 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt @@ -796,9 +796,6 @@ •ジョージア<400> • - -•[<0>携帯<400>電話<400>]<0>お金<400>が<400>かかる<400>ん<400>です<400>。<0> - # Test for #11723 •アレルギー性<400>結膜炎<400>