[FeatureSet fs] setDesc   @../step2/featDesc
            fs  setAccess @../step2/featAccess

[CodebookSet cbs fs]                read ../step2/codebookSet
[DistribSet  dss cbs]               read ../step2/distribSet
[PhonesSet ps]                      read ../step2/phonesSet
[Tags tags]                         read ../step2/tags
[Tree dst ps:phones ps tags dss]    read ../step2/distribTree

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 dict ps:phones tags]    read ../step1/convertedDict

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

cbs load ../step6/codebookWeights
dss load ../step6/distribWeights

Vocab voc vocab -dictionary dict -acousticModel amo
Lm lm voc langmod -weight 16 -penalty -16
Search search voc lm
search.treeFwd configure -beamWidth 200 -topN 50 -phoneBeamWidth 200 \
                         -lastPhoneBeamWidth 120 -wordBeamWidth 150  \
                         -lastPhoneAloneBeamWidth 120

proc testOne { utt } {
  set uttinfo [db get $utt]
  makeArray infoArray $uttinfo
  search treeFwd -eval $uttinfo
  puts [search.treeFwd.hypoList puts -id $utt -style simple]
}

set fp [open ../step1/testIDs r]
while { [gets $fp utt] != -1 } {
  puts "testing utterance $utt"
  testOne $utt
}

exit