79 if (lang_mod_edge_ == NULL) {
80 if (new_edge != NULL) {
86 if (new_edge == NULL || !lang_mod_edge_->
IsIdentical(new_edge) ||
93 int new_best_path_reco_cost;
95 int new_best_path_len;
97 new_best_path_reco_cost = (new_parent == NULL) ?
98 0 : new_parent->BestPathRecoCost() + new_parent->CharRecoCost();
101 (new_parent == NULL) ? 1 : new_parent->BestPathLength() + 1;
104 int new_lm_cost =
LangModCost(new_edge, new_parent);
107 (new_best_path_reco_cost + new_reco_cost) /
108 static_cast<double>(new_best_path_len)
112 if (best_cost_ > new_cost) {
113 parent_node_ = new_parent;
114 char_reco_cost_ = new_reco_cost;
115 best_path_reco_cost_ = new_best_path_reco_cost;
116 best_path_len_ = new_best_path_len;
117 mean_char_reco_cost_ = static_cast<int>(
118 (best_path_reco_cost_ + char_reco_cost_) /
119 static_cast<double>(best_path_len_));
121 (best_path_reco_cost_ + char_reco_cost_) /
122 static_cast<double>(best_path_len_)
TuningParams * Params() const
static bool IdenticalPath(SearchNode *node1, SearchNode *node2)
virtual bool IsIdentical(LangModEdge *edge) const =0