Skip to content

Commit a580eb0

Browse files
cantoniostf-text-github-robot
authored andcommitted
kernels: Remove use of icu::UnicodeStringAppendable
UnicodeStringAppendable is not needed. icu::UnicodeString can also be appended to. PiperOrigin-RevId: 778169345
1 parent 5564b82 commit a580eb0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tensorflow_text/core/kernels/whitespace_tokenizer_config_builder.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <iterator>
1818
#include <string>
1919

20-
#include "icu4c/source/common/unicode/appendable.h"
2120
#include "icu4c/source/common/unicode/bytestream.h"
2221
#include "icu4c/source/common/unicode/edits.h"
2322
#include "icu4c/source/common/unicode/normalizer2.h"
@@ -40,11 +39,10 @@ namespace text {
4039

4140
std::string BuildWhitespaceString() {
4241
icu::UnicodeString unicode_string;
43-
icu::UnicodeStringAppendable appendable_unicode_string(unicode_string);
4442
// The maximum codepoint in Unicode is 0x0010FFFF.
4543
for (UChar32 cp = 0; cp <= 0x0010FFFF; ++cp) {
4644
if (U_IS_UNICODE_CHAR(cp) && u_isUWhiteSpace(cp)) {
47-
appendable_unicode_string.appendCodePoint(cp);
45+
unicode_string.append(cp);
4846
}
4947
}
5048
std::string str;

0 commit comments

Comments
 (0)