def test_strip_end_multiple(self): pause = Pause(beg=1.25, end=1.95) zero = Word('', 1.95, 1.95) utt_strip = Utterance() utt_strip._words = self.words + [pause, zero] utt_strip.strip() for entry in {pause, zero}: assert_not_in(entry, utt_strip) assert_equal(utt_strip.words(), self.words)
def test_strip_end_multiple(self): pause = Pause(beg=1.25, end=1.95) zero = Word('', 1.95, 1.95) utt_strip = Utterance() utt_strip._words = self.words + [pause, zero] utt_strip.strip() for entry in {pause, zero}: assert_not_in(entry, utt_strip) assert_equal(utt_strip.words(), self.words)
def test_strip_beg_multiple(self): pause = Pause(beg=0, end=0.39) zero = Word('', 0.39, 0.39) utt_strip = Utterance() utt_strip._words = [pause, zero] + self.words[2:] utt_strip.strip() for entry in {pause, zero}: assert_not_in(entry, utt_strip) assert_equal(utt_strip.words(), self.words[2:])
def test_strip_beg_multiple(self): pause = Pause(beg=0, end=0.39) zero = Word('', 0.39, 0.39) utt_strip = Utterance() utt_strip._words = [pause, zero] + self.words[2:] utt_strip.strip() for entry in {pause, zero}: assert_not_in(entry, utt_strip) assert_equal(utt_strip.words(), self.words[2:])