Class RegexReplace
Defined in File text.h
Inheritance Relationships
Base Type
public mindspore::dataset::TensorTransform
(Class TensorTransform)
Class Documentation
-
class RegexReplace : public mindspore::dataset::TensorTransform
Replace a UTF-8 string tensor with ‘replace’ according to regular expression ‘pattern’.
Public Functions
-
inline explicit RegexReplace(std::string pattern, std::string replace, bool replace_all = true)
Constructor.
- Parameters
pattern – [in] The regex expression patterns.
replace – [in] The string to replace the matched element.
replace_all – [in] Confirm whether to replace all. If false, only replace the first matched element; if true, replace all matched elements (default=true).
-
explicit RegexReplace(const std::vector<char> &pattern, const std::vector<char> &replace, bool replace_all)
Constructor.
- Parameters
pattern – [in] The regex expression patterns. Type should be char of vector.
replace – [in] The string to replace the matched element.
replace_all – [in] Confirm whether to replace all. If false, only replace the first matched element; if true, replace all matched elements (default=true).
-
~RegexReplace() = default
Destructor.
-
inline explicit RegexReplace(std::string pattern, std::string replace, bool replace_all = true)