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 -hm 1024 -offset mean -v 0 $fes adc2mel MSC ADC 16ms $fes meansub MSC MSC -a 2 } set featAccess { set adc "adc ../data/recordings/$arg(utt)"; lappend accessList $adc } DistribSet dss [CodebookSet cbs [FeatureSet fs]] [PhonesSet ps] add phones A B D E F G H I L M N O R S U Y _ + [Tags tags] add WB SenoneSet sns [DistribStream str dss [Tree dst ps:phones ps tags dss]] set modelList { {A b} {E b} {F b} {H b} {I b} {G b} {L b} {N b} {O b} {B b} {R b} {S b} {D b} {U b} {M b} {Y b} {A e} {E e} {F e} {H e} {I e} {G e} {L e} {N e} {O e} {B e} {R e} {S e} {D e} {U e} {M e} {Y e} {_ m} {+ m} } foreach mod $modelList { eval addModel $mod MSC 16 16 DIAGONAL cbs dss dst } [TmSet tms] add two {{0 0.7} {1 0.7}} [TopoSet tps sns tms] add NONSIL {ROOT-b ROOT-e} {two two} tps add SIL {ROOT-m} {two} [Tree tpt ps:phones ps tags tps] add ROOT {0=_ | 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