mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Support re2 == 2023-06-02 (#16257)
### Description
google/re2 [was
switched](49d776b9d2)
to absl::string_view in version 2023-06-02.
As `absl::string_view` is a drop-in replacement for `std::string_view`
it does not have `as_string()` method.
This PR ensures the forward compatibility with the newest versions of
re2 library.
This commit is contained in:
parent
b07b647f66
commit
a3a443c804
1 changed files with 2 additions and 2 deletions
|
|
@ -242,7 +242,7 @@ Status Tokenizer::SeparatorExpressionTokenizer(OpKernelContext* ctx,
|
|||
token_len, utf8_chars);
|
||||
if (!valid) {
|
||||
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
|
||||
"Match contains invalid utf8 chars: " + submatch.as_string());
|
||||
"Match contains invalid utf8 chars: " + std::string{submatch});
|
||||
}
|
||||
if (utf8_chars >= size_t(mincharnum_)) {
|
||||
tokens.emplace_back(text.data() + start_pos, token_len);
|
||||
|
|
@ -384,7 +384,7 @@ Status Tokenizer::TokenExpression(OpKernelContext* ctx,
|
|||
utf8_chars = 0;
|
||||
if (!utf8_len(reinterpret_cast<const unsigned char*>(submatch.data()), token_len, utf8_chars)) {
|
||||
return Status(common::ONNXRUNTIME, common::INVALID_ARGUMENT,
|
||||
"Match contains invalid utf8 chars: " + submatch.as_string());
|
||||
"Match contains invalid utf8 chars: " + std::string{submatch});
|
||||
}
|
||||
if (utf8_chars >= size_t(mincharnum_)) {
|
||||
row.push_back(submatch);
|
||||
|
|
|
|||
Loading…
Reference in a new issue