int ndim = 41;
float eps = 0.2;

# "Silence" is defined as a cough, a breath, a lip smack, or quiet.
# This chunk is at least 50ms long (the "+" signs mean that the states
# loop back to themselves, and can therefore be as long as desired).
# Of course, there is nothing that enforces that the states labelled "cough"
# are actually coughs.   It's really just four different kinds of silence.
macro silence = 2* smack:v=vquiet:+:m=$s$i 3* quiet:s=quiet:+
	| 3* quiet:s=quiet:+ 2* breath:v=vquiet:+:m=$s$i
	;
# All the "v=", "m=", and "s=" stuff involves sharing of variances,
# means, or entire state definitions.     For instance, all the "cough"
# states share a comon variance.    All the "cough0" states share a
# common mean, so they will be the same whether the "silence" macro
# is an initial silence or a silence within an IWS.

# So, a "S" phoneme can include multiple coughs, breaths, quiet, etc.
# We require two silences so that the total duration is >100ms,
# which is what differentiates an audible pause from a stop.
phone S = silence silence:+ ;


macro closure = 2* voiced_closure:+:v=$s:m=$s$i | 2* unvoiced_closure:+:s=quiet ;
macro stop = closure burst0_:+:s=$s burst1_:+:s=$s ;
macro sonorant = 3* semiclosure:+:m=$s$i:v=$s ;
macro voiced_fricative = 4* partial_frication:+:m=$s$i:v=$s ;
macro unvoiced_fricative = 4* frication:+:m=$s$i:v=$s ;
macro c = stop | voiced_fricative | unvoiced_fricative | sonorant ;
# Liason gets stuck between two vowels at French word boundaries.
macro liason = c;
phone C = c ;

#Inter-word spaces.     An IWS is either a single state (10ms long)
# that can help join the two neighbouring phones together
# _or_ it is two or more repetitions of the "silence" macro.
# (And a state for a transition into silence, and a state for transition
# out of silence back to speech.) 

phone IPP_SC = pp_transition:s=SC ;
phone IWP_CC = pp_transition:s=CC | pp_transition:s=CS silence silence:+ pp_transition:s=SC ;
phone IPP_CC = pp_transition:s=CC ;
phone IWP_VC = pp_transition:s=VC | pp_transition:s=VS silence silence:+ pp_transition:s=SC ;
phone IPP_VC = pp_transition:s=VC ;
phone IPP_CS = pp_transition:s=CS ;
# In French, we have liason at V #word V:
phone IWP_VV = pp_transition:s=VV
		| pp_transition:s=VS silence silence:+ pp_transition:s=SV
		| pp_transition:s=VC liason  pp_transition:s=CV ;
phone IPP_VV = pp_transition:s=VV ;
# IPP_VVL is used where we know there is no pause, but liason is possible.
phone IPP_VVL = pp_transition:s=VV
		| pp_transition:s=VC liason  pp_transition:s=CV ;
phone IPP_SV = pp_transition:s=SV ;
phone IWP_CV = pp_transition:s=CV | pp_transition:s=CS silence silence:+ pp_transition:s=SV ;
phone IPP_CV = pp_transition:s=CV ;
phone IPP_VS = pp_transition:s=VS ;
phone IWP_XV = pp_transition:s=XV | pp_transition:s=XS silence silence:+ pp_transition:s=SV ;
phone IPP_XV = pp_transition:s=XV ;

phone IWP_VX = pp_transition:s=VX | pp_transition:s=VS silence silence:+ pp_transition:s=SX ;
phone IWP_CX = pp_transition:s=CX | pp_transition:s=CS silence silence:+ pp_transition:s=SX ;
phone IWP_XC = pp_transition:s=XC | pp_transition:s=XS silence silence:+ pp_transition:s=SC ;
#
# These are just so rare that we lump them with IPP_XX
phone IPP_CX = pp_transition:s=XX ;
phone IPP_XC = pp_transition:s=XX ;
phone IPP_VX = pp_transition:s=XX ;

# These two are dropped because they are so rare.  They correspond to garbles at the beginning
# and end of an utterance.
# phone IPP_SX = pp_transition:s=SX ;
# phone IPP_XS = pp_transition:s=XS ;
# We drop utterances with IWP_XX because (a) it's rare, and (b) it indicates a high
# density of repairs: at least two in a row.
# phone IWP_XX = pp_transition:s=XX | pp_transition:s=XS silence silence:+ pp_transition:s=SX ;
phone IPP_XX = pp_transition:s=XX ;

# Here we have 5 vowels, all sharing the same variance, but each with
# their own mean acoustic properties. 
macro v = 2* v1_:+:v=V:m=$s$i | 2* v2_:+:v=V:m=$s$i | 2* v3_:+:v=V:m=$s$i
	| 3* v4_:+:v=V:m=$s$i | 3* v5_:+:v=V:m=$s$i | 3* v6_:+:v=V:m=$s$i;
# We allow monopthongs and dipthongs.
# Dipthongs are represented by two vowel states in a row, with
# a single transition state in the middle.
phone V = v | v pp_transition:s=VV v;

phone X = v | c | generic:+ ;
