Read text fragments from a subtitles format text file.

        :param list lines: the lines of the subtitles text file
        :raises: ValueError: if the id regex is not valid

def _read_subtitles(self, lines):
        """
        Read text fragments from a subtitles format text file.

        :param list lines: the lines of the subtitles text file
        :raises: ValueError: if the id regex is not valid
        """
        self.log(u"Parsing fragments from subtitles text format")
        id_format = self._get_id_format()
        lines = [line.strip() for line in lines]
        pairs = []
        i = 1
        current = 0
        while current < len(lines):
            line_text = lines[current]
            if len(line_text) > 0:
                fragment_lines = [line_text]
                following = current + 1
                while (following < len(lines)) and (len(lines[following]) > 0):
                    fragment_lines.append(lines[following])
                    following += 1
                identifier = id_format % i
                pairs.append((identifier, fragment_lines))
                current = following
                i += 1
            current += 1
        self._create_text_fragments(pairs)