Beispiel #1
0
    def test_to_praat_overlapping_intervals(self):
        int1 = Interval(0.25, 0.35, 'a')
        int2 = Interval(0.3, 0.4, 'a')
        tier = IntervalTier('abc', 0.25, 1, [int1, int2])

        with assert_raises(ValueError):
            tier.to_praat()
Beispiel #2
0
    def test_to_praat_overlapping_intervals(self):
        int1 = Interval(0.25, 0.35, 'a')
        int2 = Interval(0.3, 0.4, 'a')
        tier = IntervalTier('abc', 0.25, 1, [int1, int2])

        with assert_raises(ValueError):
            tier.to_praat()
Beispiel #3
0
    def test_to_praat(self):
        interval = Interval(0.35, 0.5, 'a')
        tier = IntervalTier('abc', 0.25, 1, [interval])

        expected = ('"IntervalTier" named "abc" \n'
                    'From 0.25 to 1 seconds with 3 intervals\n'
                    '                    0.25                    0.35    '
                    '"" \n'
                    '                    0.35                     0.5    '
                    '"a" \n'
                    '                     0.5                       1    '
                    '"" ')

        assert_equal(tier.to_praat(), expected)
Beispiel #4
0
    def test_to_praat(self):
        interval = Interval(0.35, 0.5, 'a')
        tier = IntervalTier('abc', 0.25, 1, [interval])

        expected = ('"IntervalTier" named "abc" \n'
                    'From 0.25 to 1 seconds with 3 intervals\n'
                    '                    0.25                    0.35    '
                    '"" \n'
                    '                    0.35                     0.5    '
                    '"a" \n'
                    '                     0.5                       1    '
                    '"" ')

        assert_equal(tier.to_praat(), expected)
Beispiel #5
0
    def test_to_praat_late_interval(self):
        interval = Interval(0.25, 1.5, 'a')
        tier = IntervalTier('abc', 0.25, 1, [interval])

        with assert_raises(ValueError):
            tier.to_praat()
Beispiel #6
0
    def test_to_praat_late_interval(self):
        interval = Interval(0.25, 1.5, 'a')
        tier = IntervalTier('abc', 0.25, 1, [interval])

        with assert_raises(ValueError):
            tier.to_praat()