Transform a list of at least 4 time values
        (corresponding to at least 3 intervals)
        into a sync map fragment list and store it internally.
        The first interval is a HEAD, the last is a TAIL.

        For example:

            time_values=[0.000, 1.000, 2.000, 3.456] => [(0.000, 1.000), (1.000, 2.000), (2.000, 3.456)]

        :param text_file: the text file containing the text fragments associated
        :type  text_file: :class:`~aeneas.textfile.TextFile`
        :param time_values: the time values
        :type  time_values: list of :class:`~aeneas.exacttiming.TimeValue`
        :raises: TypeError: if ``text_file`` is not an instance of :class:`~aeneas.textfile.TextFile`
                            or ``time_values`` is not a list
        :raises: ValueError: if ``time_values`` has length less than four

def intervals_to_fragment_list(self, text_file, time_values):
        """
        Transform a list of at least 4 time values
        (corresponding to at least 3 intervals)
        into a sync map fragment list and store it internally.
        The first interval is a HEAD, the last is a TAIL.

        For example:

            time_values=[0.000, 1.000, 2.000, 3.456] => [(0.000, 1.000), (1.000, 2.000), (2.000, 3.456)]

        :param text_file: the text file containing the text fragments associated
        :type  text_file: :class:`~aeneas.textfile.TextFile`
        :param time_values: the time values
        :type  time_values: list of :class:`~aeneas.exacttiming.TimeValue`
        :raises: TypeError: if ``text_file`` is not an instance of :class:`~aeneas.textfile.TextFile`
                            or ``time_values`` is not a list
        :raises: ValueError: if ``time_values`` has length less than four
        """
        if not isinstance(text_file, TextFile):
            self.log_exc(u"text_file is not an instance of TextFile", None, True, TypeError)
        if not isinstance(time_values, list):
            self.log_exc(u"time_values is not a list", None, True, TypeError)
        if len(time_values) < 4:
            self.log_exc(u"time_values has length < 4", None, True, ValueError)
        self.log(u"Converting time values to fragment list...")
        begin = time_values[0]
        end = time_values[-1]
        self.log([u"  Creating SyncMapFragmentList with begin %.3f and end %.3f", begin, end])
        self.smflist = SyncMapFragmentList(
            begin=begin,
            end=end,
            rconf=self.rconf,
            logger=self.logger
        )
        self.log(u"  Creating HEAD fragment")
        self.smflist.add(SyncMapFragment(
            # NOTE lines and filtered lines MUST be set,
            #      otherwise some output format might break
            #      when adding HEAD/TAIL to output
            text_fragment=TextFragment(identifier=u"HEAD", lines=[], filtered_lines=[]),
            begin=time_values[0],
            end=time_values[1],
            fragment_type=SyncMapFragment.HEAD
        ), sort=False)
        self.log(u"  Creating REGULAR fragments")
        # NOTE text_file.fragments() returns a list,
        #      so we cache a copy here instead of
        #      calling it once per loop
        fragments = text_file.fragments
        for i in range(1, len(time_values) - 2):
            self.log([u"    Adding fragment %d ...", i])
            self.smflist.add(SyncMapFragment(
                text_fragment=fragments[i - 1],
                begin=time_values[i],
                end=time_values[i + 1],
                fragment_type=SyncMapFragment.REGULAR
            ), sort=False)
            self.log([u"    Adding fragment %d ... done", i])
        self.log(u"  Creating TAIL fragment")
        self.smflist.add(SyncMapFragment(
            # NOTE lines and filtered lines MUST be set,
            #      otherwise some output format might break
            #      when adding HEAD/TAIL to output
            text_fragment=TextFragment(identifier=u"TAIL", lines=[], filtered_lines=[]),
            begin=time_values[len(time_values) - 2],
            end=end,
            fragment_type=SyncMapFragment.TAIL
        ), sort=False)
        self.log(u"Converting time values to fragment list... done")
        self.log(u"Sorting fragment list...")
        self.smflist.sort()
        self.log(u"Sorting fragment list... done")
        return self.smflist