tesseract  5.0.0-alpha-619-ge9db
segsearch.cpp
Go to the documentation of this file.
1 // File: segsearch.cpp
3 // Description: Segmentation search functions.
4 // Author: Daria Antonova
5 //
6 // (C) Copyright 2009, Google Inc.
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
18 
19 #include <cstdint> // for INT32_MAX
20 #include "blamer.h" // for BlamerBundle
21 #include "errcode.h" // for ASSERT_HOST
22 #include <tesseract/genericvector.h> // for GenericVector
23 #include "lm_pain_points.h" // for LMPainPoints, LM_PPTYPE_SHAPE, LMPainPoi...
24 #include "lm_state.h" // for BestChoiceBundle, ViterbiStateEntry
25 #include "matrix.h" // for MATRIX_COORD, MATRIX
26 #include "pageres.h" // for WERD_RES
27 #include "params.h" // for BoolParam, IntParam, DoubleParam
28 #include "ratngs.h" // for BLOB_CHOICE_LIST, BLOB_CHOICE_IT
29 #include <tesseract/strngs.h> // for STRING
30 #include "tprintf.h" // for tprintf
31 #include "wordrec.h" // for Wordrec, SegSearchPending (ptr only)
32 
33 namespace tesseract {
34 
35 void Wordrec::DoSegSearch(WERD_RES* word_res) {
36  BestChoiceBundle best_choice_bundle(word_res->ratings->dimension());
37  // Run Segmentation Search.
38  SegSearch(word_res, &best_choice_bundle, nullptr);
39 }
40 
42  BestChoiceBundle* best_choice_bundle,
43  BlamerBundle* blamer_bundle) {
48  // Compute scaling factor that will help us recover blob outline length
49  // from classifier rating and certainty for the blob.
50  float rating_cert_scale = -1.0 * getDict().certainty_scale / rating_scale;
52  InitialSegSearch(word_res, &pain_points, &pending, best_choice_bundle,
53  blamer_bundle);
54 
55  if (!SegSearchDone(0)) { // find a better choice
56  if (chop_enable && word_res->chopped_word != nullptr) {
57  improve_by_chopping(rating_cert_scale, word_res, best_choice_bundle,
58  blamer_bundle, &pain_points, &pending);
59  }
60  if (chop_debug) SEAM::PrintSeams("Final seam list:", word_res->seam_array);
61 
62  if (blamer_bundle != nullptr &&
63  !blamer_bundle->ChoiceIsCorrect(word_res->best_choice)) {
64  blamer_bundle->SetChopperBlame(word_res, wordrec_debug_blamer);
65  }
66  }
67  // Keep trying to find a better path by fixing the "pain points".
68 
69  MATRIX_COORD pain_point;
70  float pain_point_priority;
71  int num_futile_classifications = 0;
72  STRING blamer_debug;
73  while (wordrec_enable_assoc &&
74  (!SegSearchDone(num_futile_classifications) ||
75  (blamer_bundle != nullptr &&
76  blamer_bundle->GuidedSegsearchStillGoing()))) {
77  // Get the next valid "pain point".
78  bool found_nothing = true;
79  LMPainPointsType pp_type;
80  while ((pp_type = pain_points.Deque(&pain_point, &pain_point_priority)) !=
81  LM_PPTYPE_NUM) {
82  if (!pain_point.Valid(*word_res->ratings)) {
83  word_res->ratings->IncreaseBandSize(
84  pain_point.row - pain_point.col + 1);
85  }
86  if (pain_point.Valid(*word_res->ratings) &&
87  !word_res->ratings->Classified(pain_point.col, pain_point.row,
88  getDict().WildcardID())) {
89  found_nothing = false;
90  break;
91  }
92  }
93  if (found_nothing) {
94  if (segsearch_debug_level > 0) tprintf("Pain points queue is empty\n");
95  break;
96  }
97  ProcessSegSearchPainPoint(pain_point_priority, pain_point,
99  &pending, word_res, &pain_points, blamer_bundle);
100 
101  UpdateSegSearchNodes(rating_cert_scale, pain_point.col, &pending,
102  word_res, &pain_points, best_choice_bundle,
103  blamer_bundle);
104  if (!best_choice_bundle->updated) ++num_futile_classifications;
105 
106  if (segsearch_debug_level > 0) {
107  tprintf("num_futile_classifications %d\n", num_futile_classifications);
108  }
109 
110  best_choice_bundle->updated = false; // reset updated
111 
112  // See if it's time to terminate SegSearch or time for starting a guided
113  // search for the true path to find the blame for the incorrect best_choice.
114  if (SegSearchDone(num_futile_classifications) &&
115  blamer_bundle != nullptr &&
116  blamer_bundle->GuidedSegsearchNeeded(word_res->best_choice)) {
117  InitBlamerForSegSearch(word_res, &pain_points, blamer_bundle,
118  &blamer_debug);
119  }
120  } // end while loop exploring alternative paths
121  if (blamer_bundle != nullptr) {
122  blamer_bundle->FinishSegSearch(word_res->best_choice,
123  wordrec_debug_blamer, &blamer_debug);
124  }
125 
126  if (segsearch_debug_level > 0) {
127  tprintf("Done with SegSearch (AcceptableChoiceFound: %d)\n",
128  language_model_->AcceptableChoiceFound());
129  }
130 }
131 
132 // Setup and run just the initial segsearch on an established matrix,
133 // without doing any additional chopping or joining.
134 // (Internal factored version that can be used as part of the main SegSearch.)
135 void Wordrec::InitialSegSearch(WERD_RES* word_res, LMPainPoints* pain_points,
137  BestChoiceBundle* best_choice_bundle,
138  BlamerBundle* blamer_bundle) {
139  if (segsearch_debug_level > 0) {
140  tprintf("Starting SegSearch on ratings matrix%s:\n",
141  wordrec_enable_assoc ? " (with assoc)" : "");
142  word_res->ratings->print(getDict().getUnicharset());
143  }
144 
145  pain_points->GenerateInitial(word_res);
146 
147  // Compute scaling factor that will help us recover blob outline length
148  // from classifier rating and certainty for the blob.
149  float rating_cert_scale = -1.0 * getDict().certainty_scale / rating_scale;
150 
153  segsearch_max_char_wh_ratio, rating_cert_scale);
154 
155  // Initialize blamer-related information: map character boxes recorded in
156  // blamer_bundle->norm_truth_word to the corresponding i,j indices in the
157  // ratings matrix. We expect this step to succeed, since when running the
158  // chopper we checked that the correct chops are present.
159  if (blamer_bundle != nullptr) {
160  blamer_bundle->SetupCorrectSegmentation(word_res->chopped_word,
162  }
163 
164  // pending[col] tells whether there is update work to do to combine
165  // best_choice_bundle->beam[col - 1] with some BLOB_CHOICEs in matrix[col, *].
166  // As the language model state is updated, pending entries are modified to
167  // minimize duplication of work. It is important that during the update the
168  // children are considered in the non-decreasing order of their column, since
169  // this guarantees that all the parents would be up to date before an update
170  // of a child is done.
171  pending->init_to_size(word_res->ratings->dimension(), SegSearchPending());
172 
173  // Search the ratings matrix for the initial best path.
174  (*pending)[0].SetColumnClassified();
175  UpdateSegSearchNodes(rating_cert_scale, 0, pending, word_res,
176  pain_points, best_choice_bundle, blamer_bundle);
177 }
178 
180  float rating_cert_scale,
181  int starting_col,
183  WERD_RES *word_res,
184  LMPainPoints *pain_points,
185  BestChoiceBundle *best_choice_bundle,
186  BlamerBundle *blamer_bundle) {
187  MATRIX *ratings = word_res->ratings;
188  ASSERT_HOST(ratings->dimension() == pending->size());
189  ASSERT_HOST(ratings->dimension() == best_choice_bundle->beam.size());
190  for (int col = starting_col; col < ratings->dimension(); ++col) {
191  if (!(*pending)[col].WorkToDo()) continue;
192  int first_row = col;
193  int last_row = std::min(ratings->dimension() - 1,
194  col + ratings->bandwidth() - 1);
195  if ((*pending)[col].SingleRow() >= 0) {
196  first_row = last_row = (*pending)[col].SingleRow();
197  }
198  if (segsearch_debug_level > 0) {
199  tprintf("\n\nUpdateSegSearchNodes: col=%d, rows=[%d,%d], alljust=%d\n",
200  col, first_row, last_row,
201  (*pending)[col].IsRowJustClassified(INT32_MAX));
202  }
203  // Iterate over the pending list for this column.
204  for (int row = first_row; row <= last_row; ++row) {
205  // Update language model state of this child+parent pair.
206  BLOB_CHOICE_LIST *current_node = ratings->get(col, row);
207  LanguageModelState *parent_node =
208  col == 0 ? nullptr : best_choice_bundle->beam[col - 1];
209  if (current_node != nullptr &&
210  language_model_->UpdateState((*pending)[col].IsRowJustClassified(row),
211  col, row, current_node, parent_node,
212  pain_points, word_res,
213  best_choice_bundle, blamer_bundle) &&
214  row + 1 < ratings->dimension()) {
215  // Since the language model state of this entry changed, process all
216  // the child column.
217  (*pending)[row + 1].RevisitWholeColumn();
218  if (segsearch_debug_level > 0) {
219  tprintf("Added child col=%d to pending\n", row + 1);
220  }
221  } // end if UpdateState.
222  } // end for row.
223  } // end for col.
224  if (best_choice_bundle->best_vse != nullptr) {
225  ASSERT_HOST(word_res->StatesAllValid());
226  if (best_choice_bundle->best_vse->updated) {
227  pain_points->GenerateFromPath(rating_cert_scale,
228  best_choice_bundle->best_vse, word_res);
229  if (!best_choice_bundle->fixpt.empty()) {
230  pain_points->GenerateFromAmbigs(best_choice_bundle->fixpt,
231  best_choice_bundle->best_vse, word_res);
232  }
233  }
234  }
235  // The segsearch is completed. Reset all updated flags on all VSEs and reset
236  // all pendings.
237  for (int col = 0; col < pending->size(); ++col) {
238  (*pending)[col].Clear();
239  ViterbiStateEntry_IT
240  vse_it(&best_choice_bundle->beam[col]->viterbi_state_entries);
241  for (vse_it.mark_cycle_pt(); !vse_it.cycled_list(); vse_it.forward()) {
242  vse_it.data()->updated = false;
243  }
244  }
245 }
246 
248  float pain_point_priority,
249  const MATRIX_COORD &pain_point, const char* pain_point_type,
250  GenericVector<SegSearchPending>* pending, WERD_RES *word_res,
251  LMPainPoints *pain_points, BlamerBundle *blamer_bundle) {
252  if (segsearch_debug_level > 0) {
253  tprintf("Classifying pain point %s priority=%.4f, col=%d, row=%d\n",
254  pain_point_type, pain_point_priority,
255  pain_point.col, pain_point.row);
256  }
257  ASSERT_HOST(pain_points != nullptr);
258  MATRIX *ratings = word_res->ratings;
259  // Classify blob [pain_point.col pain_point.row]
260  if (!pain_point.Valid(*ratings)) {
261  ratings->IncreaseBandSize(pain_point.row + 1 - pain_point.col);
262  }
263  ASSERT_HOST(pain_point.Valid(*ratings));
264  BLOB_CHOICE_LIST *classified = classify_piece(word_res->seam_array,
265  pain_point.col, pain_point.row,
266  pain_point_type,
267  word_res->chopped_word,
268  blamer_bundle);
269  BLOB_CHOICE_LIST *lst = ratings->get(pain_point.col, pain_point.row);
270  if (lst == nullptr) {
271  ratings->put(pain_point.col, pain_point.row, classified);
272  } else {
273  // We can not delete old BLOB_CHOICEs, since they might contain
274  // ViterbiStateEntries that are parents of other "active" entries.
275  // Thus if the matrix cell already contains classifications we add
276  // the new ones to the beginning of the list.
277  BLOB_CHOICE_IT it(lst);
278  it.add_list_before(classified);
279  delete classified; // safe to delete, since empty after add_list_before()
280  classified = nullptr;
281  }
282 
283  if (segsearch_debug_level > 0) {
284  print_ratings_list("Updated ratings matrix with a new entry:",
285  ratings->get(pain_point.col, pain_point.row),
286  getDict().getUnicharset());
287  ratings->print(getDict().getUnicharset());
288  }
289 
290  // Insert initial "pain points" to join the newly classified blob
291  // with its left and right neighbors.
292  if (classified != nullptr && !classified->empty()) {
293  if (pain_point.col > 0) {
294  pain_points->GeneratePainPoint(
295  pain_point.col - 1, pain_point.row, LM_PPTYPE_SHAPE, 0.0,
296  true, segsearch_max_char_wh_ratio, word_res);
297  }
298  if (pain_point.row + 1 < ratings->dimension()) {
299  pain_points->GeneratePainPoint(
300  pain_point.col, pain_point.row + 1, LM_PPTYPE_SHAPE, 0.0,
301  true, segsearch_max_char_wh_ratio, word_res);
302  }
303  }
304  (*pending)[pain_point.col].SetBlobClassified(pain_point.row);
305 }
306 
307 // Resets enough of the results so that the Viterbi search is re-run.
308 // Needed when the n-gram model is enabled, as the multi-length comparison
309 // implementation will re-value existing paths to worse values.
311  BestChoiceBundle* best_choice_bundle,
313  // TODO(rays) More refactoring required here.
314  // Delete existing viterbi states.
315  for (int col = 0; col < best_choice_bundle->beam.size(); ++col) {
316  best_choice_bundle->beam[col]->Clear();
317  }
318  // Reset best_choice_bundle.
319  word_res->ClearWordChoices();
320  best_choice_bundle->best_vse = nullptr;
321  // Clear out all existing pendings and add a new one for the first column.
322  (*pending)[0].SetColumnClassified();
323  for (int i = 1; i < pending->size(); ++i)
324  (*pending)[i].Clear();
325 }
326 
328  LMPainPoints *pain_points,
329  BlamerBundle *blamer_bundle,
330  STRING *blamer_debug) {
331  pain_points->Clear(); // Clear pain points heap.
332  blamer_bundle->InitForSegSearch(word_res->best_choice, word_res->ratings,
333  getDict().WildcardID(), wordrec_debug_blamer,
334  blamer_debug, pain_points,
335  segsearch_max_char_wh_ratio, word_res);
336 }
337 
338 } // namespace tesseract
strngs.h
BlamerBundle::ChoiceIsCorrect
bool ChoiceIsCorrect(const WERD_CHOICE *word_choice) const
Definition: blamer.cpp:117
pageres.h
tesseract::Wordrec::SegSearch
void SegSearch(WERD_RES *word_res, BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle)
Definition: segsearch.cpp:41
tesseract::Wordrec::SegSearchDone
bool SegSearchDone(int num_futile_classifications)
Definition: wordrec.h:486
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:87
params.h
MATRIX::print
void print(const UNICHARSET &unicharset) const
Definition: matrix.cpp:110
tesseract::Wordrec::segsearch_debug_level
int segsearch_debug_level
Definition: wordrec.h:233
wordrec.h
tesseract::Wordrec::chop_debug
int chop_debug
Definition: wordrec.h:204
MATRIX_COORD::Valid
bool Valid(const MATRIX &m) const
Definition: matrix.h:614
MATRIX
Definition: matrix.h:574
STRING
Definition: strngs.h:45
tesseract::Wordrec::prev_word_best_choice_
WERD_CHOICE * prev_word_best_choice_
Definition: wordrec.h:476
WERD_RES
Definition: pageres.h:160
MATRIX::IncreaseBandSize
void IncreaseBandSize(int bandwidth)
Definition: matrix.cpp:47
BlamerBundle::SetChopperBlame
void SetChopperBlame(const WERD_RES *word, bool debug)
Definition: blamer.cpp:316
WERD_RES::ratings
MATRIX * ratings
Definition: pageres.h:231
tesseract::Wordrec::segsearch_max_pain_points
int segsearch_max_pain_points
Definition: wordrec.h:235
tesseract::BestChoiceBundle::best_vse
ViterbiStateEntry * best_vse
Best ViterbiStateEntry and BLOB_CHOICE.
Definition: lm_state.h:240
ratngs.h
tesseract::Classify::getDict
virtual Dict & getDict()
Definition: classify.h:107
tesseract::Wordrec::ResetNGramSearch
void ResetNGramSearch(WERD_RES *word_res, BestChoiceBundle *best_choice_bundle, GenericVector< SegSearchPending > *pending)
Definition: segsearch.cpp:310
tesseract::Wordrec::wordrec_enable_assoc
bool wordrec_enable_assoc
Definition: wordrec.h:198
genericvector.h
tesseract::LMPainPoints::GenerateFromPath
void GenerateFromPath(float rating_cert_scale, ViterbiStateEntry *vse, WERD_RES *word_res)
Definition: lm_pain_points.cpp:70
tesseract::LMPainPoints::PainPointDescription
static const char * PainPointDescription(LMPainPointsType type)
Definition: lm_pain_points.h:65
tesseract::BestChoiceBundle::beam
PointerVector< LanguageModelState > beam
Definition: lm_state.h:238
tesseract::BestChoiceBundle::updated
bool updated
Flag to indicate whether anything was changed.
Definition: lm_state.h:232
WERD_RES::best_choice
WERD_CHOICE * best_choice
Definition: pageres.h:235
tesseract::LMPainPoints::GenerateFromAmbigs
void GenerateFromAmbigs(const DANGERR &fixpt, ViterbiStateEntry *vse, WERD_RES *word_res)
Definition: lm_pain_points.cpp:132
tesseract::BestChoiceBundle
Bundle together all the things pertaining to the best choice/state.
Definition: lm_state.h:222
tesseract::LM_PPTYPE_NUM
Definition: lm_pain_points.h:46
tesseract::Wordrec::classify_piece
virtual BLOB_CHOICE_LIST * classify_piece(const GenericVector< SEAM * > &seams, int16_t start, int16_t end, const char *description, TWERD *word, BlamerBundle *blamer_bundle)
Definition: pieces.cpp:52
tesseract::Wordrec::chop_enable
bool chop_enable
Definition: wordrec.h:205
tesseract::LMPainPoints::Deque
LMPainPointsType Deque(MATRIX_COORD *pp, float *priority)
Definition: lm_pain_points.cpp:39
BlamerBundle::GuidedSegsearchStillGoing
bool GuidedSegsearchStillGoing() const
Definition: blamer.cpp:512
tesseract::Wordrec::InitBlamerForSegSearch
void InitBlamerForSegSearch(WERD_RES *word_res, LMPainPoints *pain_points, BlamerBundle *blamer_bundle, STRING *blamer_debug)
Definition: segsearch.cpp:327
GENERIC_2D_ARRAY::get
T get(ICOORD pos) const
Definition: matrix.h:227
matrix.h
BlamerBundle::InitForSegSearch
void InitForSegSearch(const WERD_CHOICE *best_choice, MATRIX *ratings, UNICHAR_ID wildcard_id, bool debug, STRING *debug_str, tesseract::LMPainPoints *pain_points, double max_char_wh_ratio, WERD_RES *word_res)
Definition: blamer.cpp:478
tesseract::Dict::certainty_scale
double certainty_scale
Definition: dict.h:627
tesseract::LMPainPoints::GenerateInitial
void GenerateInitial(WERD_RES *word_res)
Definition: lm_pain_points.cpp:50
GenericVector::empty
bool empty() const
Definition: genericvector.h:86
tesseract::LMPainPoints::GeneratePainPoint
bool GeneratePainPoint(int col, int row, LMPainPointsType pp_type, float special_priority, bool ok_to_extend, float max_char_wh_ratio, WERD_RES *word_res)
Definition: lm_pain_points.cpp:148
tesseract::Wordrec::segsearch_max_char_wh_ratio
double segsearch_max_char_wh_ratio
Definition: wordrec.h:239
tesseract::LMPainPoints
Definition: lm_pain_points.h:56
WERD_RES::chopped_word
TWERD * chopped_word
Definition: pageres.h:206
tesseract
Definition: baseapi.h:65
tesseract::LanguageModelState
Struct to store information maintained by various language model components.
Definition: lm_state.h:200
tesseract::BestChoiceBundle::fixpt
DANGERR fixpt
Places to try to fix the word suggested by ambiguity checking.
Definition: lm_state.h:234
tesseract::ViterbiStateEntry::updated
bool updated
set to true if the entry has just been created/updated
Definition: lm_state.h:194
tesseract::LM_PPTYPE_SHAPE
Definition: lm_pain_points.h:44
tprintf.h
tesseract::LMPainPoints::Clear
void Clear()
Definition: lm_pain_points.h:85
WERD_RES::seam_array
GenericVector< SEAM * > seam_array
Definition: pageres.h:208
GenericVector
Definition: baseapi.h:40
WERD_RES::StatesAllValid
bool StatesAllValid()
Definition: pageres.cpp:454
tesseract::Wordrec::improve_by_chopping
void improve_by_chopping(float rating_cert_scale, WERD_RES *word, BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle, LMPainPoints *pain_points, GenericVector< SegSearchPending > *pending)
Definition: chopper.cpp:452
tesseract::Wordrec::wordrec_debug_blamer
bool wordrec_debug_blamer
Definition: wordrec.h:231
BandTriMatrix::bandwidth
int bandwidth() const
Definition: matrix.h:534
MATRIX_COORD
Definition: matrix.h:604
MATRIX_COORD::col
int col
Definition: matrix.h:632
print_ratings_list
void print_ratings_list(const char *msg, BLOB_CHOICE_LIST *ratings, const UNICHARSET &current_unicharset)
Definition: ratngs.cpp:835
tesseract::Wordrec::assume_fixed_pitch_char_segment
bool assume_fixed_pitch_char_segment
Definition: wordrec.h:225
GenericVector::init_to_size
void init_to_size(int size, const T &t)
Definition: genericvector.h:706
GENERIC_2D_ARRAY::put
void put(ICOORD pos, const T &thing)
Definition: matrix.h:219
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
tesseract::Dict::getUnicharset
const UNICHARSET & getUnicharset() const
Definition: dict.h:101
errcode.h
WERD_RES::ClearWordChoices
void ClearWordChoices()
Definition: pageres.cpp:1125
MATRIX_COORD::row
int row
Definition: matrix.h:633
tesseract::Classify::rating_scale
double rating_scale
Definition: classify.h:472
tesseract::Wordrec::InitialSegSearch
void InitialSegSearch(WERD_RES *word_res, LMPainPoints *pain_points, GenericVector< SegSearchPending > *pending, BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle)
Definition: segsearch.cpp:135
lm_pain_points.h
tesseract::SegSearchPending
Definition: wordrec.h:112
tesseract::LMPainPointsType
LMPainPointsType
Definition: lm_pain_points.h:40
tesseract::Wordrec::language_model_
std::unique_ptr< LanguageModel > language_model_
Definition: wordrec.h:471
tesseract::Wordrec::DoSegSearch
void DoSegSearch(WERD_RES *word_res)
Definition: segsearch.cpp:35
tesseract::Wordrec::ProcessSegSearchPainPoint
void ProcessSegSearchPainPoint(float pain_point_priority, const MATRIX_COORD &pain_point, const char *pain_point_type, GenericVector< SegSearchPending > *pending, WERD_RES *word_res, LMPainPoints *pain_points, BlamerBundle *blamer_bundle)
Definition: segsearch.cpp:247
BlamerBundle
Definition: blamer.h:103
BlamerBundle::GuidedSegsearchNeeded
bool GuidedSegsearchNeeded(const WERD_CHOICE *best_choice) const
Definition: blamer.cpp:469
blamer.h
GenericVector::size
int size() const
Definition: genericvector.h:71
SEAM::PrintSeams
static void PrintSeams(const char *label, const GenericVector< SEAM * > &seams)
Definition: seam.cpp:165
BlamerBundle::FinishSegSearch
void FinishSegSearch(const WERD_CHOICE *best_choice, bool debug, STRING *debug_str)
Definition: blamer.cpp:517
tesseract::Wordrec::UpdateSegSearchNodes
void UpdateSegSearchNodes(float rating_cert_scale, int starting_col, GenericVector< SegSearchPending > *pending, WERD_RES *word_res, LMPainPoints *pain_points, BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle)
Definition: segsearch.cpp:179
BandTriMatrix::dimension
int dimension() const
Definition: matrix.h:532
lm_state.h
BlamerBundle::SetupCorrectSegmentation
void SetupCorrectSegmentation(const TWERD *word, bool debug)
Definition: blamer.cpp:413
MATRIX::Classified
bool Classified(int col, int row, int wildcard_id) const
Definition: matrix.cpp:34