Skip to content

Commit

Permalink
Fixed loop through parallel intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandomunoz committed Oct 4, 2018
1 parent 248ded4 commit d8e58fc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/add_word_tier.praat
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
include ./../procedures/string2interval.proc

form Add word tier
natural Input_tier
natural Input_tier 1
endform

# Get TextGrid info
tg = selected("TextGrid")
word_tier = input_tier
phrase_tier = input_tier

## Duplicate tier
Duplicate tier: word_tier, word_tier, "word"
## Duplicate phrase tier
Duplicate tier: phrase_tier, phrase_tier, "word"
word_tier = phrase_tier
phrase_tier += 1

# Segment texts from intervals into phonemes
nIntervals = Get number of intervals: word_tier
nIntervals = Get number of intervals: phrase_tier
for interval to nIntervals
selectObject: tg
interval_text$= Get label of interval: word_tier, interval
tmin = Get start time of interval: word_tier, interval
tmax = Get end time of interval: word_tier, interval
interval_text$= Get label of interval: phrase_tier, interval
tmin = Get start time of interval: phrase_tier, interval
tmax = Get end time of interval: phrase_tier, interval
if interval_text$ <> ""
# Create Strings as phonemes
wordList = Create Strings as tokens: interval_text$, " "
Expand Down

0 comments on commit d8e58fc

Please sign in to comment.