Пример #1
0
    def test_strip_pause_only(self):
        pause = Pause(beg=1.25, end=1.95)
        utt_strip = Utterance([pause])

        utt_strip.strip()

        assert_equal(utt_strip.words(), [])
Пример #2
0
 def test_strip_pause_only(self):
     pause = Pause(beg=1.25, end=1.95)
     utt_strip = Utterance([pause])
     
     utt_strip.strip()
     
     assert_equal(utt_strip.words(), [])
Пример #3
0
    def test_strip_end_zero(self):
        zero = Word('', 1.25, 1.25)
        utt_strip = Utterance(self.words + [zero])

        utt_strip.strip()

        assert_not_in(zero, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #4
0
    def test_strip_beg_zero(self):
        zero = Word('', 0.0, 0.0)
        utt_strip = Utterance([zero] + self.words)

        utt_strip.strip()

        assert_not_in(zero, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #5
0
    def test_strip_end_pause(self):
        pause = Pause(beg=1.25, end=1.85)
        utt_strip = Utterance(self.words + [pause])

        utt_strip.strip()

        assert_not_in(pause, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #6
0
    def test_strip_beg_pause(self):
        pause = Pause(beg=0, end=0.55)
        utt_strip = Utterance([pause] + self.words[3:])

        utt_strip.strip()

        assert_not_in(pause, utt_strip)
        assert_equal(utt_strip.words(), self.words[3:])
Пример #7
0
    def test_strip_end_zero(self):
        zero = Word('', 1.25, 1.25)
        utt_strip = Utterance(self.words + [zero])

        utt_strip.strip()

        assert_not_in(zero, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #8
0
    def test_strip_beg_zero(self):
        zero = Word('', 0.0, 0.0)
        utt_strip = Utterance([zero] + self.words)

        utt_strip.strip()

        assert_not_in(zero, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #9
0
    def test_strip_end_pause(self):
        pause = Pause(beg=1.25, end=1.85)
        utt_strip = Utterance(self.words + [pause])

        utt_strip.strip()

        assert_not_in(pause, utt_strip)
        assert_equal(utt_strip.words(), self.words)
Пример #10
0
    def test_strip_beg_pause(self):
        pause = Pause(beg=0, end=0.55)
        utt_strip = Utterance([pause] + self.words[3:])

        utt_strip.strip()

        assert_not_in(pause, utt_strip)
        assert_equal(utt_strip.words(), self.words[3:])
Пример #11
0
    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)
Пример #12
0
    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:])
Пример #13
0
    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)
Пример #14
0
    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:])