【问题标题】:Praat scripting: How to get rid of "_" in accent tier and it's corresponding syllables in Info Window?Praat 脚本:如何摆脱重音层中的“_”及其在信息窗口中的相应音节?
【发布时间】:2018-01-07 19:19:27
【问题描述】:

我有一个显示口音的点层。我也有一个音节层。我需要用相应的重音提取音节层的标签。我唯一不需要的是在重音层中提取标签“_”和“%”。

到目前为止我的代码:

writeInfo: ""

selectObject: "TextGrid example"

number = Get number of points: 2 #for the accent tier
for n from 1 to number
accent_time = Get time of point: 2, n
syllable = Get interval at time: 1, accent_time #for the syllable tier
syllable$ = Get label of interval: 1, syllable
accent$ = Get label of point: 2, n
    #if accent$ = "_" and "%"
    #don't append syllable
    #endif
appendInfoLine: syllable$, "       ",accent$
endfor

结果:

"Ra:n       H*L
"tOm       H*
gRam       L*H
"tROts       -
"tROts       H*L
"u:       H*L
"tsjo:n       -
"fEst       H*L

我的目标是:

"Ra:n       H*L
"tOm       H*
gRam       L*H
"tROts       H*L
"u:       H*L
"fEst       H*L

【问题讨论】:

    标签: praat


    【解决方案1】:
    writeInfo: ""
    
    selectObject: "TextGrid example"
    
    number = Get number of points: 2 #for the accent tier
    for n from 1 to number
    accent_time = Get time of point: 2, n
    syllable = Get interval at time: 1, accent_time #for the syllable tier
    syllable$ = Get label of interval: 1, syllable
    accent$ = Get label of point: 2, n
        if accent$ <> "_" and accent$ <> "%"
            appendInfoLine: syllable$, "       ",accent$
        endif
    endfor
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-05
      相关资源
      最近更新 更多