dòng chảy :: hoạt động :: RegexReplace
#include <string_ops.h>
Thay thế các kết quả phù hợp của biểu thức chính quy pattern
trong input
bằng chuỗi thay thế được cung cấp khi rewrite
.
Tóm lược
Nó tuân theo cú pháp re2 ( https://github.com/google/re2/wiki/Syntax )
Tranh luận:
- phạm vi: Một đối tượng Phạm vi
- input: Văn bản được xử lý.
- pattern: Biểu thức chính quy được so khớp trong các chuỗi
input
. - rewrite: Chuỗi ghi lại được thay thế cho biểu thức
pattern
mà nó được khớp trong các chuỗiinput
.
Các thuộc tính tùy chọn (xem Phần Attrs
):
- Replace_global: Nếu True, sự thay thế là toàn cục (nghĩa là, tất cả các kết quả phù hợp của biểu thức chính quy
pattern
trong mỗi chuỗi đầu vào đều được viết lại), nếu không, thay thếrewrite
chỉ được thực hiện cho khớppattern
đầu tiên.
Lợi nhuận:
-
Output
: Văn bản sau khi áp dụng khớp mẫu và viết lại thay thế.
Người xây dựng và Người phá hủy | |
---|---|
RegexReplace (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input pattern, :: tensorflow::Input rewrite) | |
RegexReplace (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input pattern, :: tensorflow::Input rewrite, const RegexReplace::Attrs & attrs) |
Thuộc tính công khai | |
---|---|
operation | |
output |
Chức năng công cộng | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Các chức năng tĩnh công khai | |
---|---|
ReplaceGlobal (bool x) |
Cấu trúc | |
---|---|
tensorflow :: ops :: RegexReplace :: Attrs | Bộ thiết lập thuộc tính tùy chọn cho RegexReplace . |
Thuộc tính công khai
hoạt động
Operation operation
đầu ra
::tensorflow::Output output
Chức năng công cộng
RegexReplace
RegexReplace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input pattern, ::tensorflow::Input rewrite )
RegexReplace
RegexReplace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input pattern, ::tensorflow::Input rewrite, const RegexReplace::Attrs & attrs )
nút
::tensorflow::Node * node() const
toán tử :: tensorflow :: Đầu vào
operator::tensorflow::Input() const
toán tử :: tensorflow :: Đầu ra
operator::tensorflow::Output() const
Các chức năng tĩnh công khai
ReplaceGlobal
Attrs ReplaceGlobal( bool x )