init.tcl

proc addModel { phone subTree feature refN dimN type cbs dss tree } { 

# compose default names

 set dsname \$phone-\$subTree
 set question 0=\$phone 
 set cbname \$phone-\$subTree
 set root ROOT-\$subTree 

# Create new codebook \$cbname in \$cbs and new distribution \$dsname in \$dss 

 if {[\$cbs index \$cbname] < 0} { \$cbs add \$cbname \$feature \$refN \$dimN \$type } 
 if {[\$dss index \$dsname] < 0} { \$dss add \$dsname \$cbname } 

# compose name of hook node (question node) and the attached leaf node 

 set qnode hook-\$dsname 
 set lnode \$dsname 

# if requested root does not exist, create it, then add new hook and leaf 

 if {[\$tree index \$root] < 0} {
     \$tree add \$root {} \$qnode \$qnode \$qnode "-" 
     \$tree add \$qnode \$question - \$lnode - -
     \$tree add \$lnode {} - - - \$dsname 
 } else { 
     \$tree add \$qnode \$question - \$lnode - - 
     \$tree add \$lnode {} - - - \$dsname

     # Find last NO node starting at root 
     
     set lidx [\$tree index \$root] 
     set idx \$lidx 

     while { [set idx [\$tree.item(\$lidx) configure -no]] > -1} { set lidx \$idx } 
     \$tree.item(\$lidx) configure -no [\$tree index \$qnode]
  } 
} 

# beginning of the main script 

set featDesc { 
     \$fes readADC ADC \$arg(ADC) -bm shorten -h 0 -offset mean -v 0 
     \$fes adc2mel MSC ADC 16ms 
     \$fes meansub MSC MSC -a 2 
} 

set featAccess { 
     set adc "adc ../IslData/adcs/\$arg(ADC)"; lappend accessList \$adc 
} 

DistribSet dss [CodebookSet cbs [FeatureSet fs]]

[PhonesSet ps] add PHONES A AEH AH AI AU B CH D E E2 EH ER2 EU F G H +hBR +hEH +hEM +hGH I IE J K L M N NG
        +nGN O OE OEH OH P +QK R S SCH T TS U UE UEH UH V X Z SIL + [Tags tags] add WB SenoneSet sns [DistribStream str dss [Tree dst ps:PHONES ps tags dss]] set modelList {
     {A m} {AEH m} {AH m} {AI m} {AU m} {B m} {CH m} {D m} {E m} {E2 m} {EH m} {ER2 m} {EU m} {F m} {G m} {H m} {+hBR m} {+hEH m} {+hEM m} {+hGH m} {I m} {IE m} {J m} {K m} {L m} {M m} {N m} {NG m} {+nGN m} {O m} {OE m} {OEH m} {OH m} {P m} {+QK m} {R m} {S m} {SCH m} {SIL m} {T m} {TS m} {U m} {UE m} {UEH m} {UH m} {V m} {X m} {Z m} {+ m} {A e} {AEH e} {AH e} {AI e} {AU e} {B e} {CH e} {D e} {E e} {E2 e} {EH e} {ER2 e} {EU e} {F e} {G e} {H e} {I e} {IE e} {J e} {K e} {L e} {M e} {N e} {NG e} {O e} {OE e} {OEH e} {OH e} {P e} {R e} {S e} {SCH e} {T e} {TS e} {U e} {UE e} {UEH e} {UH e} {V e} {X e} {Z e}      
} foreach mod \$modelList { eval addModel \$mod LDA 48 32 DIAGONAL cbs dss dst } [TmSet tms] add two {{0 0.7} {1 0.7}} [TopoSet tps sns tms] add NONSIL {ROOT-m ROOT-e} {two two} tps add SIL {ROOT-m} {two} [Tree tpt ps:PHONES ps tags tps] add ROOT {0=SIL | 0=+} NONSIL SIL - - tpt add NONSIL {} - - - NONSIL tpt add SIL {} - - - SIL # write out description files and other environment files cbs write codebookSet dss write distribSet dst write distribTree tms write transitionModels tps write topologies tpt write topologyTree ps write phonesSet tags write tags set fp [open featDesc w] ; puts \$fp \$featDesc ; close \$fp set fp [open featAccess w] ; puts \$fp \$featAccess ; close \$fp exit