tesseract  5.0.0-alpha-619-ge9db
tesseract::RecodeBeamSearch Class Reference

#include <recodebeam.h>

Public Member Functions

 RecodeBeamSearch (const UnicharCompress &recoder, int null_char, bool simple_text, Dict *dict)
 
void Decode (const NetworkIO &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset, int lstm_choice_mode=0)
 
void Decode (const GENERIC_2D_ARRAY< float > &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset)
 
void DecodeSecondaryBeams (const NetworkIO &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset, int lstm_choice_mode=0)
 
void ExtractBestPathAsLabels (GenericVector< int > *labels, GenericVector< int > *xcoords) const
 
void ExtractBestPathAsUnicharIds (bool debug, const UNICHARSET *unicharset, GenericVector< int > *unichar_ids, GenericVector< float > *certs, GenericVector< float > *ratings, GenericVector< int > *xcoords) const
 
void ExtractBestPathAsWords (const TBOX &line_box, float scale_factor, bool debug, const UNICHARSET *unicharset, PointerVector< WERD_RES > *words, int lstm_choice_mode=0)
 
void DebugBeams (const UNICHARSET &unicharset) const
 
void extractSymbolChoices (const UNICHARSET *unicharset)
 
void PrintBeam2 (bool uids, int num_outputs, const UNICHARSET *charset, bool secondary) const
 
void segmentTimestepsByCharacters ()
 
std::vector< std::vector< std::pair< const char *, float > > > combineSegmentedTimesteps (std::vector< std::vector< std::vector< std::pair< const char *, float >>>> *segmentedTimesteps)
 

Static Public Member Functions

static int LengthFromBeamsIndex (int index)
 
static NodeContinuation ContinuationFromBeamsIndex (int index)
 
static bool IsDawgFromBeamsIndex (int index)
 
static int BeamIndex (bool is_dawg, NodeContinuation cont, int length)
 

Public Attributes

std::vector< std::vector< std::pair< const char *, float > > > timesteps
 
std::vector< std::vector< std::vector< std::pair< const char *, float > > > > segmentedTimesteps
 
std::vector< std::vector< std::pair< const char *, float > > > ctc_choices
 
std::vector< std::unordered_set< int > > excludedUnichars
 
std::vector< int > character_boundaries_
 

Static Public Attributes

static constexpr float kMinCertainty = -20.0f
 
static const int kNumLengths = RecodedCharID::kMaxCodeLen + 1
 
static const int kNumBeams = 2 * NC_COUNT * kNumLengths
 

Detailed Description

Definition at line 180 of file recodebeam.h.

Constructor & Destructor Documentation

◆ RecodeBeamSearch()

tesseract::RecodeBeamSearch::RecodeBeamSearch ( const UnicharCompress recoder,
int  null_char,
bool  simple_text,
Dict dict 
)

Definition at line 63 of file recodebeam.cpp.

65  : recoder_(recoder),
66  beam_size_(0),
67  top_code_(-1),
68  second_code_(-1),
69  dict_(dict),
70  space_delimited_(true),
71  is_simple_text_(simple_text),
72  null_char_(null_char) {
73  if (dict_ != nullptr && !dict_->IsSpaceDelimitedLang())
74  space_delimited_ = false;
75 }

Member Function Documentation

◆ BeamIndex()

static int tesseract::RecodeBeamSearch::BeamIndex ( bool  is_dawg,
NodeContinuation  cont,
int  length 
)
inlinestatic

Definition at line 267 of file recodebeam.h.

267  {
268  return (is_dawg * NC_COUNT + cont) * kNumLengths + length;
269  }

◆ combineSegmentedTimesteps()

std::vector< std::vector< std::pair< const char *, float > > > tesseract::RecodeBeamSearch::combineSegmentedTimesteps ( std::vector< std::vector< std::vector< std::pair< const char *, float >>>> *  segmentedTimesteps)

Definition at line 166 of file recodebeam.cpp.

168  {
169  std::vector<std::vector<std::pair<const char*, float>>> combined_timesteps;
170  for (int i = 0; i < segmentedTimesteps->size(); ++i){
171  for (int j = 0; j < (*segmentedTimesteps)[i].size(); ++j) {
172  combined_timesteps.push_back((*segmentedTimesteps)[i][j]);
173  }
174  }
175  return combined_timesteps;
176 }

◆ ContinuationFromBeamsIndex()

static NodeContinuation tesseract::RecodeBeamSearch::ContinuationFromBeamsIndex ( int  index)
inlinestatic

Definition at line 260 of file recodebeam.h.

260  {
261  return static_cast<NodeContinuation>((index / kNumLengths) % NC_COUNT);
262  }

◆ DebugBeams()

void tesseract::RecodeBeamSearch::DebugBeams ( const UNICHARSET unicharset) const

Definition at line 495 of file recodebeam.cpp.

495  {
496  for (int p = 0; p < beam_size_; ++p) {
497  for (int d = 0; d < 2; ++d) {
498  for (int c = 0; c < NC_COUNT; ++c) {
499  auto cont = static_cast<NodeContinuation>(c);
500  int index = BeamIndex(d, cont, 0);
501  if (beam_[p]->beams_[index].empty()) continue;
502  // Print all the best scoring nodes for each unichar found.
503  tprintf("Position %d: %s+%s beam\n", p, d ? "Dict" : "Non-Dict",
504  kNodeContNames[c]);
505  DebugBeamPos(unicharset, beam_[p]->beams_[index]);
506  }
507  }
508  }
509 }

◆ Decode() [1/2]

void tesseract::RecodeBeamSearch::Decode ( const GENERIC_2D_ARRAY< float > &  output,
double  dict_ratio,
double  cert_offset,
double  worst_dict_cert,
const UNICHARSET charset 
)

Definition at line 93 of file recodebeam.cpp.

96  {
97  beam_size_ = 0;
98  int width = output.dim1();
99  for (int t = 0; t < width; ++t) {
100  ComputeTopN(output[t], output.dim2(), kBeamWidths[0]);
101  DecodeStep(output[t], t, dict_ratio, cert_offset, worst_dict_cert, charset);
102  }
103 }

◆ Decode() [2/2]

void tesseract::RecodeBeamSearch::Decode ( const NetworkIO output,
double  dict_ratio,
double  cert_offset,
double  worst_dict_cert,
const UNICHARSET charset,
int  lstm_choice_mode = 0 
)

Definition at line 78 of file recodebeam.cpp.

80  {
81  beam_size_ = 0;
82  int width = output.Width();
83  if (lstm_choice_mode) timesteps.clear();
84  for (int t = 0; t < width; ++t) {
85  ComputeTopN(output.f(t), output.NumFeatures(), kBeamWidths[0]);
86  DecodeStep(output.f(t), t, dict_ratio, cert_offset, worst_dict_cert,
87  charset);
88  if (lstm_choice_mode) {
89  SaveMostCertainChoices(output.f(t), output.NumFeatures(), charset, t);
90  }
91  }
92 }

◆ DecodeSecondaryBeams()

void tesseract::RecodeBeamSearch::DecodeSecondaryBeams ( const NetworkIO output,
double  dict_ratio,
double  cert_offset,
double  worst_dict_cert,
const UNICHARSET charset,
int  lstm_choice_mode = 0 
)

Definition at line 105 of file recodebeam.cpp.

110  {
111  secondary_beam_.clear();
112  if (character_boundaries_.size() < 2) return;
113  int width = output.Width();
114  int bucketNumber = 0;
115  for (int t = 0; t < width; ++t) {
116  while ((bucketNumber + 1) < character_boundaries_.size() &&
117  t >= character_boundaries_[bucketNumber + 1])
118  {
119  ++bucketNumber;
120  }
121  ComputeSecTopN(&(excludedUnichars)[bucketNumber], output.f(t),
122  output.NumFeatures(), kBeamWidths[0]);
123  DecodeSecondaryStep(output.f(t), t, dict_ratio, cert_offset, worst_dict_cert,
124  charset);
125  }
126 }

◆ ExtractBestPathAsLabels()

void tesseract::RecodeBeamSearch::ExtractBestPathAsLabels ( GenericVector< int > *  labels,
GenericVector< int > *  xcoords 
) const

Definition at line 192 of file recodebeam.cpp.

193  {
194  labels->truncate(0);
195  xcoords->truncate(0);
197  ExtractBestPaths(&best_nodes, nullptr);
198  // Now just run CTC on the best nodes.
199  int t = 0;
200  int width = best_nodes.size();
201  while (t < width) {
202  int label = best_nodes[t]->code;
203  if (label != null_char_) {
204  labels->push_back(label);
205  xcoords->push_back(t);
206  }
207  while (++t < width && !is_simple_text_ && best_nodes[t]->code == label) {
208  }
209  }
210  xcoords->push_back(width);
211 }

◆ ExtractBestPathAsUnicharIds()

void tesseract::RecodeBeamSearch::ExtractBestPathAsUnicharIds ( bool  debug,
const UNICHARSET unicharset,
GenericVector< int > *  unichar_ids,
GenericVector< float > *  certs,
GenericVector< float > *  ratings,
GenericVector< int > *  xcoords 
) const

Definition at line 215 of file recodebeam.cpp.

218  {
220  ExtractBestPaths(&best_nodes, nullptr);
221  ExtractPathAsUnicharIds(best_nodes, unichar_ids, certs, ratings, xcoords);
222  if (debug) {
223  DebugPath(unicharset, best_nodes);
224  DebugUnicharPath(unicharset, best_nodes, *unichar_ids, *certs, *ratings,
225  *xcoords);
226  }
227 }

◆ ExtractBestPathAsWords()

void tesseract::RecodeBeamSearch::ExtractBestPathAsWords ( const TBOX line_box,
float  scale_factor,
bool  debug,
const UNICHARSET unicharset,
PointerVector< WERD_RES > *  words,
int  lstm_choice_mode = 0 
)

Definition at line 230 of file recodebeam.cpp.

234  {
235  words->truncate(0);
236  GenericVector<int> unichar_ids;
237  GenericVector<float> certs;
238  GenericVector<float> ratings;
239  GenericVector<int> xcoords;
242  character_boundaries_.clear();
243  ExtractBestPaths(&best_nodes, &second_nodes);
244  if (debug) {
245  DebugPath(unicharset, best_nodes);
246  ExtractPathAsUnicharIds(second_nodes, &unichar_ids, &certs, &ratings,
247  &xcoords);
248  tprintf("\nSecond choice path:\n");
249  DebugUnicharPath(unicharset, second_nodes, unichar_ids, certs, ratings,
250  xcoords);
251  }
252  // If lstm choice mode is required in granularity level 2, it stores the x
253  // Coordinates of every chosen character, to match the alternative choices to
254  // it.
255  ExtractPathAsUnicharIds(best_nodes, &unichar_ids, &certs, &ratings, &xcoords,
257  int num_ids = unichar_ids.size();
258  if (debug) {
259  DebugUnicharPath(unicharset, best_nodes, unichar_ids, certs, ratings,
260  xcoords);
261  }
262  // Convert labels to unichar-ids.
263  int word_end = 0;
264  float prev_space_cert = 0.0f;
265  for (int word_start = 0; word_start < num_ids; word_start = word_end) {
266  for (word_end = word_start + 1; word_end < num_ids; ++word_end) {
267  // A word is terminated when a space character or start_of_word flag is
268  // hit. We also want to force a separate word for every non
269  // space-delimited character when not in a dictionary context.
270  if (unichar_ids[word_end] == UNICHAR_SPACE) break;
271  int index = xcoords[word_end];
272  if (best_nodes[index]->start_of_word) break;
273  if (best_nodes[index]->permuter == TOP_CHOICE_PERM &&
274  (!unicharset->IsSpaceDelimited(unichar_ids[word_end]) ||
275  !unicharset->IsSpaceDelimited(unichar_ids[word_end - 1])))
276  break;
277  }
278  float space_cert = 0.0f;
279  if (word_end < num_ids && unichar_ids[word_end] == UNICHAR_SPACE)
280  space_cert = certs[word_end];
281  bool leading_space =
282  word_start > 0 && unichar_ids[word_start - 1] == UNICHAR_SPACE;
283  // Create a WERD_RES for the output word.
284  WERD_RES* word_res =
285  InitializeWord(leading_space, line_box, word_start, word_end,
286  std::min(space_cert, prev_space_cert), unicharset,
287  xcoords, scale_factor);
288  for (int i = word_start; i < word_end; ++i) {
289  auto* choices = new BLOB_CHOICE_LIST;
290  BLOB_CHOICE_IT bc_it(choices);
291  auto* choice = new BLOB_CHOICE(
292  unichar_ids[i], ratings[i], certs[i], -1, 1.0f,
293  static_cast<float>(INT16_MAX), 0.0f, BCC_STATIC_CLASSIFIER);
294  int col = i - word_start;
295  choice->set_matrix_cell(col, col);
296  bc_it.add_after_then_move(choice);
297  word_res->ratings->put(col, col, choices);
298  }
299  int index = xcoords[word_end - 1];
300  word_res->FakeWordFromRatings(best_nodes[index]->permuter);
301  words->push_back(word_res);
302  prev_space_cert = space_cert;
303  if (word_end < num_ids && unichar_ids[word_end] == UNICHAR_SPACE)
304  ++word_end;
305  }
306 }

◆ extractSymbolChoices()

void tesseract::RecodeBeamSearch::extractSymbolChoices ( const UNICHARSET unicharset)

Definition at line 395 of file recodebeam.cpp.

395  {
396  GenericVector<tesseract::RecodePair>* heaps = nullptr;
397  PointerVector<RecodeBeam>* currentBeam = nullptr;
398  if (character_boundaries_.size() < 2) return;
399  // For the first iteration the original beam is analyzed. After that a
400  // new beam is calculated based on the results from the original beam.
401  if (secondary_beam_.empty()) {
402  currentBeam = &beam_;
403  } else {
404  currentBeam = &secondary_beam_;
405  }
406  character_boundaries_[0] = 0;
407  for (int j = 1; j < character_boundaries_.size(); ++j) {
408  GenericVector<int> unichar_ids;
409  GenericVector<float> certs;
410  GenericVector<float> ratings;
411  GenericVector<int> xcoords;
412  int backpath = character_boundaries_[j] - character_boundaries_[j - 1];
413  heaps = currentBeam->get(character_boundaries_[j] - 1)->beams_->heap();
415  std::vector<const RecodeNode*> best;
416  // Scan the segmented node chain for valid unichar ids.
417  for (int i = 0; i < heaps->size(); ++i) {
418  bool validChar = false;
419  int backcounter = 0;
420  const RecodeNode* node = &heaps->get(i).data;
421  while (node != nullptr && backcounter < backpath) {
422  if (node->code != null_char_ && node->unichar_id != INVALID_UNICHAR_ID) {
423  validChar = true;
424  break;
425  }
426  node = node->prev;
427  ++backcounter;
428  }
429  if (validChar) best.push_back(&heaps->get(i).data);
430  }
431  // find the best rated segmented node chain and extract the unichar id.
432  if (!best.empty()) {
433  std::sort(best.begin(), best.end(), greater_than());
434  ExtractPath(best[0], &best_nodes, backpath);
435  ExtractPathAsUnicharIds(best_nodes, &unichar_ids, &certs, &ratings,
436  &xcoords);
437  }
438  if (!unichar_ids.empty()) {
439  int bestPos = 0;
440  for (int i = 1; i < unichar_ids.size(); ++i) {
441  if (ratings[i] < ratings[bestPos])
442  bestPos = i;
443  }
444  int bestCode = -10;
445  for (int i = 0; i < best_nodes.size(); ++i) {
446  if (best_nodes[i]->unichar_id == unichar_ids[bestPos]) {
447  bestCode = best_nodes[i]->code;
448  }
449  }
450  // Exclude the best choice for the followup decoding.
451  std::unordered_set<int> excludeCodeList;
452  for (int node = 0; node < best_nodes.size(); ++node) {
453  if (best_nodes[node]->code != null_char_) {
454  excludeCodeList.insert(best_nodes[node]->code);
455  }
456  }
457  if (j - 1 < excludedUnichars.size()) {
458  for (auto elem : excludeCodeList) {
459  excludedUnichars[j - 1].insert(elem);
460  }
461  } else {
462  excludedUnichars.push_back(excludeCodeList);
463  }
464  // Save the best choice for the choice iterator.
465  if (j - 1 < ctc_choices.size()) {
466  int id = unichar_ids[bestPos];
467  const char* result = unicharset->id_to_unichar_ext(id);
468  float rating = ratings[bestPos];
469  ctc_choices[j - 1].push_back(
470  std::pair<const char*, float>(result, rating));
471  } else {
472  std::vector<std::pair<const char*, float>> choice;
473  int id = unichar_ids[bestPos];
474  const char* result = unicharset->id_to_unichar_ext(id);
475  float rating = ratings[bestPos];
476  choice.push_back(std::pair<const char*, float>(result, rating));
477  ctc_choices.push_back(choice);
478  }
479  // fill the blank spot with an empty array
480  } else {
481  if (j - 1 >= excludedUnichars.size()) {
482  std::unordered_set<int> excludeCodeList;
483  excludedUnichars.push_back(excludeCodeList);
484  }
485  if (j - 1 >= ctc_choices.size()) {
486  std::vector<std::pair<const char*, float>> choice;
487  ctc_choices.push_back(choice);
488  }
489  }
490  }
491  secondary_beam_.clear();
492 }

◆ IsDawgFromBeamsIndex()

static bool tesseract::RecodeBeamSearch::IsDawgFromBeamsIndex ( int  index)
inlinestatic

Definition at line 263 of file recodebeam.h.

263  {
264  return index / (kNumLengths * NC_COUNT) > 0;
265  }

◆ LengthFromBeamsIndex()

static int tesseract::RecodeBeamSearch::LengthFromBeamsIndex ( int  index)
inlinestatic

Definition at line 259 of file recodebeam.h.

259 { return index % kNumLengths; }

◆ PrintBeam2()

void tesseract::RecodeBeamSearch::PrintBeam2 ( bool  uids,
int  num_outputs,
const UNICHARSET charset,
bool  secondary 
) const

Definition at line 315 of file recodebeam.cpp.

317  {
318  std::vector<std::vector<const RecodeNode*>> topology;
319  std::unordered_set<const RecodeNode*> visited;
320  const PointerVector<RecodeBeam>* beam = !secondary ? &beam_ : &secondary_beam_;
321  // create the topology
322  for (int step = beam->size()-1; step >=0; --step) {
323  std::vector<const RecodeNode*> layer;
324  topology.push_back(layer);
325  }
326  // fill the topology with depths first
327  for (int step = beam->size() - 1; step >= 0; --step) {
329  beam->get(step)->beams_->heap();
330  for (int node = 0; node < heaps->size(); ++node) {
331  int backtracker = 0;
332  const RecodeNode* curr = &heaps->get(node).data;
333  while (curr != nullptr && !visited.count(curr)) {
334  visited.insert(curr);
335  topology[step - backtracker].push_back(curr);
336  curr = curr->prev;
337  ++backtracker;
338  }
339  }
340  }
341  int ct = 0;
342  int cb = 1;
343  for (std::vector<const RecodeNode*> layer: topology) {
344  if (cb >= character_boundaries_.size())
345  break;
346  if (ct == character_boundaries_[cb]) {
347  tprintf("***\n");
348  ++cb;
349  }
350  for (const RecodeNode* node : layer) {
351  const char* code;
352  int intCode;
353  if (node->unichar_id != INVALID_UNICHAR_ID) {
354  code = charset->id_to_unichar(node->unichar_id);
355  intCode = node->unichar_id;
356  } else if(node->code == null_char_) {
357  intCode = 0;
358  code = " ";
359  } else {
360  intCode = 666;
361  code = "*";
362  }
363  int intPrevCode = 0;
364  const char* prevCode;
365  float prevScore = 0;
366  if (node->prev != nullptr) {
367  prevScore = node->prev->score;
368  if (node->prev->unichar_id != INVALID_UNICHAR_ID) {
369  prevCode = charset->id_to_unichar(node->prev->unichar_id);
370  intPrevCode = node->prev->unichar_id;
371  } else if (node->code == null_char_) {
372  intPrevCode = 0;
373  prevCode = " ";
374  } else {
375  prevCode = "*";
376  intPrevCode = 666;
377  }
378  } else {
379  prevCode = " ";
380  }
381  if (uids) {
382  tprintf("%x(|)%f(>)%x(|)%f\n", intPrevCode,
383  prevScore, intCode, node->score);
384  } else {
385  tprintf("%s(|)%f(>)%s(|)%f\n", prevCode,
386  prevScore, code, node->score);
387  }
388  }
389  tprintf("-\n");
390  ++ct;
391  }
392  tprintf("***\n");
393 }

◆ segmentTimestepsByCharacters()

void tesseract::RecodeBeamSearch::segmentTimestepsByCharacters ( )

Definition at line 156 of file recodebeam.cpp.

156  {
157  for (int i = 1; i < character_boundaries_.size(); ++i){
158  std::vector<std::vector<std::pair<const char*, float>>> segment;
159  for (int j = character_boundaries_[i - 1]; j < character_boundaries_[i]; ++j) {
160  segment.push_back(timesteps[j]);
161  }
162  segmentedTimesteps.push_back(segment);
163  }
164 }

Member Data Documentation

◆ character_boundaries_

std::vector<int> tesseract::RecodeBeamSearch::character_boundaries_

Definition at line 247 of file recodebeam.h.

◆ ctc_choices

std::vector<std::vector<std::pair<const char*, float> > > tesseract::RecodeBeamSearch::ctc_choices

Definition at line 243 of file recodebeam.h.

◆ excludedUnichars

std::vector<std::unordered_set<int> > tesseract::RecodeBeamSearch::excludedUnichars

Definition at line 245 of file recodebeam.h.

◆ kMinCertainty

constexpr float tesseract::RecodeBeamSearch::kMinCertainty = -20.0f
staticconstexpr

Definition at line 252 of file recodebeam.h.

◆ kNumBeams

const int tesseract::RecodeBeamSearch::kNumBeams = 2 * NC_COUNT * kNumLengths
static

Definition at line 257 of file recodebeam.h.

◆ kNumLengths

const int tesseract::RecodeBeamSearch::kNumLengths = RecodedCharID::kMaxCodeLen + 1
static

Definition at line 254 of file recodebeam.h.

◆ segmentedTimesteps

std::vector<std::vector<std::vector<std::pair<const char*, float> > > > tesseract::RecodeBeamSearch::segmentedTimesteps

Definition at line 241 of file recodebeam.h.

◆ timesteps

std::vector< std::vector<std::pair<const char*, float> > > tesseract::RecodeBeamSearch::timesteps

Definition at line 239 of file recodebeam.h.


The documentation for this class was generated from the following files:
WERD_RES::FakeWordFromRatings
void FakeWordFromRatings(PermuterType permuter)
Definition: pageres.cpp:894
tesseract::RecodeBeamSearch::excludedUnichars
std::vector< std::unordered_set< int > > excludedUnichars
Definition: recodebeam.h:245
tesseract::RecodeBeamSearch::ctc_choices
std::vector< std::vector< std::pair< const char *, float > > > ctc_choices
Definition: recodebeam.h:243
UNICHARSET::id_to_unichar_ext
const char * id_to_unichar_ext(UNICHAR_ID id) const
Definition: unicharset.cpp:298
WERD_RES
Definition: pageres.h:160
tesseract::RecodeBeamSearch::timesteps
std::vector< std::vector< std::pair< const char *, float > > > timesteps
Definition: recodebeam.h:239
tesseract::PointerVector::truncate
void truncate(int size)
Definition: genericvector.h:457
tesseract::PointerVector::clear
void clear()
Definition: genericvector.h:490
UNICHARSET::IsSpaceDelimited
bool IsSpaceDelimited(UNICHAR_ID unichar_id) const
Definition: unicharset.h:642
WERD_RES::ratings
MATRIX * ratings
Definition: pageres.h:231
GenericVector::push_back
int push_back(T object)
Definition: genericvector.h:799
GENERIC_2D_ARRAY::dim2
int dim2() const
Definition: matrix.h:206
UNICHAR_SPACE
Definition: unicharset.h:34
tesseract::KDPair::data
Data data
Definition: kdpair.h:45
GenericVector::empty
bool empty() const
Definition: genericvector.h:86
tesseract::RecodeBeamSearch::kNumLengths
static const int kNumLengths
Definition: recodebeam.h:254
tesseract::NC_COUNT
Definition: recodebeam.h:81
null_char_
int null_char_
Definition: unicharcompress_test.cc:168
TOP_CHOICE_PERM
Definition: ratngs.h:233
tesseract::RecodeBeamSearch::BeamIndex
static int BeamIndex(bool is_dawg, NodeContinuation cont, int length)
Definition: recodebeam.h:267
GenericVector
Definition: baseapi.h:40
BLOB_CHOICE
Definition: ratngs.h:49
GenericVector::truncate
void truncate(int size)
Definition: genericvector.h:132
GenericVector::get
T & get(int index) const
Definition: genericvector.h:716
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::RecodeBeamSearch::character_boundaries_
std::vector< int > character_boundaries_
Definition: recodebeam.h:247
tesseract::Dict::IsSpaceDelimitedLang
bool IsSpaceDelimitedLang() const
Returns true if the language is space-delimited (not CJ, or T).
Definition: dict.cpp:883
UNICHARSET::id_to_unichar
const char * id_to_unichar(UNICHAR_ID id) const
Definition: unicharset.cpp:290
GenericVector::size
int size() const
Definition: genericvector.h:71
GENERIC_2D_ARRAY::dim1
int dim1() const
Definition: matrix.h:205
tesseract::RecodeBeamSearch::segmentedTimesteps
std::vector< std::vector< std::vector< std::pair< const char *, float > > > > segmentedTimesteps
Definition: recodebeam.h:241
BCC_STATIC_CLASSIFIER
Definition: ratngs.h:42