I'm new here. Just found that there is a linguistics community on stack exchange!
I have a TextGrid file that has been output from a forced aligner, webMAUS and I mainly want to understand how to extract specific data from it using a python script and input into a csv file, but I'm not sure how to go about it. I need to be able to run this for large amounts of data.
The data I want to extract is: the duration of the sentence, which is in the first item tier, the duration of the compound "trial offer" and the duration of the phonemes within the compound, 'trial offer' which is found in the last tier. Is there any way to do this? Thank you.
Here is the text grid:
File type = "ooTextFile"
Object class = "TextGrid"
xmin = 0
xmax = 4.360703
tiers? <exists>
size = 3
item []:
item [1]:
class = "IntervalTier"
name = "ORT-MAU"
xmin = 0
xmax = 4.360703
intervals: size = 9
intervals [1]:
xmin = 0.000000
xmax = 1.380000
text = ""
intervals [2]:
xmin = 1.380000
xmax = 1.570000
text = "She"
intervals [3]:
xmin = 1.570000
xmax = 1.800000
text = "told"
intervals [4]:
xmin = 1.800000
xmax = 1.920000
text = "me"
intervals [5]:
xmin = 1.920000
xmax = 2.150000
text = "about"
intervals [6]:
xmin = 2.150000
xmax = 2.230000
text = "the"
intervals [7]:
xmin = 2.230000
xmax = 2.700000
text = "trial"
intervals [8]:
xmin = 2.700000
xmax = 3.010000
text = "offer"
intervals [9]:
xmin = 3.010000
xmax = 4.360703
text = ""
item [2]:
class = "IntervalTier"
name = "KAN-MAU"
xmin = 0
xmax = 4.360703
intervals: size = 9
intervals [1]:
xmin = 0.000000
xmax = 1.380000
text = ""
intervals [2]:
xmin = 1.380000
xmax = 1.570000
text = "S i:"
intervals [3]:
xmin = 1.570000
xmax = 1.800000
text = "t @U l d"
intervals [4]:
xmin = 1.800000
xmax = 1.920000
text = "m i:"
intervals [5]:
xmin = 1.920000
xmax = 2.150000
text = "@ b aU t"
intervals [6]:
xmin = 2.150000
xmax = 2.230000
text = "D @"
intervals [7]:
xmin = 2.230000
xmax = 2.700000
text = "t r aI @ l"
intervals [8]:
xmin = 2.700000
xmax = 3.010000
text = "Q f @"
intervals [9]:
xmin = 3.010000
xmax = 4.360703
text = ""
item [3]:
class = "IntervalTier"
name = "MAU"
xmin = 0
xmax = 4.360703
intervals: size = 23
intervals [1]:
xmin = 0.000000
xmax = 1.380000
text = "<p:>"
intervals [2]:
xmin = 1.380000
xmax = 1.490000
text = "S"
intervals [3]:
xmin = 1.490000
xmax = 1.570000
text = "I"
intervals [4]:
xmin = 1.570000
xmax = 1.700000
text = "t"
intervals [5]:
xmin = 1.700000
xmax = 1.740000
text = "@U"
intervals [6]:
xmin = 1.740000
xmax = 1.800000
text = "l"
intervals [7]:
xmin = 1.800000
xmax = 1.860000
text = "m"
intervals [8]:
xmin = 1.860000
xmax = 1.920000
text = "I"
intervals [9]:
xmin = 1.920000
xmax = 1.960000
text = "@"
intervals [10]:
xmin = 1.960000
xmax = 2.010000
text = "b"
intervals [11]:
xmin = 2.010000
xmax = 2.120000
text = "aU"
intervals [12]:
xmin = 2.120000
xmax = 2.150000
text = "t"
intervals [13]:
xmin = 2.150000
xmax = 2.180000
text = "D"
intervals [14]:
xmin = 2.180000
xmax = 2.230000
text = "@"
intervals [15]:
xmin = 2.230000
xmax = 2.370000
text = "t"
intervals [16]:
xmin = 2.370000
xmax = 2.430000
text = "r"
intervals [17]:
xmin = 2.430000
xmax = 2.580000
text = "aI"
intervals [18]:
xmin = 2.580000
xmax = 2.610000
text = "@"
intervals [19]:
xmin = 2.610000
xmax = 2.700000
text = "l"
intervals [20]:
xmin = 2.700000
xmax = 2.820000
text = "Q"
intervals [21]:
xmin = 2.820000
xmax = 2.920000
text = "f"
intervals [22]:
xmin = 2.920000
xmax = 3.010000
text = "@"
intervals [23]:
xmin = 3.010000
xmax = 4.360703
text = "<p:>"