Topics

Check membership of var. in a character vector

Lars Hinrichs
 

I'm having trouble figuring out how PSL works with character vectors. Specifically I'm working on forced-aligned TextGrids (from WebMAUS) and would like to check if a given label is a vowel of interest; if so, conduct formant analysis. So the logic of what I'm trying to do is


if label$ in ("a", "U", "o")

start = Get starting point... tierForPhone 'i'

end = Get end point... tierForPhone 'i'

dur = (end - start)

# routine that extracts F1, F2, F3 at various time points

# and writes to result file

endif



Is "in" a valid operator in PSL? And what is the right way to define the vector of target forms?


Thank you!!!


Lars

Boersma Paul
 

On 5 Nov 2019, at 16:05, lars@... [praat-users] <praat-users-noreply@...> wrote:

the logic of what I'm trying to do is
if label$ in ("a", "U", "o")
currently, the closest thing to this is:

if index (" a U o ", " " + label$ + " ")
_____

Paul Boersma
Professor of Phonetic Sciences, University of Amsterdam

Visiting address: Spuistraat 134, room 632, Amsterdam
Mail: P.O. Box 1642, 1000BP Amsterdam, The Netherlands
Website: http://www.fon.hum.uva.nl/paul/