Skript Context-Dependent Models

[FeatureSet fs] setDesc   @/home/islpra0/IslData/featDesc
            fs  setAccess @/home/islpra0/IslData/featAccess

[CodebookSet cbs fs]                read ../step8/codebookSet
[DistribSet  dss cbs]               read ../step2/distribSet
[PhonesSet ps]                      read ../step2/phonesSet
ps:PHONES add pad
[Tags tags]                         read ../step2/tags

[Tree dst ps:PHONES ps tags dss]    read ../step2/distribTree

fs FMatrix LDAMatrix
fs:LDAMatrix.data bload ../step5/ldaMatrix

SenoneSet sns [DistribStream str dss dst]

[TmSet tms]                         read ../step2/transitionModels
[TopoSet tps sns tms]               read ../step2/topologies
[Tree tpt ps:PHONES ps tags tps]    read ../step2/topologyTree
[Dictionary diction ps:PHONES tags]    read ../step4/convertedDict

[DBase db] open ../step1/db.dat ../step1/db.idx -mode r
AModelSet amo tpt ROOT
HMM hmm diction amo

PTree configure -maxContext 1
PTree configure -addProc ptreeAddProc

proc ptreeAddProc { ptree args } {

  regexp {(.*)-([bme])} \$ptree dummy phone subphone
  set dsName [lindex \$args 0]-\$subphone
  set cbName "\$phone-\$subphone"
  if { [dss index \$dsName] == -1 } { dss add \$dsName \$cbName }
  return \$dsName
}

foreach ds [dss:] {

  if { \$ds != "_-m" && \$ds != "+-m" } {
    set phone [string range \$ds 0 [expr [string first "-" \$ds] -1]]
    dst.ptreeSet add \$ds \$phone 0 0 -count 1
    dst:\$ds configure -ptree [dst.ptreeSet index \$ds]
  }
}
dst configure -padPhone [ps:PHONES index pad]
dst configure -ptreeAdd 1

foreach utt [db] {
    puts \$utt
    makeArray arr [db get \$utt]
    hmm make \$arr(TEXT) -optWord SIL

}

dss          write distribSet
dst          write distribTree
dst.ptreeSet write ptreeSet
exit