@@ -994,26 +994,25 @@ def test_tri_map_map_unicode_a(self) -> None:
994
994
post_dst = tm .map_dst_fill (dst , '====' , np .array ('====' ).dtype )
995
995
self .assertEqual (post_dst .tolist (), ['a' , 'a' , 'a' , '====' , 'cc' , 'cc' , '====' ])
996
996
997
- # TODO
998
- # def test_tri_map_map_unicode_b(self) -> None:
999
- # src = np.array(['a', 'bbb', 'cc', 'dddd'])
1000
- # dst = np.array(['cc', 'a', 'a', 'a', 'cc'])
1001
-
1002
- # tm = TriMap(len(src), len(dst))
1003
- # tm.register_many(0, np.array([1, 2, 3], dtype=np.dtype(np.int64)))
1004
- # tm.register_one(1, -1)
1005
- # tm.register_many(2, np.array([0, 4], dtype=np.dtype(np.int64)))
1006
- # tm.register_one(3, -1)
1007
- # tm.finalize()
1008
-
1009
- # post_src = tm.map_src_no_fill(src)
1010
- # self.assertEqual(post_src.tolist(), ['a', 'a', 'a', 'bbb', 'cc', 'cc', 'dddd'])
1011
-
1012
- # post_dst1 = tm.map_dst_fill(dst, b'====', np.array(b'====').dtype)
1013
- # self.assertEqual(post_dst1.tolist(), ['a', 'a', 'a', '====', 'cc', 'cc', '===='])
1014
-
1015
- # post_dst2 = tm.map_dst_fill(dst, b'?', np.array(b'?').dtype)
1016
- # self.assertEqual(post_dst2.tolist(), ['a', 'a', 'a', '?', 'cc', 'cc', '?'])
997
+ def test_tri_map_map_unicode_b (self ) -> None :
998
+ src = np .array (['a' , 'bbb' , 'cc' , 'dddd' ])
999
+ dst = np .array (['cc' , 'a' , 'a' , 'a' , 'cc' ])
1000
+
1001
+ tm = TriMap (len (src ), len (dst ))
1002
+ tm .register_many (0 , np .array ([1 , 2 , 3 ], dtype = np .dtype (np .int64 )))
1003
+ tm .register_one (1 , - 1 )
1004
+ tm .register_many (2 , np .array ([0 , 4 ], dtype = np .dtype (np .int64 )))
1005
+ tm .register_one (3 , - 1 )
1006
+ tm .finalize ()
1007
+
1008
+ post_src = tm .map_src_no_fill (src )
1009
+ self .assertEqual (post_src .tolist (), ['a' , 'a' , 'a' , 'bbb' , 'cc' , 'cc' , 'dddd' ])
1010
+
1011
+ post_dst1 = tm .map_dst_fill (dst , b'====' , np .array (b'====' ).dtype )
1012
+ self .assertEqual (post_dst1 .tolist (), ['a' , 'a' , 'a' , '====' , 'cc' , 'cc' , '====' ])
1013
+
1014
+ post_dst2 = tm .map_dst_fill (dst , b'?' , np .array (b'?' ).dtype )
1015
+ self .assertEqual (post_dst2 .tolist (), ['a' , 'a' , 'a' , '?' , 'cc' , 'cc' , '?' ])
1017
1016
1018
1017
def test_tri_map_map_unicode_c (self ) -> None :
1019
1018
src = np .array (['a' , 'bbb' , 'cc' , 'dddd' ])
0 commit comments