我想知道是否有任何Praat脚本可以消除特定层中两个特定段之间的边界。
例如,如果Tier1包含诸如cars这样的单词,而Tier2包含相应的段|k|ɑː|r|z|。如何删除各个目录中所有r|z文件中的r|z之间的边界?
提前谢谢你!
发布于 2022-03-09 12:34:23
欢迎来到这里。如果你给我们一个例子来说明你一直在做的事情,以及为什么它目前不起作用,那就更容易帮上忙了。
每个TextGrid只包含一个单词吗?如果是这样的话,将其添加到遍历文件的脚本中。我把它放在一个玩具例子上,但是如果包含这个组合的单词数量未知,就会产生一个问题,因为你会改变你正在循环的边界的数量,并最终尝试读取一个不再存在的间隔。
# Check all intervals in segment tier:
for i from 1 to numberOfIntervals-1
label$ = Get label of interval... segment_tier 'i'
if label$ = "z"
previous_label$ = Get label of interval... segment_tier 'i'-1
if previous_label$ = "r"
selection_start = Get start point: segment_tier, 'i'
Remove boundary at time: segment_tier, selection_start
numberOfIntervals = numberOfIntervals-1
endif
# select the TextGrid so we can iterate to the next interval:
select TextGrid 'soundname$'
endif
endfor在循环到下一个TextGrid之前,还需要保存该:
select TextGrid 'soundname$'
Save as text file... 'textGrid_directory$''soundname$'.TextGrid
Removehttps://stackoverflow.com/questions/71403177
复制相似问题