Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    def test_serialize_no_label_list_ids(self):
        filter = subview.MatchingLabelFilter(labels={'music', 'speech'})

        assert filter.serialize() == '|||music,speech'
Example #5
0
    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)
Example #6
0
    def test_serialize(self):
        label_filter = subview.MatchingLabelFilter(labels={'music', 'speech'},
                                                   label_list_ids={'alpha'})

        assert label_filter.serialize() == 'alpha|||music,speech'