def test_match_single(self): filter = subview.MatchingLabelFilter(labels={'music', 'speech'}, label_list_ids={'alpha'}) assert filter.match(self.utt1, None) assert not filter.match(self.utt2, None) filter = subview.MatchingLabelFilter(labels={'music', 'speech'}, label_list_ids={'bravo'}) assert filter.match(self.utt1, None) assert filter.match(self.utt2, None)
def test_match_single(self, utt_with_noise, utt_without_noise): filter = subview.MatchingLabelFilter(labels={'music', 'speech'}, label_list_ids={'alpha'}) assert filter.match(utt_without_noise, None) assert not filter.match(utt_with_noise, None) filter = subview.MatchingLabelFilter(labels={'music', 'speech'}, label_list_ids={'bravo'}) assert filter.match(utt_without_noise, None) assert filter.match(utt_with_noise, None)
def test_match_all_label_lists(self): filter = subview.MatchingLabelFilter(labels={'music', 'speech'}) assert filter.match(self.utt1, None) assert not filter.match(self.utt2, None)
def test_serialize_no_label_list_ids(self): filter = subview.MatchingLabelFilter(labels={'music', 'speech'}) assert filter.serialize() == '|||music,speech'
def test_match_all_label_lists(self, utt_with_noise, utt_without_noise): filter = subview.MatchingLabelFilter(labels={'music', 'speech'}) assert filter.match(utt_without_noise, None) assert not filter.match(utt_with_noise, None)
def test_serialize(self): label_filter = subview.MatchingLabelFilter(labels={'music', 'speech'}, label_list_ids={'alpha'}) assert label_filter.serialize() == 'alpha|||music,speech'