Skip to content

Commit b23308c

Browse files
lszskyeCopilot
andauthored
Update src/paimon/global_index/lucene/jieba_analyzer.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a04e3c5 commit b23308c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/paimon/global_index/lucene/jieba_analyzer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,14 @@ void JiebaTokenizer::Normalize(const std::unordered_set<std::string>& stop_words
9898
// to lower case
9999
bool is_alphanumeric = true;
100100
for (const auto& c : term) {
101-
if (!std::isalnum(c)) {
101+
if (!std::isalnum(static_cast<unsigned char>(c))) {
102102
is_alphanumeric = false;
103103
break;
104104
}
105105
}
106106
if (is_alphanumeric && !term.empty()) {
107-
std::transform(term.begin(), term.end(), term.begin(), ::tolower);
107+
std::transform(term.begin(), term.end(), term.begin(),
108+
[](char ch) { return static_cast<char>(std::tolower(static_cast<unsigned char>(ch))); });
108109
}
109110
output.emplace_back(term.data(), term.length());
110111
}

0 commit comments

Comments
 (0)