(self)
return oo_file
@return:  A string in OoTextGrid file format.
def to_oo(self):
    """ 
        @return:  A string in OoTextGrid file format.
        """

    oo_file = ""
    oo_file += "File type = \"ooTextFile\"\n"
    oo_file += "Object class = \"TextGrid\"\n\n"
    oo_file += "xmin = ", self.xmin, "\n"
    oo_file += "xmax = ", self.xmax, "\n"
    oo_file += "tiers? <exists>\n"
    oo_file += "size = ", self.size, "\n"
    oo_file += "item []:\n"
    for i in range(len(self.tiers)):
      oo_file += "%4s%s [%s]" % ("", "item", i + 1)
      _curr_tier = self.tiers[i]
      for (x, y) in _curr_tier.header:
        oo_file += "%8s%s = \"%s\"" % ("", x, y)
      if _curr_tier.classid != TEXTTIER:
        for (xmin, xmax, text) in _curr_tier.simple_transcript:
          oo_file += "%12s%s = %s" % ("", "xmin", xmin)
          oo_file += "%12s%s = %s" % ("", "xmax", xmax)
          oo_file += "%12s%s = \"%s\"" % ("", "text", text)
      else:
        for (time, mark) in _curr_tier.simple_transcript:
          oo_file += "%12s%s = %s" % ("", "time", time)
          oo_file += "%12s%s = %s" % ("", "mark", mark)
    return oo_file
def to_oo ( self ) : oo_file = "" oo_file += "File type = \"ooTextFile\"\n" oo_file += "Object class = \"TextGrid\"\n\n" oo_file += "xmin = " , self . xmin , "\n" oo_file += "xmax = " , self . xmax , "\n" oo_file += "tiers? <exists>\n" oo_file += "size = " , self . size , "\n" oo_file += "item []:\n" for i in range ( len ( self . tiers ) ) : oo_file += "%4s%s [%s]" % ( "" , "item" , i + 1 ) _curr_tier = self . tiers [ i ] for ( x , y ) in _curr_tier . header : oo_file += "%8s%s = \"%s\"" % ( "" , x , y ) if _curr_tier . classid != TEXTTIER : for ( xmin , xmax , text ) in _curr_tier . simple_transcript : oo_file += "%12s%s = %s" % ( "" , "xmin" , xmin ) oo_file += "%12s%s = %s" % ( "" , "xmax" , xmax ) oo_file += "%12s%s = \"%s\"" % ( "" , "text" , text ) else : for ( time , mark ) in _curr_tier . simple_transcript : oo_file += "%12s%s = %s" % ( "" , "time" , time ) oo_file += "%12s%s = %s" % ( "" , "mark" , mark ) return oo_file