@@ -14,6 +14,8 @@ You may obtain a copy of the License at
1414 limitations under the License.
1515******************************************************************************/
1616
17+ using Tensorflow . Framework ;
18+
1719namespace Tensorflow
1820{
1921 public partial class tensorflow
@@ -24,6 +26,30 @@ public class StringsApi
2426 {
2527 string_ops ops = new string_ops ( ) ;
2628
29+ /// <summary>
30+ /// Converts all uppercase characters into their respective lowercase replacements.
31+ /// </summary>
32+ /// <param name="input"></param>
33+ /// <param name="encoding"></param>
34+ /// <param name="name"></param>
35+ /// <returns></returns>
36+ public Tensor lower ( Tensor input , string encoding = "" , string name = null )
37+ => ops . lower ( input : input , encoding : encoding , name : name ) ;
38+
39+ /// <summary>
40+ ///
41+ /// </summary>
42+ /// <param name="input"></param>
43+ /// <param name="pattern"></param>
44+ /// <param name="rewrite"></param>
45+ /// <param name="replace_global"></param>
46+ /// <param name="name"></param>
47+ /// <returns></returns>
48+ public Tensor regex_replace ( Tensor input , string pattern , string rewrite ,
49+ bool replace_global = true , string name = null )
50+ => ops . regex_replace ( input , pattern , rewrite ,
51+ replace_global : replace_global , name : name ) ;
52+
2753 /// <summary>
2854 /// Return substrings from `Tensor` of strings.
2955 /// </summary>
@@ -40,6 +66,27 @@ public Tensor substr(Tensor input, int pos, int len,
4066 public Tensor substr ( string input , int pos , int len ,
4167 string name = null , string @uint = "BYTE" )
4268 => ops . substr ( input , pos , len , @uint : @uint , name : name ) ;
69+
70+ /// <summary>
71+ /// String lengths of `input`.
72+ /// </summary>
73+ /// <param name="input"></param>
74+ /// <param name="name"></param>
75+ /// <param name="unit"></param>
76+ /// <returns></returns>
77+ public Tensor string_length ( Tensor input , string name = null , string unit = "BYTE" )
78+ => ops . string_length ( input , name : name , unit : unit ) ;
79+
80+ public RaggedTensor split ( Tensor input , string sep = "" , int maxsplit = - 1 , string name = null )
81+ => ops . string_split_v2 ( input , sep : sep , maxsplit : maxsplit , name : name ) ;
82+
83+ public ( RaggedTensor , RaggedTensor ) unicode_decode_with_offsets ( Tensor input , string input_encoding ,
84+ string errors = "replace" , int replacement_char = 0xFFFD ,
85+ bool replace_control_characters = false , string name = null )
86+ => ops . unicode_decode_with_offsets ( input , input_encoding , errors ,
87+ replacement_char : replacement_char ,
88+ replace_control_characters : replace_control_characters ,
89+ name : name ) ;
4390 }
4491 }
4592}
0 commit comments