@@ -171,12 +171,17 @@ def test_info(model_filename):
171
171
with Tagger ().open (model_filename ) as tagger :
172
172
res = tagger .info ()
173
173
174
- assert res .transitions [('sunny' , 'sunny' )] > res .transitions [('sunny' , 'rainy' )]
175
- assert res .state_features [('walk' , 'sunny' )] > res .state_features [('walk' , 'rainy' )]
176
- assert (u'солнце:не светит' , u'rainy' ) in res .state_features
177
- assert res .header ['num_labels' ] == '3'
178
- assert set (res .labels .keys ()) == set (['sunny' , 'rainy' , '好' ])
179
- assert set (res .attributes .keys ()) == set (['shop' , 'walk' , 'clean' , u'солнце:не светит' , 'world' ])
174
+ assert res .transitions [("sunny" , "sunny" )] > res .transitions [("sunny" , "rainy" )]
175
+ assert (
176
+ res .state_features [("walk" , "sunny" )]
177
+ > res .state_features [("walk" , "rainy" )]
178
+ )
179
+ assert ("солнце:не светит" , "rainy" ) in res .state_features
180
+ assert res .header ["num_labels" ] == "3"
181
+ assert set (res .labels .keys ()) == set (["sunny" , "rainy" , "好" ])
182
+ assert set (res .attributes .keys ()) == set (
183
+ ["shop" , "walk" , "clean" , "солнце:не светит" , "world" ]
184
+ )
180
185
181
186
# it shouldn't segfault on a closed tagger
182
187
with pytest .raises (RuntimeError ):
@@ -222,13 +227,13 @@ def test_append_nested_dicts(tmpdir):
222
227
with Tagger ().open (model_filename ) as tagger :
223
228
info = tagger .info ()
224
229
assert set (info .attributes .keys ()) == {
225
- "foo:bar:baz" ,
226
- "foo:spam" ,
227
- "foo:egg:x" ,
228
- "foo:egg:y" ,
229
- "foo:ham:x" ,
230
- "foo:ham:y" ,
231
- "foo:bar:ham" ,
230
+ "foo:bar:baz" ,
231
+ "foo:spam" ,
232
+ "foo:egg:x" ,
233
+ "foo:egg:y" ,
234
+ "foo:ham:x" ,
235
+ "foo:ham:y" ,
236
+ "foo:bar:ham" ,
232
237
}
233
238
234
239
for feat in ["foo:bar:baz" , "foo:spam" , "foo:egg:x" , "foo:egg:y" ]:
0 commit comments