172 TessLangModEdge *tess_lm_edge =
173 reinterpret_cast<TessLangModEdge *
>(lang_mod_edge);
174 LangModEdge **edge_array =
NULL;
179 if (tess_lm_edge ==
NULL) {
181 int dawg_cnt = NumDawgs();
183 (*edge_cnt) = dawg_cnt * max_edge_;
184 edge_array =
new LangModEdge *[(*edge_cnt)];
185 if (edge_array ==
NULL) {
189 for (
int dawg_idx = (*edge_cnt) = 0; dawg_idx < dawg_cnt; dawg_idx++) {
190 const Dawg *curr_dawg = GetDawg(dawg_idx);
194 (*edge_cnt) += FanOut(alt_list, curr_dawg, 0, 0,
NULL,
true,
195 edge_array + (*edge_cnt));
199 (*edge_cnt) += FanOut(alt_list, number_dawg_, 0, 0,
NULL,
true,
200 edge_array + (*edge_cnt));
204 (*edge_cnt) += FanOut(alt_list, ood_dawg_, 0, 0,
NULL,
true,
205 edge_array + (*edge_cnt));
208 for (
int edge_idx = 0; edge_idx < (*edge_cnt); edge_idx++) {
209 edge_array[edge_idx]->SetRoot(
true);
213 (*edge_cnt) = max_edge_;
215 edge_array =
new LangModEdge *[(*edge_cnt)];
216 if (edge_array ==
NULL) {
221 (*edge_cnt) = FanOut(alt_list,
222 tess_lm_edge->GetDawg(),
223 tess_lm_edge->EndEdge(), tess_lm_edge->EdgeMask(),
224 tess_lm_edge->EdgeString(),
false, edge_array);