@@ -38,39 +38,39 @@ def test_apply_lambda(self) -> None:
3838 augmented_apply_lambda = txtaugs .apply_lambda (self .texts )
3939 self .assertTrue (augmented_apply_lambda [0 ] == self .texts [0 ])
4040
41- def test_change_case (self ) -> None :
42- augmented_words = txtaugs .change_case (self .texts [0 ], cadence = 3.0 , case = "upper" )
43- self .assertTrue (
44- augmented_words [0 ]
45- == "THE quick brown 'FOX' couldn't jump OVER the green, GRASSY hill." ,
46- )
47-
48- def test_contractions (self ) -> None :
49- augmented_words = txtaugs .contractions (
50- "I would call him but I do not know where he has gone" , aug_p = 0.7
51- )
52- self .assertTrue (
53- augmented_words [0 ] == "I would call him but I don't know where he's gone"
54- )
55-
56- def test_encode_text_base64_sentence (self ) -> None :
41+ def test_base64_sentence (self ) -> None :
5742 augmented_words = txtaugs .encode_text (
5843 "Hello, world!" , 1 , 1 , 1.0 , Method .SENTENCE , Encoding .BASE64
5944 )
6045 self .assertEqual (augmented_words [0 ], "SGVsbG8sIHdvcmxkIQ==" )
6146
62- def test_encode_text_base64_word (self ) -> None :
47+ def test_base64_word (self ) -> None :
6348 augmented_words_word = txtaugs .encode_text (
6449 "Hello, world!" , 1 , 1 , 1.0 , Method .WORD , Encoding .BASE64
6550 )
6651 self .assertEqual (augmented_words_word [0 ], "SGVsbG8=, world!" )
6752
68- def test_encode_text_base64_char (self ) -> None :
53+ def test_base64_char (self ) -> None :
6954 augmented_words_char = txtaugs .encode_text (
7055 "Hello, world!" , 1 , 1 , 1.0 , Method .CHAR , Encoding .BASE64
7156 )
7257 self .assertEqual (augmented_words_char [0 ], "SA==ello LA== dw==orld IQ==" )
7358
59+ def test_change_case (self ) -> None :
60+ augmented_words = txtaugs .change_case (self .texts [0 ], cadence = 3.0 , case = "upper" )
61+ self .assertTrue (
62+ augmented_words [0 ]
63+ == "THE quick brown 'FOX' couldn't jump OVER the green, GRASSY hill." ,
64+ )
65+
66+ def test_contractions (self ) -> None :
67+ augmented_words = txtaugs .contractions (
68+ "I would call him but I do not know where he has gone" , aug_p = 0.7
69+ )
70+ self .assertTrue (
71+ augmented_words [0 ] == "I would call him but I don't know where he's gone"
72+ )
73+
7474 def test_get_baseline (self ) -> None :
7575 augmented_baseline = txtaugs .get_baseline (self .texts )
7676 self .assertTrue (
@@ -272,6 +272,18 @@ def test_insert_zero_width_chars(self) -> None:
272272 ],
273273 )
274274
275+ def test_leetspeak_sentence (self ) -> None :
276+ augmented_words = txtaugs .encode_text (
277+ "Hello, world!" , 1 , 1 , 1.0 , Method .SENTENCE , Encoding .LEETSPEAK
278+ )
279+ self .assertEqual (augmented_words [0 ], "h3110, w0r1d!" )
280+
281+ def test_leetspeak_word (self ) -> None :
282+ augmented_words = txtaugs .encode_text (
283+ "Hello, world!" , 1 , 1 , 1.0 , Method .WORD , Encoding .LEETSPEAK
284+ )
285+ self .assertEqual (augmented_words [0 ], "h3110, world!" )
286+
275287 def test_merge_words (self ) -> None :
276288 augmented_split_words = txtaugs .merge_words (self .texts , aug_word_p = 0.3 , n = 1 )
277289 self .assertTrue (
0 commit comments