(self)
return text_type
Figures out the TextGrid format.
Figures out the TextGrid format.
Figures out the TextGrid format .
def _check_type(self):
    """
        Figures out the TextGrid format.
        """

    m = re.match("(.*)[\r\n](.*)[\r\n](.*)[\r\n](.*)", self.read_file)
    try:
      type_id = m.group(1).strip()
    except AttributeError:
      raise TypeError("Cannot read file -- try TextGrid.load()")
    xmin = m.group(4)
    if type_id == "File type = \"ooTextFile\"":
      if "xmin" not in xmin:
        text_type = "OldooTextFile"
      else:
        text_type = "ooTextFile"
    elif type_id == "\"Praat chronological TextGrid text file\"":
      text_type = "ChronTextFile"
    else:
      raise TypeError("Unknown format '(%s)'", (type_id))
    return text_type
def _check_type ( self ) : m = re . match ( "(.*)[\r\n](.*)[\r\n](.*)[\r\n](.*)" , self . read_file ) try : type_id = m . group ( 1 ) . strip ( ) except AttributeError : raise TypeError ( "Cannot read file -- try TextGrid.load()" ) xmin = m . group ( 4 ) if type_id == "File type = \"ooTextFile\"" : if "xmin" not in xmin : text_type = "OldooTextFile" else : text_type = "ooTextFile" elif type_id == "\"Praat chronological TextGrid text file\"" : text_type = "ChronTextFile" else : raise TypeError ( "Unknown format '(%s)'" , ( type_id ) ) return text_type