0

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

到目前为止我的代码:

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
4

1 回答 1

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
于 2018-01-07T11:19:27.057 回答