@@ -53,11 +53,12 @@ namespace analysis {
5353// -----------------------------------------------------------------------------
5454
5555struct normalizing_token_stream ::state_t {
56- icu ::UnicodeString data;
57- icu ::UnicodeString token;
56+ IRESEARCH_ICU_NAMESPACE ::UnicodeString data;
57+ IRESEARCH_ICU_NAMESPACE ::UnicodeString token;
5858 std::string term_buf;
59- const icu::Normalizer2* normalizer; // reusable object owned by ICU
60- std::unique_ptr<icu::Transliterator> transliterator;
59+ const IRESEARCH_ICU_NAMESPACE::Normalizer2*
60+ normalizer; // reusable object owned by ICU
61+ std::unique_ptr<IRESEARCH_ICU_NAMESPACE::Transliterator> transliterator;
6162 const options_t options;
6263
6364 explicit state_t (const options_t & opts) : normalizer{}, options{opts} {}
@@ -82,7 +83,8 @@ constexpr frozen::unordered_map<
8283 {" upper" , analysis::normalizing_token_stream::UPPER},
8384};
8485
85- bool locale_from_slice (VPackSlice slice, icu::Locale& locale) {
86+ bool locale_from_slice (VPackSlice slice,
87+ IRESEARCH_ICU_NAMESPACE::Locale& locale) {
8688 if (!slice.isString ()) {
8789 IRS_LOG_WARN (
8890 absl::StrCat (" Non-string value in '" , LOCALE_PARAM_NAME,
@@ -94,11 +96,11 @@ bool locale_from_slice(VPackSlice slice, icu::Locale& locale) {
9496
9597 const auto locale_name = slice.copyString ();
9698
97- locale = icu ::Locale::createFromName (locale_name.c_str ());
99+ locale = IRESEARCH_ICU_NAMESPACE ::Locale::createFromName (locale_name.c_str ());
98100
99101 if (!locale.isBogus ()) {
100- locale = icu ::Locale{locale. getLanguage (), locale. getCountry (),
101- locale.getVariant ()};
102+ locale = IRESEARCH_ICU_NAMESPACE ::Locale{
103+ locale. getLanguage (), locale. getCountry (), locale.getVariant ()};
102104 }
103105
104106 if (locale.isBogus ()) {
@@ -349,7 +351,8 @@ bool normalizing_token_stream::reset(std::string_view data) {
349351
350352 if (!state_->normalizer ) {
351353 // reusable object owned by ICU
352- state_->normalizer = icu::Normalizer2::getNFCInstance (err);
354+ state_->normalizer =
355+ IRESEARCH_ICU_NAMESPACE::Normalizer2::getNFCInstance (err);
353356
354357 if (!U_SUCCESS (err) || !state_->normalizer ) {
355358 state_->normalizer = nullptr ;
@@ -362,12 +365,13 @@ bool normalizing_token_stream::reset(std::string_view data) {
362365 // transliteration rule taken verbatim from:
363366 // http://userguide.icu-project.org/transforms/general do not allocate
364367 // statically since it causes memory leaks in ICU
365- const icu ::UnicodeString collationRule (
368+ const IRESEARCH_ICU_NAMESPACE ::UnicodeString collationRule (
366369 " NFD; [:Nonspacing Mark:] Remove; NFC" );
367370
368371 // reusable object owned by *this
369- state_->transliterator .reset (icu::Transliterator::createInstance (
370- collationRule, UTransDirection::UTRANS_FORWARD, err));
372+ state_->transliterator .reset (
373+ IRESEARCH_ICU_NAMESPACE::Transliterator::createInstance (
374+ collationRule, UTransDirection::UTRANS_FORWARD, err));
371375
372376 if (!U_SUCCESS (err) || !state_->transliterator ) {
373377 state_->transliterator .reset ();
@@ -382,8 +386,9 @@ bool normalizing_token_stream::reset(std::string_view data) {
382386 return false ;
383387 }
384388
385- state_->data = icu::UnicodeString::fromUTF8 (
386- icu::StringPiece{data.data (), static_cast <int32_t >(data.size ())});
389+ state_->data = IRESEARCH_ICU_NAMESPACE::UnicodeString::fromUTF8 (
390+ IRESEARCH_ICU_NAMESPACE::StringPiece{data.data (),
391+ static_cast <int32_t >(data.size ())});
387392
388393 // normalize unicode
389394 state_->normalizer ->normalize (state_->data , state_->token , err);
0 commit comments