@@ -41,7 +41,7 @@ struct ConvertTree {
4141 TreeIndex masterTreeIndex;
4242 StateId rootSubTree;
4343 StateId ciRootNode;
44- std::map<StateTree::Exit, u32 > exits; // Maps exits to label-indices @todo Make this a hash_map
44+ std::map<StateTree::Exit, u32 > exits; // Maps exits to label-indices @todo Make this a hash_map
4545 std::vector<PersistentStateTree::Exit> exitVector;
4646 Core::HashMap<StateId, StateTree::StateId> statesForNodes;
4747 Core::HashMap<StateTree::StateId, StateId> nodesForStates;
@@ -73,7 +73,7 @@ struct ConvertTree {
7373 }
7474 }
7575
76- // /Make sure a node is created for every single state, so that also the coarticulated roots are respected
76+ // / Make sure a node is created for every single state, so that also the coarticulated roots are respected
7777
7878 for (std::set<StateTree::StateId>::iterator stateIt = coarticulatedRootStates.begin (); stateIt != coarticulatedRootStates.end (); ++stateIt) {
7979 StateTree::StateId state = *stateIt;
@@ -121,7 +121,7 @@ struct ConvertTree {
121121 exitIndices.insert (exitEntry->second );
122122 }
123123
124- // Add connections to the attached outputs/exits
124+ // Add connections to the attached outputs/exits
125125 for (std::set<u32 >::iterator it = exitIndices.begin (); it != exitIndices.end (); ++it)
126126 subtrees.addOutputToEdge (subtrees.state (node).successors , *it);
127127 }
@@ -150,10 +150,10 @@ struct ConvertTree {
150150
151151 subtrees.state (node).stateDesc = state;
152152
153- // Build successor structure
153+ // Build successor structure
154154 std::pair<StateTree::SuccessorIterator, StateTree::SuccessorIterator> successors = tree->successors (stateId);
155155
156- StateId current = node; // Just to verify the order
156+ StateId current = node; // Just to verify the order
157157
158158 for (; successors.first != successors.second ; ++successors.first ) {
159159 std::unordered_map<StateTree::StateId, StateId>::iterator nodeIt = nodesForStates.find (*successors.first );
@@ -166,14 +166,15 @@ struct ConvertTree {
166166 }
167167};
168168
169- PersistentStateTree::PersistentStateTree (Core::Configuration config, Core::Ref<const Am::AcousticModel> acousticModel, Bliss::LexiconRef lexicon)
169+ PersistentStateTree::PersistentStateTree (Core::Configuration config, Core::Ref<const Am::AcousticModel> acousticModel, Bliss::LexiconRef lexicon, TreeBuilderFactory treeBuilderFactory )
170170 : masterTree(0 ),
171171 rootState (0 ),
172172 ciRootState(0 ),
173173 archive_(paramCacheArchive(Core::Configuration(config, " search-network" ))),
174174 acousticModel_(acousticModel),
175175 lexicon_(lexicon),
176- config_(config) {
176+ config_(config),
177+ treeBuilderFactory_(treeBuilderFactory) {
177178 if (acousticModel_.get () && lexicon_.get ()) {
178179 const Am::ClassicAcousticModel* am = required_cast (const Am::ClassicAcousticModel*, acousticModel.get ());
179180 Core::DependencySet d;
@@ -320,7 +321,7 @@ bool PersistentStateTree::read(Core::MappedArchiveReader in) {
320321 in >> masterTree >> dependenciesChecksum;
321322
322323 if (dependenciesChecksum != dependencies_.getChecksum ()) {
323- Core::Application::us ()->log () << " dependencies of the network image don't equal the requiered dependencies with checksum " << dependenciesChecksum;
324+ Core::Application::us ()->log () << " dependencies of the network image don't equal the required dependencies with checksum " << dependenciesChecksum;
324325 return false ;
325326 }
326327
@@ -436,7 +437,7 @@ HMMStateNetwork::CleanupResult PersistentStateTree::cleanup(bool cleanupExits) {
436437
437438 Core::HashMap<StateId, StateId>::const_iterator targetNodeIt;
438439 if (rootState) {
439- verify (cleanupResult.nodeMap .find (rootState) != cleanupResult.nodeMap .end ()); // Root-node must stay unchanged
440+ verify (cleanupResult.nodeMap .find (rootState) != cleanupResult.nodeMap .end ()); // Root-node must stay unchanged
440441 verify (cleanupResult.nodeMap .find (rootState)->second == rootState);
441442 targetNodeIt = cleanupResult.nodeMap .find (rootState);
442443 verify (targetNodeIt != cleanupResult.nodeMap .end ());
@@ -512,7 +513,7 @@ void PersistentStateTree::dumpDotGraph(std::string file, const std::vector<int>&
512513 int depth = 0 ;
513514 if (!nodeDepths.empty ())
514515 depth = nodeDepths[node];
515- os << Core::form (" n%d [label=\" %d\\ nd=%d\\ nm=%d" , node, node, depth, structure.state (node).stateDesc .acousticModel );
516+ os << Core::form (" n%d [label=\" %d\\ nd=%d\\ nm=%d\\ nt=%d " , node, node, depth, structure.state (node).stateDesc .acousticModel , structure. state (node). stateDesc . transitionModelIndex );
516517
517518 for (HMMStateNetwork::SuccessorIterator target = structure.successors (node); target; ++target)
518519 if (target.isLabel () && exits[target.label ()].pronunciation != Bliss::LemmaPronunciation::invalidId)
0 commit comments