示例#1
0
 def test_subset(self):
     subset = {"köstlich/adj".decode("utf-8")}
     am = AmbiguityMap(self.ambig_fname, subset=subset)
     assert len(list(am.source_target_pair_iter())) == 2
示例#2
0
 def test_init_from_file(self):
     am = AmbiguityMap(self.ambig_fname)
     assert len(list(am.source_target_pair_iter())) == 11
     assert am["köstlich/adj".decode("utf-8")] == ["delicious/jj".decode("utf-8"),
                                                    "rich/jj".decode("utf-8")]