(self, header)
return tiers
Iterates over each tier and grabs tier information.
Iterates over each tier and grabs tier information.
Iterates over each tier and grabs tier information .
def _load_tiers(self, header):
    """
        Iterates over each tier and grabs tier information.
        """

    tiers = []
    if self.text_type == "ChronTextFile":
      m = re.compile(header)
      tier_headers = m.findall(self.read_file)
      tier_re = " \d+.?\d* \d+.?\d*[\r\n]+\"[^\"]*\""
      for i in range(0, self.size):
        tier_info = [tier_headers[i]] + \
        re.findall(str(i + 1) + tier_re, self.read_file)
        tier_info = "\n".join(tier_info)
        tiers.append(Tier(tier_info, self.text_type, self.t_time))
      return tiers

    tier_re = header + "[\s\S]+?(?=" + header + "|$$)"
    m = re.compile(tier_re)
    tier_iter = m.finditer(self.read_file)
    for iterator in tier_iter:
      (begin, end) = iterator.span()
      tier_info = self.read_file[begin:end]
      tiers.append(Tier(tier_info, self.text_type, self.t_time))
    return tiers
def _load_tiers ( self , header ) : tiers = [ ] if self . text_type == "ChronTextFile" : m = re . compile ( header ) tier_headers = m . findall ( self . read_file ) tier_re = " \d+.?\d* \d+.?\d*[\r\n]+\"[^\"]*\"" for i in range ( 0 , self . size ) : tier_info = [ tier_headers [ i ] ] + re . findall ( str ( i + 1 ) + tier_re , self . read_file ) tier_info = "\n" . join ( tier_info ) tiers . append ( Tier ( tier_info , self . text_type , self . t_time ) ) return tiers tier_re = header + "[\s\S]+?(?=" + header + "|$$)" m = re . compile ( tier_re ) tier_iter = m . finditer ( self . read_file ) for iterator in tier_iter : ( begin , end ) = iterator . span ( ) tier_info = self . read_file [ begin : end ] tiers . append ( Tier ( tier_info , self . text_type , self . t_time ) ) return tiers