int ndim = 26;
float eps = 0.2;
string SOURCEKIND = MFCC_E_D;

# "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 s1 = 3* smack:+:V=quiet:m=$s$i | 3* quiet:+:V=vquiet:m=mquiet ;
macro s2 = 4* breath:+:V=quiet | 4* quiet:+:V=vquiet:m=mquiet ;
macro silence = s1 s2 s1 ;
# 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:+ ;



macro stop = 3* stop_sequence:+:V=C:m=$s$i ;
macro voiced_fricative = 3* v_frication:+:V=C:m=$s$i ;
macro unvoiced_fricative = 3* unv_frication:+:V=C:m=$s$i ;
macro c = stop | voiced_fricative | unvoiced_fricative ;
# Liason gets stuck between two vowels at French word boundaries.
phone C = c ;

macro sonorant = 3* semiclosure:+:m=$s$i:V=M ;
phone M = sonorant;
macro liason = c | sonorant ;

#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:V=TR:m=SC ;
phone IPP_SM = pp_transition:V=TR:m=SM ;
phone IWP_CC = pp_transition:V=TR:m=CC | pp_transition:V=TR:m=CS silence:+ pp_transition:V=TR:m=SC ;
phone IPP_CC = pp_transition:V=TR:m=CC ;
phone IWP_CM = pp_transition:V=TR:m=CM | pp_transition:V=TR:m=CS silence:+ pp_transition:V=TR:m=SM ;
phone IPP_CM = pp_transition:V=TR:m=CM ;
phone IWP_MM = pp_transition:V=TR:m=MM | pp_transition:V=TR:m=MS silence:+ pp_transition:V=TR:m=SM ;
phone IPP_MM = pp_transition:V=TR:m=MM ;
phone IWP_VC = pp_transition:V=TR:m=VC | pp_transition:V=TR:m=VS silence:+ pp_transition:V=TR:m=SC ;
phone IPP_VC = pp_transition:V=TR:m=VC ;
phone IWP_VM = pp_transition:V=TR:m=VM | pp_transition:V=TR:m=VS silence:+ pp_transition:V=TR:m=SM ;
phone IPP_VM = pp_transition:V=TR:m=VM ;
phone IPP_CS = pp_transition:V=TR:m=CS ;
phone IPP_MS = pp_transition:V=TR:m=MS ;
# In French, we have liason at V #word V:
phone IWP_VV = pp_transition:V=TR:m=VV
		| pp_transition:V=TR:m=VS silence:+ pp_transition:V=TR:m=SV
		| pp_transition:V=TR:m=VC liason  pp_transition:V=TR:m=CV ;
phone IPP_VV = pp_transition:V=TR:m=VV ;
# IPP_VVL is used where we know there is no pause, but liason is possible.
phone IPP_VVL = pp_transition:V=TR:m=VV
		| pp_transition:V=TR:m=VC liason  pp_transition:V=TR:m=CV ;
phone IPP_SV = pp_transition:V=TR:m=SV ;
phone IWP_CV = pp_transition:V=TR:m=CV | pp_transition:V=TR:m=CS silence:+ pp_transition:V=TR:m=SV ;
phone IPP_CV = pp_transition:V=TR:m=CV ;
phone IWP_MV = pp_transition:V=TR:m=MV | pp_transition:V=TR:m=MS silence:+ pp_transition:V=TR:m=SV ;
phone IPP_MV = pp_transition:V=TR:m=MV ;
phone IWP_MC = pp_transition:V=TR:m=MC | pp_transition:V=TR:m=MS silence:+ pp_transition:V=TR:m=SC ;
phone IPP_MC = pp_transition:V=TR:m=MC ;
phone IPP_VS = pp_transition:V=TR:m=VS ;

# These are so rare that we lump them with IWP_XX
# phone IWP_VX = pp_transition:V=TR:m=VX | pp_transition:V=TR:m=VS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_CX = pp_transition:V=TR:m=CX | pp_transition:V=TR:m=CS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_MX = pp_transition:V=TR:m=MX | pp_transition:V=TR:m=MS silence:+ pp_transition:V=TR:m=SX ;
# phone IWP_XC = pp_transition:V=TR:m=XC | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SM ;
# phone IWP_XM = pp_transition:V=TR:m=XM | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SM ;
# phone IWP_XV = pp_transition:V=TR:m=XV | pp_transition:V=TR:m=XS silence:+ pp_transition:V=TR:m=SV ;
phone IWP_XX = pp_transition:V=xTR:m=XX | pp_transition:V=xTR silence:+ pp_transition:V=xTR ;
#
# These are so rare that we lump them with IPP_XX
# phone IPP_CX = pp_transition:V=TR:m=XX ;
# phone IPP_MX = pp_transition:V=TR:m=XX ;
# phone IPP_XC = pp_transition:V=TR:m=XX ;
# phone IPP_XM = pp_transition:V=TR:m=XX ;
# phone IPP_VX = pp_transition:V=TR:m=XX ;
# phone IPP_SX = pp_transition:V=TR:m=SX ;
# phone IPP_XS = pp_transition:V=TR:m=XS ;
# phone IPP_XV = pp_transition:V=TR:m=XV ;
phone IPP_XX = pp_transition:V=xTR:m=XX ;


# Here we have 5 vowels, all sharing the same variance, but each with
# their own mean acoustic properties. 
macro v = 3* v1:+:V=V:m=$s$i | 3* v2:+:V=V:m=$s$i | 3* v3:+:V=V:m=$s$i | 3* v4:+:V=V:m=$s$i |
		3* v5:+:V=V:m=$s$i ;
macro thong1 = 2* v1:+:V=V:m=$s$i | 2* v2:+:V=V:m=$s$i | 2* v3:+:V=V:m=$s$i | 2* v4:+:V=V:m=$s$i |
		2* v5:+:V=V:m=$s$i ;
macro thong2 = 2* v1:+:V=V:m=$s$I | 2* v2:+:V=V:m=$s$I | 2* v3:+:V=V:m=$s$I | 2* v4:+:V=V:m=$s$I |
		2* v5:+:V=V:m=$s$I ;
phone V = v | thong1 thong2 ;

# The HTK book doesn't seem to force all states to be consistently
# <Variance> or <InvCovar> but HERest seems to require it.   If you
# give the generic state a diagonal covariance, then HERest returns
# ERROR [+7032]  GetMixPDF: trying to change global cov type to DiagC
phone X = v | c | generic:+:fullV ;
