-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00005_source.html
591 lines (589 loc) · 649 KB
/
a00005_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: /usr/src/tesseract-ocr.master/src/api/baseapi.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">tesseract
 <span id="projectnumber">4.0.0-1-g2a2b</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00005_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">baseapi.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00005.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/**********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * File: baseapi.cpp</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Description: Simple API for calling tesseract.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Author: Ray Smith</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * (C) Copyright 2006, Google Inc.</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> ** Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> ** you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> ** You may obtain a copy of the License at</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> ** http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> ** Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> ** distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> ** See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> ** limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> **********************************************************************/</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// Include automatically generated configuration file if running autoconf.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "config_auto.h"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="a00008.html">baseapi.h</a>"</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#ifdef __linux__</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <csignal></span> <span class="comment">// for sigaction, SA_RESETHAND, SIGBUS, SIGFPE</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#if defined(_WIN32)</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#if defined(__MINGW32__)</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// workaround for stdlib.h with -std=c++11 for _splitpath and _MAX_FNAME</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#undef __STRICT_ANSI__</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#endif // __MINGW32__</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <fcntl.h></span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <io.h></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include <dirent.h></span> <span class="comment">// for closedir, opendir, readdir, DIR, dirent</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#include <libgen.h></span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#include <sys/types.h></span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#include <sys/stat.h></span> <span class="comment">// for stat, S_IFDIR</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#include <unistd.h></span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#endif // _WIN32</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#include <clocale></span> <span class="comment">// for LC_ALL, LC_CTYPE, LC_NUMERIC</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include <cmath></span> <span class="comment">// for round, M_PI</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#include <cstdint></span> <span class="comment">// for int32_t</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#include <cstring></span> <span class="comment">// for strcmp, strcpy</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#include <fstream></span> <span class="comment">// for size_t</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#include <iostream></span> <span class="comment">// for std::cin</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#include <memory></span> <span class="comment">// for std::unique_ptr</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#include <set></span> <span class="comment">// for std::pair</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="preprocessor">#include <vector></span> <span class="comment">// for std::vector</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#include "allheaders.h"</span> <span class="comment">// for pixDestroy, boxCreate, boxaAddBox, box...</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#include "<a class="code" href="a00653.html">blobclass.h</a>"</span> <span class="comment">// for ExtractFontName</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#include "<a class="code" href="a00248.html">boxword.h</a>"</span> <span class="comment">// for BoxWord</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#include "config_auto.h"</span> <span class="comment">// for PACKAGE_VERSION</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="preprocessor">#include "<a class="code" href="a00260.html">coutln.h</a>"</span> <span class="comment">// for C_OUTLINE_IT, C_OUTLINE_LIST</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor">#include "<a class="code" href="a00902.html">dawg_cache.h</a>"</span> <span class="comment">// for DawgCache</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#include "<a class="code" href="a00908.html">dict.h</a>"</span> <span class="comment">// for Dict</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#include "<a class="code" href="a01163.html">edgblob.h</a>"</span> <span class="comment">// for extract_edges</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#include "<a class="code" href="a00491.html">elst.h</a>"</span> <span class="comment">// for ELIST_ITERATOR, ELISTIZE, ELISTIZEH</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#include "environ.h"</span> <span class="comment">// for l_uint8, FALSE, TRUE</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor">#include "<a class="code" href="a00086.html">equationdetect.h</a>"</span> <span class="comment">// for EquationDetect</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor">#include "<a class="code" href="a00503.html">errcode.h</a>"</span> <span class="comment">// for ASSERT_HOST</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#include "<a class="code" href="a00524.html">globaloc.h</a>"</span> <span class="comment">// for SavePixForCrash, signal_exit</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor">#include "<a class="code" href="a00527.html">helpers.h</a>"</span> <span class="comment">// for IntCastRounded, chomp_string</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor">#include "<a class="code" href="a00530.html">host.h</a>"</span> <span class="comment">// for BOOL8</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#include "imageio.h"</span> <span class="comment">// for IFF_TIFF_G4, IFF_TIFF, IFF_TIFF_G3</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor">#include "<a class="code" href="a00725.html">intfx.h</a>"</span> <span class="comment">// for INT_FX_RESULT_STRUCT</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor">#include "<a class="code" href="a00110.html">mutableiterator.h</a>"</span> <span class="comment">// for MutableIterator</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#include "<a class="code" href="a00314.html">normalis.h</a>"</span> <span class="comment">// for kBlnBaselineOffset, kBlnXHeight</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor">#include "<a class="code" href="a00551.html">ocrclass.h</a>"</span> <span class="comment">// for ETEXT_DESC</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="preprocessor">#include "<a class="code" href="a01073.html">openclwrapper.h</a>"</span> <span class="comment">// for PERF_COUNT_END, PERF_COUNT_START, PERF...</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor">#include "<a class="code" href="a00116.html">osdetect.h</a>"</span> <span class="comment">// for OSResults, OSBestResult, OrientationId...</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor">#include "<a class="code" href="a00344.html">pageres.h</a>"</span> <span class="comment">// for PAGE_RES_IT, WERD_RES, PAGE_RES, CR_DE...</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="preprocessor">#include "<a class="code" href="a00143.html">paragraphs.h</a>"</span> <span class="comment">// for DetectParagraphs</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#include "<a class="code" href="a00557.html">params.h</a>"</span> <span class="comment">// for BoolParam, IntParam, DoubleParam, Stri...</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="preprocessor">#include "<a class="code" href="a00356.html">pdblock.h</a>"</span> <span class="comment">// for PDBLK</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#include "<a class="code" href="a00362.html">points.h</a>"</span> <span class="comment">// for FCOORD</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor">#include "<a class="code" href="a00374.html">polyblk.h</a>"</span> <span class="comment">// for POLY_BLOCK</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="preprocessor">#include "<a class="code" href="a00407.html">rect.h</a>"</span> <span class="comment">// for TBOX</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#include "<a class="code" href="a00023.html">renderer.h</a>"</span> <span class="comment">// for TessResultRenderer</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="preprocessor">#include "<a class="code" href="a00173.html">resultiterator.h</a>"</span> <span class="comment">// for ResultIterator</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="preprocessor">#include "<a class="code" href="a00437.html">stepblob.h</a>"</span> <span class="comment">// for C_BLOB_IT, C_BLOB, C_BLOB_LIST</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#include "<a class="code" href="a00584.html">strngs.h</a>"</span> <span class="comment">// for STRING</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="preprocessor">#include "<a class="code" href="a00593.html">tessdatamanager.h</a>"</span> <span class="comment">// for TessdataManager, kTrainedDataSuffix</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="preprocessor">#include "<a class="code" href="a00191.html">tesseractclass.h</a>"</span> <span class="comment">// for Tesseract</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="preprocessor">#include "<a class="code" href="a00206.html">thresholder.h</a>"</span> <span class="comment">// for ImageThresholder</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="preprocessor">#include "<a class="code" href="a00599.html">tprintf.h</a>"</span> <span class="comment">// for tprintf</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#include "<a class="code" href="a00449.html">werd.h</a>"</span> <span class="comment">// for WERD, WERD_IT, W_FUZZY_NON, W_FUZZY_SP</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="a00005.html#ad341e2a0385debc2342a18dfa9e5b3ec"> 92</a></span> <a class="code" href="a00557.html#a442e7f541a050acf5ebda026db177877">BOOL_VAR</a>(<a class="code" href="a00005.html#ad341e2a0385debc2342a18dfa9e5b3ec">stream_filelist</a>, <a class="code" href="a00014.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, <span class="stringliteral">"Stream a filelist from stdin"</span>);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="a01629.html"> 94</a></span> <span class="keyword">namespace </span><a class="code" href="a01629.html">tesseract</a> {</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="a01629.html#a11307fd919d7a9313500b04cfc1a8e3d"> 97</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a11307fd919d7a9313500b04cfc1a8e3d">kMinRectSize</a> = 10;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="a01629.html#a1083ed81b6adbb6930e87d0c58671e26"> 99</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="a01629.html#a1083ed81b6adbb6930e87d0c58671e26">kTesseractReject</a> = <span class="charliteral">'~'</span>;</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106"> 101</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106">kUNLVReject</a> = <span class="charliteral">'~'</span>;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="a01629.html#af7e73b761f145b66ffcc7585ed69d940"> 103</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="a01629.html#af7e73b761f145b66ffcc7585ed69d940">kUNLVSuspect</a> = <span class="charliteral">'^'</span>;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="a01629.html#a3ba7b8d4b2132f72118c62fba346ffd0"> 108</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a01629.html#a3ba7b8d4b2132f72118c62fba346ffd0">kInputFile</a> = <span class="stringliteral">"noname.tif"</span>;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2"> 112</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2">kOldVarsFile</a> = <span class="stringliteral">"failed_vars.txt"</span>;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="a01629.html#a3e35711780f8c0254a2dd64071ef2b6b"> 114</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a3e35711780f8c0254a2dd64071ef2b6b">kMaxIntSize</a> = 22;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment">/* Add all available languages recursively.</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment">*/</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">static</span> <span class="keywordtype">void</span> addAvailableLanguages(<span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> &datadir, <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> &base,</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <a class="code" href="a02182.html">GenericVector<STRING></a>* langs)</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> base2 = (base.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>()[0] == <span class="charliteral">'\0'</span>) ? base : base + <span class="stringliteral">"/"</span>;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> extlen = <span class="keyword">sizeof</span>(kTrainedDataSuffix);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="preprocessor">#ifdef _WIN32</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  WIN32_FIND_DATA data;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  HANDLE handle = FindFirstFile((datadir + base2 + <span class="stringliteral">"*"</span>).<span class="keywordtype">string</span>(), &data);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">if</span> (handle != INVALID_HANDLE_VALUE) {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="a00014.html#ae4cc35dcc70810fa972cc8a5185a28fa">BOOL</a> result = <a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">for</span> (; result;) {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">char</span> *name = data.cFileName;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment">// Skip '.', '..', and hidden files</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span> (name[0] != <span class="charliteral">'.'</span>) {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">if</span> ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ==</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  FILE_ATTRIBUTE_DIRECTORY) {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  addAvailableLanguages(datadir, base2 + name, langs);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordtype">size_t</span> len = strlen(name);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">if</span> (len > extlen && name[len - extlen] == <span class="charliteral">'.'</span> &&</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  strcmp(&name[len - extlen + 1], kTrainedDataSuffix) == 0) {</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  name[len - extlen] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  langs-><a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(base2 + name);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  }</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  }</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  result = FindNextFile(handle, &data);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  FindClose(handle);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  }</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="preprocessor">#else // _WIN32</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <a class="code" href="a00365.html#a6c8de73bb604d91743c7f6f356eb171e">DIR</a>* dir = opendir((datadir + base).<span class="keywordtype">string</span>());</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">if</span> (dir != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  dirent *de;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">while</span> ((de = readdir(dir))) {</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordtype">char</span> *name = de->d_name;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="comment">// Skip '.', '..', and hidden files</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">if</span> (name[0] != <span class="charliteral">'.'</span>) {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keyword">struct </span>stat st;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> (stat((datadir + base2 + name).<span class="keywordtype">string</span>(), &st) == 0 &&</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  (st.st_mode & S_IFDIR) == S_IFDIR) {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  addAvailableLanguages(datadir, base2 + name, langs);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordtype">size_t</span> len = strlen(name);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keywordflow">if</span> (len > extlen && name[len - extlen] == <span class="charliteral">'.'</span> &&</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  strcmp(&name[len - extlen + 1], kTrainedDataSuffix) == 0) {</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  name[len - extlen] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  langs-><a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(base2 + name);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  }</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  }</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  }</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  closedir(dir);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  }</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> }</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> </div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment">// Compare two STRING values (used for sorting).</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="keyword">static</span> <span class="keywordtype">int</span> CompareSTRING(<span class="keyword">const</span> <span class="keywordtype">void</span>* p1, <span class="keyword">const</span> <span class="keywordtype">void</span>* p2) {</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a>* s1 = <span class="keyword">static_cast<</span><span class="keyword">const </span><a class="code" href="a02834.html">STRING</a>*<span class="keyword">></span>(p1);</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a>* s2 = <span class="keyword">static_cast<</span><span class="keyword">const </span><a class="code" href="a02834.html">STRING</a>*<span class="keyword">></span>(p2);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> strcmp(s1-><a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>(), s2-><a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>());</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="a02186.html#a3bc4277652df23eaeccd0629f2b1419d"> 182</a></span> <a class="code" href="a02186.html#a3bc4277652df23eaeccd0629f2b1419d">TessBaseAPI::TessBaseAPI</a>()</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  : tesseract_(nullptr),</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  osd_tesseract_(nullptr),</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  equ_detect_(nullptr),</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  reader_(nullptr),</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="comment">// Thresholder is initialized to nullptr here, but will be set before use by:</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="comment">// A constructor of a derived API, SetThresholder(), or</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="comment">// created implicitly when used in InternalSetImage.</span></div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  thresholder_(nullptr),</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  paragraph_models_(nullptr),</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  block_list_(nullptr),</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  page_res_(nullptr),</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  input_file_(nullptr),</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  output_file_(nullptr),</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  datapath_(nullptr),</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  language_(nullptr),</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  last_oem_requested_(<a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aeae7376c1e8d55b9d13e75c639a6930159">OEM_DEFAULT</a>),</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  recognition_done_(false),</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  truth_cb_(nullptr),</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  rect_left_(0),</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  rect_top_(0),</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  rect_width_(0),</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  rect_height_(0),</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  image_width_(0),</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  image_height_(0) {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *locale;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  locale = std::setlocale(LC_ALL, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!strcmp(locale, <span class="stringliteral">"C"</span>));</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  locale = std::setlocale(LC_CTYPE, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!strcmp(locale, <span class="stringliteral">"C"</span>));</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  locale = std::setlocale(LC_NUMERIC, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(!strcmp(locale, <span class="stringliteral">"C"</span>));</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span> }</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> </div><div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="a02186.html#a02df6c7886962e347e3c5f7c1f632337"> 216</a></span> <a class="code" href="a02186.html#a02df6c7886962e347e3c5f7c1f632337">TessBaseAPI::~TessBaseAPI</a>() {</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="a01625.html#ga38027513ee9c0348de1790bddcdc3391">End</a>();</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> </div><div class="line"><a name="l00223"></a><span class="lineno"><a class="line" href="a02186.html#a3785779c909fcdd77e24b340f5913e4b"> 223</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a02186.html#a3785779c909fcdd77e24b340f5913e4b">TessBaseAPI::Version</a>() {</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">return</span> PACKAGE_VERSION;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> }</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span> <span class="preprocessor">#ifdef USE_OPENCL</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="preprocessor">#ifdef USE_DEVICE_SELECTION</span></div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> <span class="preprocessor">#include "<a class="code" href="a01067.html">opencl_device_selection.h</a>"</span></div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="a02186.html#a9fa206aa9e155ac8ff31b60a0ef128ca"> 239</a></span> <span class="keywordtype">size_t</span> <a class="code" href="a02186.html#a9fa206aa9e155ac8ff31b60a0ef128ca">TessBaseAPI::getOpenCLDevice</a>(<span class="keywordtype">void</span> **data) {</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="preprocessor">#ifdef USE_OPENCL</span></div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="preprocessor">#ifdef USE_DEVICE_SELECTION</span></div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  ds_device device = OpenclDevice::getDeviceSelection();</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keywordflow">if</span> (device.type == DS_DEVICE_OPENCL_DEVICE) {</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  *data = <span class="keyword">new</span> cl_device_id;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  memcpy(*data, &device.oclDeviceID, <span class="keyword">sizeof</span>(cl_device_id));</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(cl_device_id);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  }</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> </div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  *data = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span> }</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><div class="line"><a name="l00259"></a><span class="lineno"><a class="line" href="a02186.html#ae7a2e532aa6b1ca5db071af78c34ed21"> 259</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#ae7a2e532aa6b1ca5db071af78c34ed21">TessBaseAPI::CatchSignals</a>() {</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> <span class="preprocessor">#ifdef __linux__</span></div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keyword">struct </span>sigaction action;</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  memset(&action, 0, <span class="keyword">sizeof</span>(action));</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  action.sa_handler = &<a class="code" href="a00503.html#a5bc45d1c7b7602898f2c7edc72cbcd37">signal_exit</a>;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  action.sa_flags = SA_RESETHAND;</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  sigaction(SIGSEGV, &action, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  sigaction(SIGFPE, &action, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  sigaction(SIGBUS, &action, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="comment">// Warn API users that an implementation is needed.</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"CatchSignals has no non-linux implementation!\n"</span>);</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> }</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span> </div><div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="a02186.html#a896312e68d246b58e704a8f5576e6917"> 278</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a896312e68d246b58e704a8f5576e6917">TessBaseAPI::SetInputName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name) {</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> = <span class="keyword">new</span> <a class="code" href="a02834.html">STRING</a>(name);</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  *<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> = name;</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> }</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> </div><div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="a02186.html#af997008815be7af2edcd9ff1a5d55896"> 286</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#af997008815be7af2edcd9ff1a5d55896">TessBaseAPI::SetOutputName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name) {</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a> = <span class="keyword">new</span> <a class="code" href="a02834.html">STRING</a>(name);</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  *<a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a> = name;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> }</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div><div class="line"><a name="l00293"></a><span class="lineno"><a class="line" href="a02186.html#a2e09259c558c6d8e0f7e523cbaf5adf5"> 293</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#a2e09259c558c6d8e0f7e523cbaf5adf5">TessBaseAPI::SetVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <span class="keywordtype">char</span>* value) {</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="keywordflow">return</span> <a class="code" href="a02794.html#aecfd4f0112e3753b19c856d210fb8f69">ParamUtils::SetParam</a>(name, value, <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5a713c7bc13788ed69eb16dd9e5f309d12">SET_PARAM_CONSTRAINT_NON_INIT_ONLY</a>,</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div><div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="a02186.html#a20c9b24d670ab01dd7f011727b7a8daa"> 299</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#a20c9b24d670ab01dd7f011727b7a8daa">TessBaseAPI::SetDebugVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <span class="keywordtype">char</span>* value) {</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordflow">return</span> <a class="code" href="a02794.html#aecfd4f0112e3753b19c856d210fb8f69">ParamUtils::SetParam</a>(name, value, <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0">SET_PARAM_CONSTRAINT_DEBUG_ONLY</a>,</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span> }</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div><div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="a02186.html#a25d71dd25faea83cc91db902f2997297"> 305</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#a25d71dd25faea83cc91db902f2997297">TessBaseAPI::GetIntVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">int</span> *value)<span class="keyword"> const </span>{</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <a class="code" href="a02802.html">IntParam</a> *p = ParamUtils::FindParam<IntParam>(</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  name, <a class="code" href="a00554.html#a71a3243019391d3a438fd279c07cef87">GlobalParams</a>()-><a class="code" href="a02790.html#a22c42b48d2c626d2f3f3b0abd21bc902">int_params</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>()-><a class="code" href="a02790.html#a22c42b48d2c626d2f3f3b0abd21bc902">int_params</a>);</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordflow">if</span> (p == <span class="keyword">nullptr</span>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  *value = (int32_t)(*p);</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> }</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="a02186.html#adc8316d75713a2abf5373f85f6f58a93"> 313</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#adc8316d75713a2abf5373f85f6f58a93">TessBaseAPI::GetBoolVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">bool</span> *value)<span class="keyword"> const </span>{</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <a class="code" href="a02806.html">BoolParam</a> *p = ParamUtils::FindParam<BoolParam>(</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  name, <a class="code" href="a00554.html#a71a3243019391d3a438fd279c07cef87">GlobalParams</a>()-><a class="code" href="a02790.html#a6bb13133287d8d8d18c81bb974b1b54f">bool_params</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>()-><a class="code" href="a02790.html#a6bb13133287d8d8d18c81bb974b1b54f">bool_params</a>);</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordflow">if</span> (p == <span class="keyword">nullptr</span>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  *value = (<a class="code" href="a00530.html#a865cbe4908be24ccc32d2fbd598281d0">BOOL8</a>)(*p);</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span> }</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span> </div><div class="line"><a name="l00321"></a><span class="lineno"><a class="line" href="a02186.html#ab19ab050d998ca02561bb417eb6969c1"> 321</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="a02186.html#ab19ab050d998ca02561bb417eb6969c1">TessBaseAPI::GetStringVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name)<span class="keyword"> const </span>{</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <a class="code" href="a02810.html">StringParam</a> *p = ParamUtils::FindParam<StringParam>(</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  name, <a class="code" href="a00554.html#a71a3243019391d3a438fd279c07cef87">GlobalParams</a>()-><a class="code" href="a02790.html#a446a70d7d7c85af255d053ae54c5df8a">string_params</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>()-><a class="code" href="a02790.html#a446a70d7d7c85af255d053ae54c5df8a">string_params</a>);</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="keywordflow">return</span> (p != <span class="keyword">nullptr</span>) ? p-><a class="code" href="a02810.html#a87f73f314269f6a105854984981a5f8d">string</a>() : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span> }</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span> </div><div class="line"><a name="l00327"></a><span class="lineno"><a class="line" href="a02186.html#ae4a4e56d5c8ffd8d1c38d09daa32858a"> 327</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#ae4a4e56d5c8ffd8d1c38d09daa32858a">TessBaseAPI::GetDoubleVariable</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keywordtype">double</span> *value)<span class="keyword"> const </span>{</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <a class="code" href="a02814.html">DoubleParam</a> *p = ParamUtils::FindParam<DoubleParam>(</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  name, <a class="code" href="a00554.html#a71a3243019391d3a438fd279c07cef87">GlobalParams</a>()-><a class="code" href="a02790.html#a83a1b9a0571c97380bdf3a32591cf196">double_params</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>()-><a class="code" href="a02790.html#a83a1b9a0571c97380bdf3a32591cf196">double_params</a>);</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="keywordflow">if</span> (p == <span class="keyword">nullptr</span>) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  *value = (double)(*p);</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span> }</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div><div class="line"><a name="l00336"></a><span class="lineno"><a class="line" href="a02186.html#aa40487f19e71221f05bb3ad5dd36c437"> 336</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#aa40487f19e71221f05bb3ad5dd36c437">TessBaseAPI::GetVariableAsString</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <a class="code" href="a02834.html">STRING</a> *val) {</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="keywordflow">return</span> <a class="code" href="a02794.html#a53d101144fd6a9e6d45980e832f9e054">ParamUtils::GetParamAsString</a>(name, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>(), val);</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span> }</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span> </div><div class="line"><a name="l00341"></a><span class="lineno"><a class="line" href="a02186.html#a9b25f5b2e2e3d9791e145355e91efdea"> 341</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a9b25f5b2e2e3d9791e145355e91efdea">TessBaseAPI::PrintVariables</a>(FILE *fp)<span class="keyword"> const </span>{</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <a class="code" href="a02794.html#ac9884aced9c9941e8df8763960d798c4">ParamUtils::PrintParams</a>(fp, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span> }</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> </div><div class="line"><a name="l00353"></a><span class="lineno"><a class="line" href="a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e"> 353</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e">TessBaseAPI::Init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* datapath, <span class="keyword">const</span> <span class="keywordtype">char</span>* language,</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421ae">OcrEngineMode</a> oem, <span class="keywordtype">char</span> **configs, <span class="keywordtype">int</span> configs_size,</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<STRING></a> *vars_vec,</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<STRING></a> *vars_values,</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="keywordtype">bool</span> set_only_non_debug_params) {</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e">Init</a>(datapath, 0, language, <a class="code" href="a01625.html#ga97d470c76d2ff9580ac70e547eb8be99">oem</a>, configs, configs_size, vars_vec,</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  vars_values, set_only_non_debug_params, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span> }</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> <span class="comment">// In-memory version reads the traineddata file directly from the given</span></div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> <span class="comment">// data[data_size] array. Also implements the version with a datapath in data,</span></div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span> <span class="comment">// flagged by data_size = 0.</span></div><div class="line"><a name="l00365"></a><span class="lineno"><a class="line" href="a02186.html#a2be07b4c9449b8cfc43e9c26ee623050"> 365</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e">TessBaseAPI::Init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> data_size, <span class="keyword">const</span> <span class="keywordtype">char</span>* language,</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421ae">OcrEngineMode</a> oem, <span class="keywordtype">char</span>** configs, <span class="keywordtype">int</span> configs_size,</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<STRING></a>* vars_vec,</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<STRING></a>* vars_values,</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordtype">bool</span> set_only_non_debug_params, <a class="code" href="a01629.html#a689189939684bc6f10754a77a4c6c569">FileReader</a> reader) {</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <a class="code" href="a01073.html#a7b1e67112c5c3cc13ba8f90c8b60f05e">PERF_COUNT_START</a>(<span class="stringliteral">"TessBaseAPI::Init"</span>)</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="comment">// Default language is "eng".</span></div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keywordflow">if</span> (language == <span class="keyword">nullptr</span>) language = <span class="stringliteral">"eng"</span>;</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <a class="code" href="a02834.html">STRING</a> datapath = data_size == 0 ? data : language;</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="comment">// If the datapath, OcrEngineMode or the language have changed - start again.</span></div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="comment">// Note that the language_ field stores the last requested language that was</span></div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="comment">// initialized successfully, while tesseract_->lang stores the language</span></div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="comment">// actually used. They differ only if the requested language was nullptr, in</span></div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="comment">// which case tesseract_->lang is set to the Tesseract default ("eng").</span></div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  (<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> == <span class="keyword">nullptr</span> || *<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> != datapath ||</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <a class="code" href="a02186.html#af9d4095a569fbf8687cefc005d2f58ee">last_oem_requested_</a> != <a class="code" href="a01625.html#ga97d470c76d2ff9580ac70e547eb8be99">oem</a> ||</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  (*<a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> != language && <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">lang</a> != language))) {</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>;</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  }</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="comment">// PERF_COUNT_SUB("delete tesseract_")</span></div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span> <span class="preprocessor">#ifdef USE_OPENCL</span></div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  OpenclDevice od;</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  od.InitEnv();</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <a class="code" href="a01073.html#a61302b59795a7ee480de0bb07dda984a">PERF_COUNT_SUB</a>(<span class="stringliteral">"OD::InitEnv()"</span>)</div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keywordtype">bool</span> reset_classifier = <span class="keyword">true</span>;</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  reset_classifier = <span class="keyword">false</span>;</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keywordflow">if</span> (reader != <span class="keyword">nullptr</span>) <a class="code" href="a02186.html#a83549f01f06c140e14dad3f8c025d885">reader_</a> = reader;</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <a class="code" href="a03906.html">TessdataManager</a> mgr(<a class="code" href="a02186.html#a83549f01f06c140e14dad3f8c025d885">reader_</a>);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <span class="keywordflow">if</span> (data_size != 0) {</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  mgr.<a class="code" href="a03906.html#adde3e0fbebf692babd33bfe4c7eabeef">LoadMemBuffer</a>(language, data, data_size);</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  }</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a1267fb55994276b60fa5f5a34f508135">init_tesseract</a>(</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  datapath.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a> != <span class="keyword">nullptr</span> ? <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>() : <span class="keyword">nullptr</span>,</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  language, <a class="code" href="a01625.html#ga97d470c76d2ff9580ac70e547eb8be99">oem</a>, configs, configs_size, vars_vec, vars_values,</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  set_only_non_debug_params, &mgr) != 0) {</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  }</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  }</div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span> </div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <a class="code" href="a01073.html#a61302b59795a7ee480de0bb07dda984a">PERF_COUNT_SUB</a>(<span class="stringliteral">"update tesseract_"</span>)</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="comment">// Update datapath and language requested for the last valid initialization.</span></div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> = <span class="keyword">new</span> <a class="code" href="a02834.html">STRING</a>(datapath);</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  *<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> = datapath;</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="keywordflow">if</span> ((strcmp(<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="stringliteral">""</span>) == 0) &&</div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  (strcmp(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a4932d2070d3b91264958078abc991b17">datadir</a>.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="stringliteral">""</span>) != 0))</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  *<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a4932d2070d3b91264958078abc991b17">datadir</a>;</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span> </div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  if (<a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> = <span class="keyword">new</span> <a class="code" href="a02834.html">STRING</a>(language);</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  *<a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> = language;</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <a class="code" href="a02186.html#af9d4095a569fbf8687cefc005d2f58ee">last_oem_requested_</a> = <a class="code" href="a01625.html#ga97d470c76d2ff9580ac70e547eb8be99">oem</a>;</div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span> </div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <span class="comment">// PERF_COUNT_SUB("update last_oem_requested_")</span></div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="comment">// For same language and datapath, just reset the adaptive classifier.</span></div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="keywordflow">if</span> (reset_classifier) {</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aa1c9c8ed630b708cf88c97b863c0f1f8">ResetAdaptiveClassifier</a>();</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <a class="code" href="a01073.html#a61302b59795a7ee480de0bb07dda984a">PERF_COUNT_SUB</a>(<span class="stringliteral">"tesseract_->ResetAdaptiveClassifier()"</span>)</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  }</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <a class="code" href="a01073.html#a0a1c82e812e15164718039c84cd9e97b">PERF_COUNT_END</a></div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span> }</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span> </div><div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="a02186.html#a0386e985be293558230c5515e5612075"> 446</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a02186.html#a0386e985be293558230c5515e5612075">TessBaseAPI::GetInitLanguagesAsString</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">return</span> (<a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>() == <span class="keyword">nullptr</span>) ?</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="stringliteral">""</span> : <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>();</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span> }</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span> </div><div class="line"><a name="l00456"></a><span class="lineno"><a class="line" href="a02186.html#a7762996878d9588a72e76de414af9773"> 456</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a7762996878d9588a72e76de414af9773">TessBaseAPI::GetLoadedLanguagesAsVector</a>(</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  <a class="code" href="a02182.html">GenericVector<STRING></a>* langs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  langs-><a class="code" href="a02182.html#a9cdbff49b186574b83e43afba606fdd9">clear</a>();</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  langs-><a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">lang</a>);</div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  <span class="keywordtype">int</span> num_subs = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a3af5306b9473bede1537854e54fa796d">num_sub_langs</a>();</div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < num_subs; ++i)</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  langs-><a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#af0786d38a5addce72e377b9479170522">get_sub_lang</a>(i)-><a class="code" href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">lang</a>);</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  }</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span> }</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span> </div><div class="line"><a name="l00470"></a><span class="lineno"><a class="line" href="a02186.html#ae31284b65bc7045068c6b26eb042caaa"> 470</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#ae31284b65bc7045068c6b26eb042caaa">TessBaseAPI::GetAvailableLanguagesAsVector</a>(</div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  <a class="code" href="a02182.html">GenericVector<STRING></a>* langs)<span class="keyword"> const </span>{</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  langs-><a class="code" href="a02182.html#a9cdbff49b186574b83e43afba606fdd9">clear</a>();</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  addAvailableLanguages(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a4932d2070d3b91264958078abc991b17">datadir</a>, <span class="stringliteral">""</span>, langs);</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  langs-><a class="code" href="a02182.html#a999bbd8ff336c81fe1198ea714c7936d">sort</a>(CompareSTRING);</div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  }</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span> }</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span> </div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span> <span class="comment">//TODO(amit): Adapt to lstm</span></div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span> </div><div class="line"><a name="l00487"></a><span class="lineno"><a class="line" href="a02186.html#ac5fdc031598e1237ec7e30c5efa95840"> 487</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#ac5fdc031598e1237ec7e30c5efa95840">TessBaseAPI::InitLangMod</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* datapath, <span class="keyword">const</span> <span class="keywordtype">char</span>* language) {</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  <a class="code" href="a02794.html#a7cd09c9e0e69f8acbc519cc1c8bbbf17">ParamUtils::ResetToDefaults</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <a class="code" href="a03906.html">TessdataManager</a> mgr;</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aa70b2ded9dec4174cac0c3475811629f">init_tesseract_lm</a>(datapath, <span class="keyword">nullptr</span>, language, &mgr);</div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span> }</div><div class="line"><a name="l00495"></a><span class="lineno"> 495</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00496"></a><span class="lineno"> 496</span> </div><div class="line"><a name="l00501"></a><span class="lineno"><a class="line" href="a02186.html#a23d63e2cac00b958eb8803cab4943b4c"> 501</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a23d63e2cac00b958eb8803cab4943b4c">TessBaseAPI::InitForAnalysePage</a>() {</div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00504"></a><span class="lineno"> 504</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#acf0658a5a3cf8ebc7d29f2b9213a8884">InitAdaptiveClassifier</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span> <span class="preprocessor"> #endif</span></div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  }</div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span> }</div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span> </div><div class="line"><a name="l00515"></a><span class="lineno"><a class="line" href="a02186.html#ab3bd61f8ccb7c4e1c41801ea708d2181"> 515</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#ab3bd61f8ccb7c4e1c41801ea708d2181">TessBaseAPI::ReadConfigFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) {</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a4784885f7626438d0f5438c60fdac672">read_config_file</a>(filename, <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5a713c7bc13788ed69eb16dd9e5f309d12">SET_PARAM_CONSTRAINT_NON_INIT_ONLY</a>);</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span> }</div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span> </div><div class="line"><a name="l00520"></a><span class="lineno"><a class="line" href="a02186.html#a4f3eec49763f76c347c216eed79cae93"> 520</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a4f3eec49763f76c347c216eed79cae93">TessBaseAPI::ReadDebugConfigFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) {</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a4784885f7626438d0f5438c60fdac672">read_config_file</a>(filename, <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0">SET_PARAM_CONSTRAINT_DEBUG_ONLY</a>);</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span> }</div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span> </div><div class="line"><a name="l00529"></a><span class="lineno"><a class="line" href="a02186.html#a15a7a9c1afbba3078a55b4566de891ab"> 529</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a15a7a9c1afbba3078a55b4566de891ab">TessBaseAPI::SetPageSegMode</a>(<a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> mode) {</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a>.set_value(mode);</div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span> }</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span> </div><div class="line"><a name="l00536"></a><span class="lineno"><a class="line" href="a02186.html#a61c5592b57a1b776416e643e2719a751"> 536</a></span> <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> <a class="code" href="a02186.html#a61c5592b57a1b776416e643e2719a751">TessBaseAPI::GetPageSegMode</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  <span class="keywordflow">return</span> <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aab76fe3ca390d99e070ea60b892ee18ef">PSM_SINGLE_BLOCK</a>;</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a><span class="keyword">></span>(</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a>));</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span> }</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span> </div><div class="line"><a name="l00556"></a><span class="lineno"><a class="line" href="a02186.html#ad34c56e08d999ece9972f4c9a9301f93"> 556</a></span> <span class="keywordtype">char</span>* <a class="code" href="a02186.html#ad34c56e08d999ece9972f4c9a9301f93">TessBaseAPI::TesseractRect</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* imagedata,</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="keywordtype">int</span> bytes_per_pixel,</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  <span class="keywordtype">int</span> bytes_per_line,</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  <span class="keywordtype">int</span> left, <span class="keywordtype">int</span> top,</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height) {</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || width < <a class="code" href="a01629.html#a11307fd919d7a9313500b04cfc1a8e3d">kMinRectSize</a> || height < <a class="code" href="a01629.html#a11307fd919d7a9313500b04cfc1a8e3d">kMinRectSize</a>)</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>; <span class="comment">// Nothing worth doing.</span></div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span> </div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span>  <span class="comment">// Since this original api didn't give the exact size of the image,</span></div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span>  <span class="comment">// we have to invent a reasonable value.</span></div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  <span class="keywordtype">int</span> bits_per_pixel = bytes_per_pixel == 0 ? 1 : bytes_per_pixel * 8;</div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span>  <a class="code" href="a01625.html#gaa463622111f3b11d8fca5863709cc699">SetImage</a>(imagedata, bytes_per_line * 8 / bits_per_pixel, height + top,</div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  bytes_per_pixel, bytes_per_line);</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  <a class="code" href="a01625.html#ga284228c7e9d18bbbd3984d44e252d625">SetRectangle</a>(left, top, width, height);</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span> </div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#ga115ef656f83352ba608b4f0bf9cfa2c4">GetUTF8Text</a>();</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span> }</div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span> </div><div class="line"><a name="l00574"></a><span class="lineno"> 574</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span> </div><div class="line"><a name="l00579"></a><span class="lineno"><a class="line" href="a02186.html#ae16cc5135aba401b609e49d6790281e3"> 579</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#ae16cc5135aba401b609e49d6790281e3">TessBaseAPI::ClearAdaptiveClassifier</a>() {</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aa1c9c8ed630b708cf88c97b863c0f1f8">ResetAdaptiveClassifier</a>();</div><div class="line"><a name="l00583"></a><span class="lineno"> 583</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#acf30e84d821dad180e2e3c752bf5af28">ResetDocumentDictionary</a>();</div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span> }</div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00586"></a><span class="lineno"> 586</span> </div><div class="line"><a name="l00594"></a><span class="lineno"><a class="line" href="a01625.html#gaa463622111f3b11d8fca5863709cc699"> 594</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#gaa463622111f3b11d8fca5863709cc699">TessBaseAPI::SetImage</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* imagedata,</div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>  <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height,</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>  <span class="keywordtype">int</span> bytes_per_pixel, <span class="keywordtype">int</span> bytes_per_line) {</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a17820a43c31b66c3a12eda59e0b51bba">InternalSetImage</a>()) {</div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a6273ef2894757191288f857702fdd044">SetImage</a>(imagedata, width, height,</div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  bytes_per_pixel, bytes_per_line);</div><div class="line"><a name="l00600"></a><span class="lineno"> 600</span>  <a class="code" href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63">SetInputImage</a>(<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a0b855cc35144b84f150bf39d5342d7f1">GetPixRect</a>());</div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  }</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span> }</div><div class="line"><a name="l00603"></a><span class="lineno"> 603</span> </div><div class="line"><a name="l00604"></a><span class="lineno"><a class="line" href="a01625.html#ga4ded6137507a4e8eb6ed4bea0b9648f4"> 604</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga4ded6137507a4e8eb6ed4bea0b9648f4">TessBaseAPI::SetSourceResolution</a>(<span class="keywordtype">int</span> ppi) {</div><div class="line"><a name="l00605"></a><span class="lineno"> 605</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>)</div><div class="line"><a name="l00606"></a><span class="lineno"> 606</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#af96fa2b6f4d1271640d5c8842f4fa9d6">SetSourceYResolution</a>(ppi);</div><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Please call SetImage before SetSourceResolution.\n"</span>);</div><div class="line"><a name="l00609"></a><span class="lineno"> 609</span> }</div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span> </div><div class="line"><a name="l00619"></a><span class="lineno"><a class="line" href="a01625.html#ga0c4c7f05fd58b3665b123232a05545ad"> 619</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#gaa463622111f3b11d8fca5863709cc699">TessBaseAPI::SetImage</a>(Pix* pix) {</div><div class="line"><a name="l00620"></a><span class="lineno"> 620</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a17820a43c31b66c3a12eda59e0b51bba">InternalSetImage</a>()) {</div><div class="line"><a name="l00621"></a><span class="lineno"> 621</span>  <span class="keywordflow">if</span> (pixGetSpp(pix) == 4 && pixGetInputFormat(pix) == IFF_PNG) {</div><div class="line"><a name="l00622"></a><span class="lineno"> 622</span>  <span class="comment">// remove alpha channel from png</span></div><div class="line"><a name="l00623"></a><span class="lineno"> 623</span>  PIX* p1 = pixRemoveAlpha(pix);</div><div class="line"><a name="l00624"></a><span class="lineno"> 624</span>  pixSetSpp(p1, 3);</div><div class="line"><a name="l00625"></a><span class="lineno"> 625</span>  pix = pixCopy(<span class="keyword">nullptr</span>, p1);</div><div class="line"><a name="l00626"></a><span class="lineno"> 626</span>  pixDestroy(&p1);</div><div class="line"><a name="l00627"></a><span class="lineno"> 627</span>  }</div><div class="line"><a name="l00628"></a><span class="lineno"> 628</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a6273ef2894757191288f857702fdd044">SetImage</a>(pix);</div><div class="line"><a name="l00629"></a><span class="lineno"> 629</span>  <a class="code" href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63">SetInputImage</a>(<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a0b855cc35144b84f150bf39d5342d7f1">GetPixRect</a>());</div><div class="line"><a name="l00630"></a><span class="lineno"> 630</span>  }</div><div class="line"><a name="l00631"></a><span class="lineno"> 631</span> }</div><div class="line"><a name="l00632"></a><span class="lineno"> 632</span> </div><div class="line"><a name="l00638"></a><span class="lineno"><a class="line" href="a01625.html#ga284228c7e9d18bbbd3984d44e252d625"> 638</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga284228c7e9d18bbbd3984d44e252d625">TessBaseAPI::SetRectangle</a>(<span class="keywordtype">int</span> left, <span class="keywordtype">int</span> top, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height) {</div><div class="line"><a name="l00639"></a><span class="lineno"> 639</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00640"></a><span class="lineno"> 640</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00641"></a><span class="lineno"> 641</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#ab230142a51f5ed6347f1a9221e52d264">SetRectangle</a>(left, top, width, height);</div><div class="line"><a name="l00642"></a><span class="lineno"> 642</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l00643"></a><span class="lineno"> 643</span> }</div><div class="line"><a name="l00644"></a><span class="lineno"> 644</span> </div><div class="line"><a name="l00649"></a><span class="lineno"><a class="line" href="a01625.html#gaee19c9ea78a647420bbe99a447569995"> 649</a></span> Pix* <a class="code" href="a01625.html#gaee19c9ea78a647420bbe99a447569995">TessBaseAPI::GetThresholdedImage</a>() {</div><div class="line"><a name="l00650"></a><span class="lineno"> 650</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span>) <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00651"></a><span class="lineno"> 651</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">pix_binary</a>() == <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l00652"></a><span class="lineno"> 652</span>  !<a class="code" href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe">Threshold</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a512809e371c7bff1a24bb531721010a3">mutable_pix_binary</a>())) {</div><div class="line"><a name="l00653"></a><span class="lineno"> 653</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00654"></a><span class="lineno"> 654</span>  }</div><div class="line"><a name="l00655"></a><span class="lineno"> 655</span>  <span class="keywordflow">return</span> pixClone(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">pix_binary</a>());</div><div class="line"><a name="l00656"></a><span class="lineno"> 656</span> }</div><div class="line"><a name="l00657"></a><span class="lineno"> 657</span> </div><div class="line"><a name="l00663"></a><span class="lineno"><a class="line" href="a01625.html#gafdd23f73100c54cff18ecfa14efa0379"> 663</a></span> Boxa* <a class="code" href="a01625.html#gafdd23f73100c54cff18ecfa14efa0379">TessBaseAPI::GetRegions</a>(Pixa** pixa) {</div><div class="line"><a name="l00664"></a><span class="lineno"> 664</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, <span class="keyword">false</span>, pixa, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00665"></a><span class="lineno"> 665</span> }</div><div class="line"><a name="l00666"></a><span class="lineno"> 666</span> </div><div class="line"><a name="l00675"></a><span class="lineno"><a class="line" href="a01625.html#ga64e6691378dc07208749d288d1820403"> 675</a></span> Boxa* <a class="code" href="a01625.html#ga64e6691378dc07208749d288d1820403">TessBaseAPI::GetTextlines</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> raw_image, <span class="keyword">const</span> <span class="keywordtype">int</span> raw_padding,</div><div class="line"><a name="l00676"></a><span class="lineno"> 676</span>  Pixa** pixa, <span class="keywordtype">int</span>** blockids, <span class="keywordtype">int</span>** paraids) {</div><div class="line"><a name="l00677"></a><span class="lineno"> 677</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, <span class="keyword">true</span>, raw_image, raw_padding,</div><div class="line"><a name="l00678"></a><span class="lineno"> 678</span>  pixa, blockids, paraids);</div><div class="line"><a name="l00679"></a><span class="lineno"> 679</span> }</div><div class="line"><a name="l00680"></a><span class="lineno"> 680</span> </div><div class="line"><a name="l00689"></a><span class="lineno"><a class="line" href="a01625.html#gac7c249f9f7e11eadc557d4b3cab123a1"> 689</a></span> Boxa* <a class="code" href="a01625.html#gac7c249f9f7e11eadc557d4b3cab123a1">TessBaseAPI::GetStrips</a>(Pixa** pixa, <span class="keywordtype">int</span>** blockids) {</div><div class="line"><a name="l00690"></a><span class="lineno"> 690</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, <span class="keyword">false</span>, pixa, blockids);</div><div class="line"><a name="l00691"></a><span class="lineno"> 691</span> }</div><div class="line"><a name="l00692"></a><span class="lineno"> 692</span> </div><div class="line"><a name="l00698"></a><span class="lineno"><a class="line" href="a01625.html#ga4133bcbe38dca1173db2882ef0727703"> 698</a></span> Boxa* <a class="code" href="a01625.html#ga4133bcbe38dca1173db2882ef0727703">TessBaseAPI::GetWords</a>(Pixa** pixa) {</div><div class="line"><a name="l00699"></a><span class="lineno"> 699</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>, <span class="keyword">true</span>, pixa, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00700"></a><span class="lineno"> 700</span> }</div><div class="line"><a name="l00701"></a><span class="lineno"> 701</span> </div><div class="line"><a name="l00708"></a><span class="lineno"><a class="line" href="a01625.html#gaf2b4f88c53457fa5153dc80f5a60e152"> 708</a></span> Boxa* <a class="code" href="a01625.html#gaf2b4f88c53457fa5153dc80f5a60e152">TessBaseAPI::GetConnectedComponents</a>(Pixa** pixa) {</div><div class="line"><a name="l00709"></a><span class="lineno"> 709</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>, <span class="keyword">true</span>, pixa, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00710"></a><span class="lineno"> 710</span> }</div><div class="line"><a name="l00711"></a><span class="lineno"> 711</span> </div><div class="line"><a name="l00720"></a><span class="lineno"><a class="line" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc"> 720</a></span> Boxa* <a class="code" href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">TessBaseAPI::GetComponentImages</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7">PageIteratorLevel</a> level,</div><div class="line"><a name="l00721"></a><span class="lineno"> 721</span>  <span class="keywordtype">bool</span> text_only, <span class="keywordtype">bool</span> raw_image,</div><div class="line"><a name="l00722"></a><span class="lineno"> 722</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> raw_padding,</div><div class="line"><a name="l00723"></a><span class="lineno"> 723</span>  Pixa** pixa, <span class="keywordtype">int</span>** blockids,</div><div class="line"><a name="l00724"></a><span class="lineno"> 724</span>  <span class="keywordtype">int</span>** paraids) {</div><div class="line"><a name="l00725"></a><span class="lineno"> 725</span>  <a class="code" href="a02278.html">PageIterator</a>* page_it = <a class="code" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">GetIterator</a>();</div><div class="line"><a name="l00726"></a><span class="lineno"> 726</span>  <span class="keywordflow">if</span> (page_it == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00727"></a><span class="lineno"> 727</span>  page_it = <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">AnalyseLayout</a>();</div><div class="line"><a name="l00728"></a><span class="lineno"> 728</span>  <span class="keywordflow">if</span> (page_it == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00729"></a><span class="lineno"> 729</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>; <span class="comment">// Failed.</span></div><div class="line"><a name="l00730"></a><span class="lineno"> 730</span> </div><div class="line"><a name="l00731"></a><span class="lineno"> 731</span>  <span class="comment">// Count the components to get a size for the arrays.</span></div><div class="line"><a name="l00732"></a><span class="lineno"> 732</span>  <span class="keywordtype">int</span> component_count = 0;</div><div class="line"><a name="l00733"></a><span class="lineno"> 733</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l00734"></a><span class="lineno"> 734</span> </div><div class="line"><a name="l00735"></a><span class="lineno"> 735</span>  <a class="code" href="a02850.html">TessResultCallback<bool></a>* get_bbox = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00736"></a><span class="lineno"> 736</span>  <span class="keywordflow">if</span> (raw_image) {</div><div class="line"><a name="l00737"></a><span class="lineno"> 737</span>  <span class="comment">// Get bounding box in original raw image with padding.</span></div><div class="line"><a name="l00738"></a><span class="lineno"> 738</span>  get_bbox = <a class="code" href="a00587.html#ad000c6729bae0f97075ca10a0b5bf7d6">NewPermanentTessCallback</a>(page_it, &<a class="code" href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">PageIterator::BoundingBox</a>,</div><div class="line"><a name="l00739"></a><span class="lineno"> 739</span>  level, raw_padding,</div><div class="line"><a name="l00740"></a><span class="lineno"> 740</span>  &left, &top, &right, &bottom);</div><div class="line"><a name="l00741"></a><span class="lineno"> 741</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00742"></a><span class="lineno"> 742</span>  <span class="comment">// Get bounding box from binarized imaged. Note that this could be</span></div><div class="line"><a name="l00743"></a><span class="lineno"> 743</span>  <span class="comment">// differently scaled from the original image.</span></div><div class="line"><a name="l00744"></a><span class="lineno"> 744</span>  get_bbox = <a class="code" href="a00587.html#ad000c6729bae0f97075ca10a0b5bf7d6">NewPermanentTessCallback</a>(page_it,</div><div class="line"><a name="l00745"></a><span class="lineno"> 745</span>  &<a class="code" href="a02278.html#a2b924b32152716f12b3b75cf470f6d09">PageIterator::BoundingBoxInternal</a>,</div><div class="line"><a name="l00746"></a><span class="lineno"> 746</span>  level, &left, &top, &right, &bottom);</div><div class="line"><a name="l00747"></a><span class="lineno"> 747</span>  }</div><div class="line"><a name="l00748"></a><span class="lineno"> 748</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00749"></a><span class="lineno"> 749</span>  <span class="keywordflow">if</span> (get_bbox-><a class="code" href="a02850.html#a39d8dd30710ee089410c230aa79fd333">Run</a>() &&</div><div class="line"><a name="l00750"></a><span class="lineno"> 750</span>  (!text_only || <a class="code" href="a00380.html#a49b7c03fb4e55b82a8fd22b7c6094082">PTIsTextType</a>(page_it-><a class="code" href="a02278.html#a459b75dc035557448d27a73f74682e2a">BlockType</a>())))</div><div class="line"><a name="l00751"></a><span class="lineno"> 751</span>  ++component_count;</div><div class="line"><a name="l00752"></a><span class="lineno"> 752</span>  } <span class="keywordflow">while</span> (page_it-><a class="code" href="a02278.html#a415ea7c61e24868bc67e676184be0bb9">Next</a>(level));</div><div class="line"><a name="l00753"></a><span class="lineno"> 753</span> </div><div class="line"><a name="l00754"></a><span class="lineno"> 754</span>  Boxa* boxa = boxaCreate(component_count);</div><div class="line"><a name="l00755"></a><span class="lineno"> 755</span>  <span class="keywordflow">if</span> (pixa != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00756"></a><span class="lineno"> 756</span>  *pixa = pixaCreate(component_count);</div><div class="line"><a name="l00757"></a><span class="lineno"> 757</span>  <span class="keywordflow">if</span> (blockids != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00758"></a><span class="lineno"> 758</span>  *blockids = <span class="keyword">new</span> <span class="keywordtype">int</span>[component_count];</div><div class="line"><a name="l00759"></a><span class="lineno"> 759</span>  <span class="keywordflow">if</span> (paraids != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00760"></a><span class="lineno"> 760</span>  *paraids = <span class="keyword">new</span> <span class="keywordtype">int</span>[component_count];</div><div class="line"><a name="l00761"></a><span class="lineno"> 761</span> </div><div class="line"><a name="l00762"></a><span class="lineno"> 762</span>  <span class="keywordtype">int</span> blockid = 0;</div><div class="line"><a name="l00763"></a><span class="lineno"> 763</span>  <span class="keywordtype">int</span> paraid = 0;</div><div class="line"><a name="l00764"></a><span class="lineno"> 764</span>  <span class="keywordtype">int</span> component_index = 0;</div><div class="line"><a name="l00765"></a><span class="lineno"> 765</span>  page_it-><a class="code" href="a02278.html#a5cc369eb577150a3a677f9c342ce1240">Begin</a>();</div><div class="line"><a name="l00766"></a><span class="lineno"> 766</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00767"></a><span class="lineno"> 767</span>  <span class="keywordflow">if</span> (get_bbox-><a class="code" href="a02850.html#a39d8dd30710ee089410c230aa79fd333">Run</a>() &&</div><div class="line"><a name="l00768"></a><span class="lineno"> 768</span>  (!text_only || <a class="code" href="a00380.html#a49b7c03fb4e55b82a8fd22b7c6094082">PTIsTextType</a>(page_it-><a class="code" href="a02278.html#a459b75dc035557448d27a73f74682e2a">BlockType</a>()))) {</div><div class="line"><a name="l00769"></a><span class="lineno"> 769</span>  Box* lbox = boxCreate(left, top, right - left, bottom - top);</div><div class="line"><a name="l00770"></a><span class="lineno"> 770</span>  boxaAddBox(boxa, lbox, L_INSERT);</div><div class="line"><a name="l00771"></a><span class="lineno"> 771</span>  <span class="keywordflow">if</span> (pixa != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00772"></a><span class="lineno"> 772</span>  Pix* pix = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00773"></a><span class="lineno"> 773</span>  <span class="keywordflow">if</span> (raw_image) {</div><div class="line"><a name="l00774"></a><span class="lineno"> 774</span>  pix = page_it-><a class="code" href="a02278.html#a60494e90122337da8440e48ad4fa23fc">GetImage</a>(level, raw_padding, <a class="code" href="a02186.html#ab0cb619ceec1ca8872621399f8238d58">GetInputImage</a>(), &left,</div><div class="line"><a name="l00775"></a><span class="lineno"> 775</span>  &top);</div><div class="line"><a name="l00776"></a><span class="lineno"> 776</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00777"></a><span class="lineno"> 777</span>  pix = page_it-><a class="code" href="a02278.html#aa1840ecf7f491f0ae1132f5b47efa802">GetBinaryImage</a>(level);</div><div class="line"><a name="l00778"></a><span class="lineno"> 778</span>  }</div><div class="line"><a name="l00779"></a><span class="lineno"> 779</span>  pixaAddPix(*pixa, pix, L_INSERT);</div><div class="line"><a name="l00780"></a><span class="lineno"> 780</span>  pixaAddBox(*pixa, lbox, L_CLONE);</div><div class="line"><a name="l00781"></a><span class="lineno"> 781</span>  }</div><div class="line"><a name="l00782"></a><span class="lineno"> 782</span>  <span class="keywordflow">if</span> (paraids != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00783"></a><span class="lineno"> 783</span>  (*paraids)[component_index] = paraid;</div><div class="line"><a name="l00784"></a><span class="lineno"> 784</span>  <span class="keywordflow">if</span> (page_it-><a class="code" href="a02278.html#ab002592f10a06b03978f556154c6cfda">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>, level))</div><div class="line"><a name="l00785"></a><span class="lineno"> 785</span>  ++paraid;</div><div class="line"><a name="l00786"></a><span class="lineno"> 786</span>  }</div><div class="line"><a name="l00787"></a><span class="lineno"> 787</span>  <span class="keywordflow">if</span> (blockids != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00788"></a><span class="lineno"> 788</span>  (*blockids)[component_index] = blockid;</div><div class="line"><a name="l00789"></a><span class="lineno"> 789</span>  <span class="keywordflow">if</span> (page_it-><a class="code" href="a02278.html#ab002592f10a06b03978f556154c6cfda">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, level)) {</div><div class="line"><a name="l00790"></a><span class="lineno"> 790</span>  ++blockid;</div><div class="line"><a name="l00791"></a><span class="lineno"> 791</span>  paraid = 0;</div><div class="line"><a name="l00792"></a><span class="lineno"> 792</span>  }</div><div class="line"><a name="l00793"></a><span class="lineno"> 793</span>  }</div><div class="line"><a name="l00794"></a><span class="lineno"> 794</span>  ++component_index;</div><div class="line"><a name="l00795"></a><span class="lineno"> 795</span>  }</div><div class="line"><a name="l00796"></a><span class="lineno"> 796</span>  } <span class="keywordflow">while</span> (page_it-><a class="code" href="a02278.html#a415ea7c61e24868bc67e676184be0bb9">Next</a>(level));</div><div class="line"><a name="l00797"></a><span class="lineno"> 797</span>  <span class="keyword">delete</span> page_it;</div><div class="line"><a name="l00798"></a><span class="lineno"> 798</span>  <span class="keyword">delete</span> get_bbox;</div><div class="line"><a name="l00799"></a><span class="lineno"> 799</span>  <span class="keywordflow">return</span> boxa;</div><div class="line"><a name="l00800"></a><span class="lineno"> 800</span> }</div><div class="line"><a name="l00801"></a><span class="lineno"> 801</span> </div><div class="line"><a name="l00802"></a><span class="lineno"><a class="line" href="a01625.html#ga5c207843b7fa3a5a3b328035af9836f0"> 802</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#ga5c207843b7fa3a5a3b328035af9836f0">TessBaseAPI::GetThresholdedImageScaleFactor</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00803"></a><span class="lineno"> 803</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00804"></a><span class="lineno"> 804</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00805"></a><span class="lineno"> 805</span>  }</div><div class="line"><a name="l00806"></a><span class="lineno"> 806</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>();</div><div class="line"><a name="l00807"></a><span class="lineno"> 807</span> }</div><div class="line"><a name="l00808"></a><span class="lineno"> 808</span> </div><div class="line"><a name="l00824"></a><span class="lineno"><a class="line" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666"> 824</a></span> <a class="code" href="a02278.html">PageIterator</a>* <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">TessBaseAPI::AnalyseLayout</a>() { <span class="keywordflow">return</span> <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">AnalyseLayout</a>(<span class="keyword">false</span>); }</div><div class="line"><a name="l00825"></a><span class="lineno"> 825</span> </div><div class="line"><a name="l00826"></a><span class="lineno"><a class="line" href="a01625.html#ga5829db81305e19fbe941945f9d38e6a8"> 826</a></span> <a class="code" href="a02278.html">PageIterator</a>* <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">TessBaseAPI::AnalyseLayout</a>(<span class="keywordtype">bool</span> merge_similar_words) {</div><div class="line"><a name="l00827"></a><span class="lineno"> 827</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">FindLines</a>() == 0) {</div><div class="line"><a name="l00828"></a><span class="lineno"> 828</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>->empty())</div><div class="line"><a name="l00829"></a><span class="lineno"> 829</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>; <span class="comment">// The page was empty.</span></div><div class="line"><a name="l00830"></a><span class="lineno"> 830</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(merge_similar_words, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00831"></a><span class="lineno"> 831</span>  <a class="code" href="a02186.html#a33cf8d85c3714857bc8753fef035ea95">DetectParagraphs</a>(<span class="keyword">false</span>);</div><div class="line"><a name="l00832"></a><span class="lineno"> 832</span>  <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="a02278.html">PageIterator</a>(</div><div class="line"><a name="l00833"></a><span class="lineno"> 833</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>, <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>(),</div><div class="line"><a name="l00834"></a><span class="lineno"> 834</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>(),</div><div class="line"><a name="l00835"></a><span class="lineno"> 835</span>  <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l00836"></a><span class="lineno"> 836</span>  }</div><div class="line"><a name="l00837"></a><span class="lineno"> 837</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00838"></a><span class="lineno"> 838</span> }</div><div class="line"><a name="l00839"></a><span class="lineno"> 839</span> </div><div class="line"><a name="l00844"></a><span class="lineno"><a class="line" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0"> 844</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">TessBaseAPI::Recognize</a>(<a class="code" href="a02786.html">ETEXT_DESC</a>* monitor) {</div><div class="line"><a name="l00845"></a><span class="lineno"> 845</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00846"></a><span class="lineno"> 846</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00847"></a><span class="lineno"> 847</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">FindLines</a>() != 0)</div><div class="line"><a name="l00848"></a><span class="lineno"> 848</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00849"></a><span class="lineno"> 849</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>;</div><div class="line"><a name="l00850"></a><span class="lineno"> 850</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>->empty()) {</div><div class="line"><a name="l00851"></a><span class="lineno"> 851</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(<span class="keyword">false</span>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>,</div><div class="line"><a name="l00852"></a><span class="lineno"> 852</span>  &<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a>);</div><div class="line"><a name="l00853"></a><span class="lineno"> 853</span>  <span class="keywordflow">return</span> 0; <span class="comment">// Empty page.</span></div><div class="line"><a name="l00854"></a><span class="lineno"> 854</span>  }</div><div class="line"><a name="l00855"></a><span class="lineno"> 855</span> </div><div class="line"><a name="l00856"></a><span class="lineno"> 856</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a35e62e060c86649e14cdf688d09a0f7a">SetBlackAndWhitelist</a>();</div><div class="line"><a name="l00857"></a><span class="lineno"> 857</span>  <a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00858"></a><span class="lineno"> 858</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00859"></a><span class="lineno"> 859</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a7fc8d9323b89b20e8d153eef861266b8">tessedit_resegment_from_line_boxes</a>) {</div><div class="line"><a name="l00860"></a><span class="lineno"> 860</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a211f8d8d25bf615c44e117a93c40017c">ApplyBoxes</a>(*<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, <span class="keyword">true</span>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>);</div><div class="line"><a name="l00861"></a><span class="lineno"> 861</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a62f5e64459a2d2a15526c3229c12e6a0">tessedit_resegment_from_boxes</a>) {</div><div class="line"><a name="l00862"></a><span class="lineno"> 862</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a211f8d8d25bf615c44e117a93c40017c">ApplyBoxes</a>(*<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, <span class="keyword">false</span>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>);</div><div class="line"><a name="l00863"></a><span class="lineno"> 863</span>  } <span class="keywordflow">else</span></div><div class="line"><a name="l00864"></a><span class="lineno"> 864</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00865"></a><span class="lineno"> 865</span>  {</div><div class="line"><a name="l00866"></a><span class="lineno"> 866</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae0b47fae13d07d3af456c0ec4f990d65">AnyLSTMLang</a>(),</div><div class="line"><a name="l00867"></a><span class="lineno"> 867</span>  <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>, &<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a>);</div><div class="line"><a name="l00868"></a><span class="lineno"> 868</span>  }</div><div class="line"><a name="l00869"></a><span class="lineno"> 869</span> </div><div class="line"><a name="l00870"></a><span class="lineno"> 870</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00871"></a><span class="lineno"> 871</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00872"></a><span class="lineno"> 872</span>  }</div><div class="line"><a name="l00873"></a><span class="lineno"> 873</span> </div><div class="line"><a name="l00874"></a><span class="lineno"> 874</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a6d07030a800baa51ecde2b96e4fef648">tessedit_train_line_recognizer</a>) {</div><div class="line"><a name="l00875"></a><span class="lineno"> 875</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a9bb4a5c03d59d657db0506ea4f5d5cae">TrainLineRecognizer</a>(*<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, *<a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>);</div><div class="line"><a name="l00876"></a><span class="lineno"> 876</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aaac7729b5dc17651a6b3ee44689302d5">CorrectClassifyWords</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l00877"></a><span class="lineno"> 877</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00878"></a><span class="lineno"> 878</span>  }</div><div class="line"><a name="l00879"></a><span class="lineno"> 879</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00880"></a><span class="lineno"> 880</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab079fbbd71433f3de894f912e5b11e6d">tessedit_make_boxes_from_boxes</a>) {</div><div class="line"><a name="l00881"></a><span class="lineno"> 881</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aaac7729b5dc17651a6b3ee44689302d5">CorrectClassifyWords</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l00882"></a><span class="lineno"> 882</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00883"></a><span class="lineno"> 883</span>  }</div><div class="line"><a name="l00884"></a><span class="lineno"> 884</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00885"></a><span class="lineno"> 885</span> </div><div class="line"><a name="l00886"></a><span class="lineno"> 886</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ac7eaed7f3fedb15212eb39b747de0102">truth_cb_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00887"></a><span class="lineno"> 887</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a5f360cd76704a08b03a4738a97e8457b">wordrec_run_blamer</a>.set_value(<span class="keyword">true</span>);</div><div class="line"><a name="l00888"></a><span class="lineno"> 888</span>  <a class="code" href="a02278.html">PageIterator</a> *page_it = <span class="keyword">new</span> <a class="code" href="a02278.html">PageIterator</a>(</div><div class="line"><a name="l00889"></a><span class="lineno"> 889</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>, <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>(),</div><div class="line"><a name="l00890"></a><span class="lineno"> 890</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>(),</div><div class="line"><a name="l00891"></a><span class="lineno"> 891</span>  <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l00892"></a><span class="lineno"> 892</span>  <a class="code" href="a02186.html#ac7eaed7f3fedb15212eb39b747de0102">truth_cb_</a>-><a class="code" href="a03050.html#a36fb0a456ac52e8d8bdbc8f2488333ad">Run</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a3ed04d9d9419ce413e9e495b5c5001ad">getUnicharset</a>(),</div><div class="line"><a name="l00893"></a><span class="lineno"> 893</span>  <a class="code" href="a01627.html#gab7d24a78f3565c5bfb42b2592b9e8df0">image_height_</a>, page_it, this-><a class="code" href="a01625.html#gac16fdadc30b12935b793be4a42ad8448">tesseract</a>()-><a class="code" href="a02358.html#a03e51d9200586d7164574b8ae9498d69">pix_grey</a>());</div><div class="line"><a name="l00894"></a><span class="lineno"> 894</span>  <span class="keyword">delete</span> page_it;</div><div class="line"><a name="l00895"></a><span class="lineno"> 895</span>  }</div><div class="line"><a name="l00896"></a><span class="lineno"> 896</span> </div><div class="line"><a name="l00897"></a><span class="lineno"> 897</span>  <span class="keywordtype">int</span> result = 0;</div><div class="line"><a name="l00898"></a><span class="lineno"> 898</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a51f1cb37c2fff5e2ade385b160c3a0e3">interactive_display_mode</a>) {</div><div class="line"><a name="l00899"></a><span class="lineno"> 899</span> <span class="preprocessor"> #ifndef GRAPHICS_DISABLED</span></div><div class="line"><a name="l00900"></a><span class="lineno"> 900</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab48cff8de587e3a573a327846e57c51d">pgeditor_main</a>(<a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>, <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l00901"></a><span class="lineno"> 901</span> <span class="preprocessor"> #endif // GRAPHICS_DISABLED</span></div><div class="line"><a name="l00902"></a><span class="lineno"> 902</span>  <span class="comment">// The page_res is invalid after an interactive session, so cleanup</span></div><div class="line"><a name="l00903"></a><span class="lineno"> 903</span>  <span class="comment">// in a way that lets us continue to the next page without crashing.</span></div><div class="line"><a name="l00904"></a><span class="lineno"> 904</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>;</div><div class="line"><a name="l00905"></a><span class="lineno"> 905</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00906"></a><span class="lineno"> 906</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00907"></a><span class="lineno"> 907</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00908"></a><span class="lineno"> 908</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a95bb008c7903633f1f3cd50540c05742">tessedit_train_from_boxes</a>) {</div><div class="line"><a name="l00909"></a><span class="lineno"> 909</span>  <a class="code" href="a02834.html">STRING</a> fontname;</div><div class="line"><a name="l00910"></a><span class="lineno"> 910</span>  <a class="code" href="a01629.html#aa011b40b5e90b4087d0e42ea5fcce12c">ExtractFontName</a>(*<a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>, &fontname);</div><div class="line"><a name="l00911"></a><span class="lineno"> 911</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a689717c48a88c667883d31a5b03139bc">ApplyBoxTraining</a>(fontname, <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l00912"></a><span class="lineno"> 912</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aeed33f786b5c71bf0b47452c76bf0c8a">tessedit_ambigs_training</a>) {</div><div class="line"><a name="l00913"></a><span class="lineno"> 913</span>  FILE *training_output_file = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a4b787b26c3c009f5b2dbfdd9ef5f55d7">init_recog_training</a>(*<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>);</div><div class="line"><a name="l00914"></a><span class="lineno"> 914</span>  <span class="comment">// OCR the page segmented into words by tesseract.</span></div><div class="line"><a name="l00915"></a><span class="lineno"> 915</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a02591ce36a6ff477040bf844b4d1d364">recog_training_segmented</a>(</div><div class="line"><a name="l00916"></a><span class="lineno"> 916</span>  *<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, monitor, training_output_file);</div><div class="line"><a name="l00917"></a><span class="lineno"> 917</span>  fclose(training_output_file);</div><div class="line"><a name="l00918"></a><span class="lineno"> 918</span> <span class="preprocessor"> #endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00919"></a><span class="lineno"> 919</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00920"></a><span class="lineno"> 920</span>  <span class="comment">// Now run the main recognition.</span></div><div class="line"><a name="l00921"></a><span class="lineno"> 921</span>  <span class="keywordtype">bool</span> wait_for_text = <span class="keyword">true</span>;</div><div class="line"><a name="l00922"></a><span class="lineno"> 922</span>  <a class="code" href="a02186.html#adc8316d75713a2abf5373f85f6f58a93">GetBoolVariable</a>(<span class="stringliteral">"paragraph_text_based"</span>, &wait_for_text);</div><div class="line"><a name="l00923"></a><span class="lineno"> 923</span>  <span class="keywordflow">if</span> (!wait_for_text) <a class="code" href="a02186.html#a33cf8d85c3714857bc8753fef035ea95">DetectParagraphs</a>(<span class="keyword">false</span>);</div><div class="line"><a name="l00924"></a><span class="lineno"> 924</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed">recog_all_words</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, monitor, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, 0)) {</div><div class="line"><a name="l00925"></a><span class="lineno"> 925</span>  <span class="keywordflow">if</span> (wait_for_text) <a class="code" href="a02186.html#a33cf8d85c3714857bc8753fef035ea95">DetectParagraphs</a>(<span class="keyword">true</span>);</div><div class="line"><a name="l00926"></a><span class="lineno"> 926</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00927"></a><span class="lineno"> 927</span>  result = -1;</div><div class="line"><a name="l00928"></a><span class="lineno"> 928</span>  }</div><div class="line"><a name="l00929"></a><span class="lineno"> 929</span>  }</div><div class="line"><a name="l00930"></a><span class="lineno"> 930</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00931"></a><span class="lineno"> 931</span> }</div><div class="line"><a name="l00932"></a><span class="lineno"> 932</span> </div><div class="line"><a name="l00933"></a><span class="lineno"> 933</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00934"></a><span class="lineno"> 934</span> </div><div class="line"><a name="l00935"></a><span class="lineno"><a class="line" href="a01625.html#gaec56194587e149ae38a08eccd2e0d96a"> 935</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#gaec56194587e149ae38a08eccd2e0d96a">TessBaseAPI::RecognizeForChopTest</a>(<a class="code" href="a02786.html">ETEXT_DESC</a>* monitor) {</div><div class="line"><a name="l00936"></a><span class="lineno"> 936</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00937"></a><span class="lineno"> 937</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00938"></a><span class="lineno"> 938</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a5e18e1384335b76f63ba3508ae048925">IsEmpty</a>()) {</div><div class="line"><a name="l00939"></a><span class="lineno"> 939</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Please call SetImage before attempting recognition.\n"</span>);</div><div class="line"><a name="l00940"></a><span class="lineno"> 940</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00941"></a><span class="lineno"> 941</span>  }</div><div class="line"><a name="l00942"></a><span class="lineno"> 942</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00943"></a><span class="lineno"> 943</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l00944"></a><span class="lineno"> 944</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">FindLines</a>() != 0)</div><div class="line"><a name="l00945"></a><span class="lineno"> 945</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00946"></a><span class="lineno"> 946</span>  <span class="comment">// Additional conditions under which chopper test cannot be run</span></div><div class="line"><a name="l00947"></a><span class="lineno"> 947</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a51f1cb37c2fff5e2ade385b160c3a0e3">interactive_display_mode</a>) <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00948"></a><span class="lineno"> 948</span> </div><div class="line"><a name="l00949"></a><span class="lineno"> 949</span>  <a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00950"></a><span class="lineno"> 950</span> </div><div class="line"><a name="l00951"></a><span class="lineno"> 951</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(<span class="keyword">false</span>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>,</div><div class="line"><a name="l00952"></a><span class="lineno"> 952</span>  &(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a>));</div><div class="line"><a name="l00953"></a><span class="lineno"> 953</span> </div><div class="line"><a name="l00954"></a><span class="lineno"> 954</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l00955"></a><span class="lineno"> 955</span> </div><div class="line"><a name="l00956"></a><span class="lineno"> 956</span>  <span class="keywordflow">while</span> (page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00957"></a><span class="lineno"> 957</span>  <a class="code" href="a02542.html">WERD_RES</a> *word_res = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l00958"></a><span class="lineno"> 958</span>  <a class="code" href="a02182.html">GenericVector<TBOX></a> boxes;</div><div class="line"><a name="l00959"></a><span class="lineno"> 959</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aab153649250a4b8bd6ffb4e22f44f79f">MaximallyChopWord</a>(boxes, page_res_it.<a class="code" href="a02546.html#a997c382ddd2cf2f539532a1d91780963">block</a>()-><a class="code" href="a02534.html#ae7c240d4878247ebdfe78433446751bf">block</a>,</div><div class="line"><a name="l00960"></a><span class="lineno"> 960</span>  page_res_it.<a class="code" href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">row</a>()-><a class="code" href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">row</a>, word_res);</div><div class="line"><a name="l00961"></a><span class="lineno"> 961</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00962"></a><span class="lineno"> 962</span>  }</div><div class="line"><a name="l00963"></a><span class="lineno"> 963</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00964"></a><span class="lineno"> 964</span> }</div><div class="line"><a name="l00965"></a><span class="lineno"> 965</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00966"></a><span class="lineno"> 966</span> </div><div class="line"><a name="l00967"></a><span class="lineno"> 967</span> <span class="comment">// Takes ownership of the input pix.</span></div><div class="line"><a name="l00968"></a><span class="lineno"><a class="line" href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63"> 968</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63">TessBaseAPI::SetInputImage</a>(Pix* pix) { <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ad939110e64fbd875014afa70ee72f43b">set_pix_original</a>(pix); }</div><div class="line"><a name="l00969"></a><span class="lineno"> 969</span> </div><div class="line"><a name="l00970"></a><span class="lineno"><a class="line" href="a02186.html#ab0cb619ceec1ca8872621399f8238d58"> 970</a></span> Pix* <a class="code" href="a02186.html#ab0cb619ceec1ca8872621399f8238d58">TessBaseAPI::GetInputImage</a>() { <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a87360c517f48316e9817bdc8ede63d0e">pix_original</a>(); }</div><div class="line"><a name="l00971"></a><span class="lineno"> 971</span> </div><div class="line"><a name="l00972"></a><span class="lineno"><a class="line" href="a02186.html#a0a1d63bf472c0c2fd3d2b82f5aba6ebb"> 972</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="a02186.html#a0a1d63bf472c0c2fd3d2b82f5aba6ebb">TessBaseAPI::GetInputName</a>() {</div><div class="line"><a name="l00973"></a><span class="lineno"> 973</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>)</div><div class="line"><a name="l00974"></a><span class="lineno"> 974</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>-><a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>();</div><div class="line"><a name="l00975"></a><span class="lineno"> 975</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00976"></a><span class="lineno"> 976</span> }</div><div class="line"><a name="l00977"></a><span class="lineno"> 977</span> </div><div class="line"><a name="l00978"></a><span class="lineno"><a class="line" href="a02186.html#a212b46c962fc197a316e366de937ba96"> 978</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="a02186.html#a212b46c962fc197a316e366de937ba96">TessBaseAPI::GetDatapath</a>() {</div><div class="line"><a name="l00979"></a><span class="lineno"> 979</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a4932d2070d3b91264958078abc991b17">datadir</a>.<a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>();</div><div class="line"><a name="l00980"></a><span class="lineno"> 980</span> }</div><div class="line"><a name="l00981"></a><span class="lineno"> 981</span> </div><div class="line"><a name="l00982"></a><span class="lineno"><a class="line" href="a02186.html#a4adb0aa43b90fad6c7c0d36b4d88ee29"> 982</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#a4adb0aa43b90fad6c7c0d36b4d88ee29">TessBaseAPI::GetSourceYResolution</a>() {</div><div class="line"><a name="l00983"></a><span class="lineno"> 983</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a39bd6e786e42ec230090189c9deb3657">GetSourceYResolution</a>();</div><div class="line"><a name="l00984"></a><span class="lineno"> 984</span> }</div><div class="line"><a name="l00985"></a><span class="lineno"> 985</span> </div><div class="line"><a name="l00986"></a><span class="lineno"> 986</span> <span class="comment">// If flist exists, get data from there. Otherwise get data from buf.</span></div><div class="line"><a name="l00987"></a><span class="lineno"> 987</span> <span class="comment">// Seems convoluted, but is the easiest way I know of to meet multiple</span></div><div class="line"><a name="l00988"></a><span class="lineno"> 988</span> <span class="comment">// goals. Support streaming from stdin, and also work on platforms</span></div><div class="line"><a name="l00989"></a><span class="lineno"> 989</span> <span class="comment">// lacking fmemopen.</span></div><div class="line"><a name="l00990"></a><span class="lineno"> 990</span> <span class="keywordtype">bool</span> TessBaseAPI::ProcessPagesFileList(FILE *flist,</div><div class="line"><a name="l00991"></a><span class="lineno"> 991</span>  <a class="code" href="a02834.html">STRING</a> *buf,</div><div class="line"><a name="l00992"></a><span class="lineno"> 992</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* retry_config,</div><div class="line"><a name="l00993"></a><span class="lineno"> 993</span>  <span class="keywordtype">int</span> timeout_millisec,</div><div class="line"><a name="l00994"></a><span class="lineno"> 994</span>  <a class="code" href="a02190.html">TessResultRenderer</a>* renderer,</div><div class="line"><a name="l00995"></a><span class="lineno"> 995</span>  <span class="keywordtype">int</span> tessedit_page_number) {</div><div class="line"><a name="l00996"></a><span class="lineno"> 996</span>  <span class="keywordflow">if</span> (!flist && !buf) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00997"></a><span class="lineno"> 997</span>  <span class="keywordtype">int</span> page = (tessedit_page_number >= 0) ? tessedit_page_number : 0;</div><div class="line"><a name="l00998"></a><span class="lineno"> 998</span>  <span class="keywordtype">char</span> pagename[<a class="code" href="a00560.html#ab99ded389af74001a6298fc9e44e74e5">MAX_PATH</a>];</div><div class="line"><a name="l00999"></a><span class="lineno"> 999</span> </div><div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>  <a class="code" href="a02182.html">GenericVector<STRING></a> lines;</div><div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>  <span class="keywordflow">if</span> (!flist) {</div><div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>  buf-><a class="code" href="a02834.html#a70cb880f818d4af4a4f4036032c3e9dc">split</a>(<span class="charliteral">'\n'</span>, &lines);</div><div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>  <span class="keywordflow">if</span> (lines.<a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>  }</div><div class="line"><a name="l01005"></a><span class="lineno"> 1005</span> </div><div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>  <span class="comment">// Skip to the requested page number.</span></div><div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < page; i++) {</div><div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>  <span class="keywordflow">if</span> (flist) {</div><div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>  <span class="keywordflow">if</span> (fgets(pagename, <span class="keyword">sizeof</span>(pagename), flist) == <span class="keyword">nullptr</span>) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>  }</div><div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>  }</div><div class="line"><a name="l01012"></a><span class="lineno"> 1012</span> </div><div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>  <span class="comment">// Begin producing output</span></div><div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>  <span class="keywordflow">if</span> (renderer && !renderer-><a class="code" href="a02190.html#a8f910e5251ee7ebd65f69072b358b445">BeginDocument</a>(unknown_title_)) {</div><div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>  }</div><div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> </div><div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>  <span class="comment">// Loop over all pages - or just the requested one</span></div><div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>  <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div><div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>  <span class="keywordflow">if</span> (flist) {</div><div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>  <span class="keywordflow">if</span> (fgets(pagename, <span class="keyword">sizeof</span>(pagename), flist) == <span class="keyword">nullptr</span>) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>  <span class="keywordflow">if</span> (page >= lines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>()) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>  snprintf(pagename, <span class="keyword">sizeof</span>(pagename), <span class="stringliteral">"%s"</span>, lines[page].c_str());</div><div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>  }</div><div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>  <a class="code" href="a00527.html#a31bec0ef73dd383e256fa462e9fa7e1f">chomp_string</a>(pagename);</div><div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>  Pix *pix = pixRead(pagename);</div><div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>  <span class="keywordflow">if</span> (pix == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Image file %s cannot be read!\n"</span>, pagename);</div><div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>  }</div><div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Page %d : %s\n"</span>, page, pagename);</div><div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>  <span class="keywordtype">bool</span> r = <a class="code" href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724">ProcessPage</a>(pix, page, pagename, retry_config,</div><div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>  timeout_millisec, renderer);</div><div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>  pixDestroy(&pix);</div><div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>  <span class="keywordflow">if</span> (!r) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>  <span class="keywordflow">if</span> (tessedit_page_number >= 0) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>  ++page;</div><div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>  }</div><div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> </div><div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>  <span class="comment">// Finish producing output</span></div><div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>  <span class="keywordflow">if</span> (renderer && !renderer-><a class="code" href="a02190.html#a64def5e1f46676190e5af46f23adab88">EndDocument</a>()) {</div><div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>  }</div><div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01046"></a><span class="lineno"> 1046</span> }</div><div class="line"><a name="l01047"></a><span class="lineno"> 1047</span> </div><div class="line"><a name="l01048"></a><span class="lineno"> 1048</span> <span class="keywordtype">bool</span> TessBaseAPI::ProcessPagesMultipageTiff(<span class="keyword">const</span> l_uint8 *data,</div><div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>  <span class="keywordtype">size_t</span> size,</div><div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* filename,</div><div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* retry_config,</div><div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>  <span class="keywordtype">int</span> timeout_millisec,</div><div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>  <a class="code" href="a00014.html#a79b401fe19433464a13b416108deb755">TessResultRenderer</a>* renderer,</div><div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>  <span class="keywordtype">int</span> tessedit_page_number) {</div><div class="line"><a name="l01055"></a><span class="lineno"> 1055</span> <span class="preprocessor">#ifndef ANDROID_BUILD</span></div><div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>  Pix *pix = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>  <span class="keywordtype">int</span> page = (tessedit_page_number >= 0) ? tessedit_page_number : 0;</div><div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>  <span class="keywordtype">size_t</span> offset = 0;</div><div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>  <span class="keywordflow">for</span> (; ; ++page) {</div><div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>  <span class="keywordflow">if</span> (tessedit_page_number >= 0)</div><div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>  page = tessedit_page_number;</div><div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>  pix = (data) ? pixReadMemFromMultipageTiff(data, size, &offset)</div><div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>  : pixReadFromMultipageTiff(filename, &offset);</div><div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>  <span class="keywordflow">if</span> (pix == <span class="keyword">nullptr</span>) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Page %d\n"</span>, page + 1);</div><div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>  <span class="keywordtype">char</span> page_str[<a class="code" href="a01629.html#a3e35711780f8c0254a2dd64071ef2b6b">kMaxIntSize</a>];</div><div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>  snprintf(page_str, <a class="code" href="a01629.html#a3e35711780f8c0254a2dd64071ef2b6b">kMaxIntSize</a> - 1, <span class="stringliteral">"%d"</span>, page);</div><div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>  <a class="code" href="a02186.html#a2e09259c558c6d8e0f7e523cbaf5adf5">SetVariable</a>(<span class="stringliteral">"applybox_page"</span>, page_str);</div><div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>  <span class="keywordtype">bool</span> r = <a class="code" href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724">ProcessPage</a>(pix, page, filename, retry_config,</div><div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>  timeout_millisec, renderer);</div><div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>  pixDestroy(&pix);</div><div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>  <span class="keywordflow">if</span> (!r) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>  <span class="keywordflow">if</span> (tessedit_page_number >= 0) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>  <span class="keywordflow">if</span> (!offset) <span class="keywordflow">break</span>;</div><div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>  }</div><div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01077"></a><span class="lineno"> 1077</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01079"></a><span class="lineno"> 1079</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l01080"></a><span class="lineno"> 1080</span> }</div><div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> </div><div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> <span class="comment">// Master ProcessPages calls ProcessPagesInternal and then does any post-</span></div><div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> <span class="comment">// processing required due to being in a training mode.</span></div><div class="line"><a name="l01084"></a><span class="lineno"><a class="line" href="a01625.html#ga551aa98cd0a9957195f83729a599a89f"> 1084</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga551aa98cd0a9957195f83729a599a89f">TessBaseAPI::ProcessPages</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <span class="keyword">const</span> <span class="keywordtype">char</span>* retry_config,</div><div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>  <span class="keywordtype">int</span> timeout_millisec,</div><div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>  <a class="code" href="a02190.html">TessResultRenderer</a>* renderer) {</div><div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>  <span class="keywordtype">bool</span> result =</div><div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>  <a class="code" href="a01625.html#ga091018e103238979eac0912d3f5ff126">ProcessPagesInternal</a>(filename, retry_config, timeout_millisec, renderer);</div><div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>  <span class="keywordflow">if</span> (result) {</div><div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a95bb008c7903633f1f3cd50540c05742">tessedit_train_from_boxes</a> &&</div><div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>  !<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a8373b3d764ce82b5be835abea34ebd32">WriteTRFile</a>(*<a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>)) {</div><div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Write of TR file failed: %s\n"</span>, <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>  }</div><div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>  }</div><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> <span class="preprocessor"> #endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> }</div><div class="line"><a name="l01100"></a><span class="lineno"> 1100</span> </div><div class="line"><a name="l01101"></a><span class="lineno"> 1101</span> <span class="comment">// In the ideal scenario, Tesseract will start working on data as soon</span></div><div class="line"><a name="l01102"></a><span class="lineno"> 1102</span> <span class="comment">// as it can. For example, if you stream a filelist through stdin, we</span></div><div class="line"><a name="l01103"></a><span class="lineno"> 1103</span> <span class="comment">// should start the OCR process as soon as the first filename is</span></div><div class="line"><a name="l01104"></a><span class="lineno"> 1104</span> <span class="comment">// available. This is particularly useful when hooking Tesseract up to</span></div><div class="line"><a name="l01105"></a><span class="lineno"> 1105</span> <span class="comment">// slow hardware such as a book scanning machine.</span></div><div class="line"><a name="l01106"></a><span class="lineno"> 1106</span> <span class="comment">//</span></div><div class="line"><a name="l01107"></a><span class="lineno"> 1107</span> <span class="comment">// Unfortunately there are tradeoffs. You can't seek on stdin. That</span></div><div class="line"><a name="l01108"></a><span class="lineno"> 1108</span> <span class="comment">// makes automatic detection of datatype (TIFF? filelist? PNG?)</span></div><div class="line"><a name="l01109"></a><span class="lineno"> 1109</span> <span class="comment">// impractical. So we support a command line flag to explicitly</span></div><div class="line"><a name="l01110"></a><span class="lineno"> 1110</span> <span class="comment">// identify the scenario that really matters: filelists on</span></div><div class="line"><a name="l01111"></a><span class="lineno"> 1111</span> <span class="comment">// stdin. We'll still do our best if the user likes pipes.</span></div><div class="line"><a name="l01112"></a><span class="lineno"><a class="line" href="a01625.html#ga091018e103238979eac0912d3f5ff126"> 1112</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga091018e103238979eac0912d3f5ff126">TessBaseAPI::ProcessPagesInternal</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename,</div><div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* retry_config,</div><div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>  <span class="keywordtype">int</span> timeout_millisec,</div><div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>  <a class="code" href="a02190.html">TessResultRenderer</a>* renderer) {</div><div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>  <a class="code" href="a01073.html#a7b1e67112c5c3cc13ba8f90c8b60f05e">PERF_COUNT_START</a>(<span class="stringliteral">"ProcessPages"</span>)</div><div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>  <span class="keywordtype">bool</span> stdInput = !strcmp(filename, <span class="stringliteral">"stdin"</span>) || !strcmp(filename, <span class="stringliteral">"-"</span>);</div><div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>  <span class="keywordflow">if</span> (stdInput) {</div><div class="line"><a name="l01119"></a><span class="lineno"> 1119</span> <span class="preprocessor">#ifdef WIN32</span></div><div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>  <span class="keywordflow">if</span> (_setmode(_fileno(stdin), _O_BINARY) == -1)</div><div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"ERROR: cin to binary: %s"</span>, strerror(errno));</div><div class="line"><a name="l01122"></a><span class="lineno"> 1122</span> <span class="preprocessor">#endif // WIN32</span></div><div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>  }</div><div class="line"><a name="l01124"></a><span class="lineno"> 1124</span> </div><div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>  <span class="keywordflow">if</span> (<a class="code" href="a00005.html#ad341e2a0385debc2342a18dfa9e5b3ec">stream_filelist</a>) {</div><div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>  <span class="keywordflow">return</span> ProcessPagesFileList(stdin, <span class="keyword">nullptr</span>, retry_config,</div><div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>  timeout_millisec, renderer,</div><div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a9ea498e7c3d83469257493f8900c3922">tessedit_page_number</a>);</div><div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>  }</div><div class="line"><a name="l01130"></a><span class="lineno"> 1130</span> </div><div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>  <span class="comment">// At this point we are officially in autodection territory.</span></div><div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>  <span class="comment">// That means any data in stdin must be buffered, to make it</span></div><div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>  <span class="comment">// seekable.</span></div><div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>  std::string buf;</div><div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>  <span class="keyword">const</span> l_uint8 *data = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>  <span class="keywordflow">if</span> (stdInput) {</div><div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>  buf.<a class="code" href="a02834.html#a8cfe836a7f55f4761936ea2231b6b9d2">assign</a>((std::istreambuf_iterator<char>(std::cin)),</div><div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>  (std::istreambuf_iterator<char>()));</div><div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>  data = <span class="keyword">reinterpret_cast<</span><span class="keyword">const </span>l_uint8 *<span class="keyword">></span>(buf.data());</div><div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>  <span class="comment">// Check whether the input file can be read.</span></div><div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>  <span class="keywordflow">if</span> (FILE* file = fopen(filename, <span class="stringliteral">"rb"</span>)) {</div><div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>  fclose(file);</div><div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>  fprintf(stderr, <span class="stringliteral">"Error, cannot read input file %s: %s\n"</span>,</div><div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>  filename, strerror(errno));</div><div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>  }</div><div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>  }</div><div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> </div><div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>  <span class="comment">// Here is our autodetection</span></div><div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>  <span class="keywordtype">int</span> format;</div><div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>  <span class="keywordtype">int</span> r = (stdInput) ?</div><div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>  findFileFormatBuffer(data, &format) :</div><div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>  findFileFormat(filename, &format);</div><div class="line"><a name="l01156"></a><span class="lineno"> 1156</span> </div><div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>  <span class="comment">// Maybe we have a filelist</span></div><div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>  <span class="keywordflow">if</span> (r != 0 || format == IFF_UNKNOWN) {</div><div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>  <a class="code" href="a02834.html">STRING</a> s;</div><div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>  <span class="keywordflow">if</span> (stdInput) {</div><div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>  s = buf.<a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>();</div><div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>  std::ifstream t(filename);</div><div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>  std::string u((std::istreambuf_iterator<char>(t)),</div><div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>  std::istreambuf_iterator<char>());</div><div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>  s = u.<a class="code" href="a02834.html#a552838a146145cb7993f42aefb740ea4">c_str</a>();</div><div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>  }</div><div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>  <span class="keywordflow">return</span> ProcessPagesFileList(<span class="keyword">nullptr</span>, &s, retry_config,</div><div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>  timeout_millisec, renderer,</div><div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a9ea498e7c3d83469257493f8900c3922">tessedit_page_number</a>);</div><div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>  }</div><div class="line"><a name="l01172"></a><span class="lineno"> 1172</span> </div><div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>  <span class="comment">// Maybe we have a TIFF which is potentially multipage</span></div><div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>  <span class="keywordtype">bool</span> tiff = (format == IFF_TIFF || format == IFF_TIFF_PACKBITS ||</div><div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>  format == IFF_TIFF_RLE || format == IFF_TIFF_G3 ||</div><div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>  format == IFF_TIFF_G4 || format == IFF_TIFF_LZW ||</div><div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>  format == IFF_TIFF_ZIP);</div><div class="line"><a name="l01178"></a><span class="lineno"> 1178</span> </div><div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>  <span class="comment">// Fail early if we can, before producing any output</span></div><div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>  Pix *pix = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>  <span class="keywordflow">if</span> (!tiff) {</div><div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>  pix = (stdInput) ? pixReadMem(data, buf.size()) : pixRead(filename);</div><div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>  <span class="keywordflow">if</span> (pix == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>  }</div><div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>  }</div><div class="line"><a name="l01187"></a><span class="lineno"> 1187</span> </div><div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>  <span class="comment">// Begin the output</span></div><div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>  <span class="keywordflow">if</span> (renderer && !renderer-><a class="code" href="a02190.html#a8f910e5251ee7ebd65f69072b358b445">BeginDocument</a>(unknown_title_)) {</div><div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>  pixDestroy(&pix);</div><div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>  }</div><div class="line"><a name="l01193"></a><span class="lineno"> 1193</span> </div><div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>  <span class="comment">// Produce output</span></div><div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>  r = (tiff) ?</div><div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>  ProcessPagesMultipageTiff(data, buf.size(), filename, retry_config,</div><div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>  timeout_millisec, renderer,</div><div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a9ea498e7c3d83469257493f8900c3922">tessedit_page_number</a>) :</div><div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>  <a class="code" href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724">ProcessPage</a>(pix, 0, filename, retry_config,</div><div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>  timeout_millisec, renderer);</div><div class="line"><a name="l01201"></a><span class="lineno"> 1201</span> </div><div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>  <span class="comment">// Clean up memory as needed</span></div><div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>  pixDestroy(&pix);</div><div class="line"><a name="l01204"></a><span class="lineno"> 1204</span> </div><div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>  <span class="comment">// End the output</span></div><div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>  <span class="keywordflow">if</span> (!r || (renderer && !renderer->EndDocument())) {</div><div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>  }</div><div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>  <a class="code" href="a01073.html#a0a1c82e812e15164718039c84cd9e97b">PERF_COUNT_END</a></div><div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01211"></a><span class="lineno"> 1211</span> }</div><div class="line"><a name="l01212"></a><span class="lineno"> 1212</span> </div><div class="line"><a name="l01213"></a><span class="lineno"><a class="line" href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724"> 1213</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724">TessBaseAPI::ProcessPage</a>(Pix* pix, <span class="keywordtype">int</span> page_index, <span class="keyword">const</span> <span class="keywordtype">char</span>* filename,</div><div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* retry_config, <span class="keywordtype">int</span> timeout_millisec,</div><div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>  <a class="code" href="a02190.html">TessResultRenderer</a>* renderer) {</div><div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>  <a class="code" href="a01073.html#a7b1e67112c5c3cc13ba8f90c8b60f05e">PERF_COUNT_START</a>(<span class="stringliteral">"ProcessPage"</span>)</div><div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>  <a class="code" href="a02186.html#a896312e68d246b58e704a8f5576e6917">SetInputName</a>(filename);</div><div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>  <a class="code" href="a01625.html#gaa463622111f3b11d8fca5863709cc699">SetImage</a>(pix);</div><div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>  <span class="keywordtype">bool</span> failed = <span class="keyword">false</span>;</div><div class="line"><a name="l01220"></a><span class="lineno"> 1220</span> </div><div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a> == <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa6c70374f53473ba410723e32b12f3f01">PSM_AUTO_ONLY</a>) {</div><div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>  <span class="comment">// Disabled character recognition</span></div><div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>  <a class="code" href="a02278.html">PageIterator</a>* it = <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">AnalyseLayout</a>();</div><div class="line"><a name="l01224"></a><span class="lineno"> 1224</span> </div><div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>  <span class="keywordflow">if</span> (it == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>  failed = <span class="keyword">true</span>;</div><div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>  }</div><div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a> == <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa319d6168eaa4b2002ac84c0558ba947d">PSM_OSD_ONLY</a>) {</div><div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>  failed = <a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">FindLines</a>() != 0;</div><div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (timeout_millisec > 0) {</div><div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>  <span class="comment">// Running with a timeout.</span></div><div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>  <a class="code" href="a02786.html">ETEXT_DESC</a> monitor;</div><div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>  monitor.<a class="code" href="a02786.html#afcea4319ceed9b37f3c43eec9ec5d55a">cancel</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>  monitor.<a class="code" href="a02786.html#a4844a3e9868a0fde7ad2fcaa37f5c5f1">cancel_this</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>  monitor.<a class="code" href="a02786.html#a16abfdff240ef121844b07bfa3afd4b5">set_deadline_msecs</a>(timeout_millisec);</div><div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> </div><div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>  <span class="comment">// Now run the main recognition.</span></div><div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>  failed = <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(&monitor) < 0;</div><div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>  <span class="comment">// Normal layout and character recognition with no timeout.</span></div><div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>  failed = <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0;</div><div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>  }</div><div class="line"><a name="l01245"></a><span class="lineno"> 1245</span> </div><div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab0c56686c9d207a42e67ba1f8c31a00b">tessedit_write_images</a>) {</div><div class="line"><a name="l01247"></a><span class="lineno"> 1247</span> <span class="preprocessor">#ifndef ANDROID_BUILD</span></div><div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>  Pix* page_pix = <a class="code" href="a01625.html#gaee19c9ea78a647420bbe99a447569995">GetThresholdedImage</a>();</div><div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>  pixWrite(<span class="stringliteral">"tessinput.tif"</span>, page_pix, IFF_TIFF_G4);</div><div class="line"><a name="l01250"></a><span class="lineno"> 1250</span> <span class="preprocessor">#endif // ANDROID_BUILD</span></div><div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>  }</div><div class="line"><a name="l01252"></a><span class="lineno"> 1252</span> </div><div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>  <span class="keywordflow">if</span> (failed && retry_config != <span class="keyword">nullptr</span> && retry_config[0] != <span class="charliteral">'\0'</span>) {</div><div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>  <span class="comment">// Save current config variables before switching modes.</span></div><div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>  FILE* fp = fopen(<a class="code" href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2">kOldVarsFile</a>, <span class="stringliteral">"wb"</span>);</div><div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>  <span class="keywordflow">if</span> (fp == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Error, failed to open file \"%s\"\n"</span>, <a class="code" href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2">kOldVarsFile</a>);</div><div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>  <a class="code" href="a02186.html#a9b25f5b2e2e3d9791e145355e91efdea">PrintVariables</a>(fp);</div><div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>  fclose(fp);</div><div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>  }</div><div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>  <span class="comment">// Switch to alternate mode for retry.</span></div><div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>  <a class="code" href="a02186.html#ab3bd61f8ccb7c4e1c41801ea708d2181">ReadConfigFile</a>(retry_config);</div><div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>  <a class="code" href="a01625.html#gaa463622111f3b11d8fca5863709cc699">SetImage</a>(pix);</div><div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>  <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>  <span class="comment">// Restore saved config variables.</span></div><div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>  <a class="code" href="a02186.html#ab3bd61f8ccb7c4e1c41801ea708d2181">ReadConfigFile</a>(<a class="code" href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2">kOldVarsFile</a>);</div><div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>  }</div><div class="line"><a name="l01269"></a><span class="lineno"> 1269</span> </div><div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>  <span class="keywordflow">if</span> (renderer && !failed) {</div><div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>  failed = !renderer-><a class="code" href="a02190.html#a48121964cc38c7b33bc7e555a7b41423">AddImage</a>(<span class="keyword">this</span>);</div><div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>  }</div><div class="line"><a name="l01273"></a><span class="lineno"> 1273</span> </div><div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>  <a class="code" href="a01073.html#a0a1c82e812e15164718039c84cd9e97b">PERF_COUNT_END</a></div><div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>  <span class="keywordflow">return</span> !failed;</div><div class="line"><a name="l01276"></a><span class="lineno"> 1276</span> }</div><div class="line"><a name="l01277"></a><span class="lineno"> 1277</span> </div><div class="line"><a name="l01282"></a><span class="lineno"><a class="line" href="a02186.html#ad7a9b7f45f94801d7891035bf38d4861"> 1282</a></span> <a class="code" href="a02250.html">LTRResultIterator</a>* <a class="code" href="a02186.html#ad7a9b7f45f94801d7891035bf38d4861">TessBaseAPI::GetLTRIterator</a>() {</div><div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>  <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="a02250.html">LTRResultIterator</a>(</div><div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>,</div><div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>(), <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>(),</div><div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>  <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l01289"></a><span class="lineno"> 1289</span> }</div><div class="line"><a name="l01290"></a><span class="lineno"> 1290</span> </div><div class="line"><a name="l01299"></a><span class="lineno"><a class="line" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04"> 1299</a></span> <a class="code" href="a02346.html">ResultIterator</a>* <a class="code" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">TessBaseAPI::GetIterator</a>() {</div><div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>  <span class="keywordflow">return</span> <a class="code" href="a02346.html#a961e7ee57edae85e855332a301cccacf">ResultIterator::StartOfParagraph</a>(<a class="code" href="a02250.html">LTRResultIterator</a>(</div><div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>,</div><div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>(), <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>(),</div><div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>  <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>));</div><div class="line"><a name="l01306"></a><span class="lineno"> 1306</span> }</div><div class="line"><a name="l01307"></a><span class="lineno"> 1307</span> </div><div class="line"><a name="l01316"></a><span class="lineno"><a class="line" href="a01625.html#ga29906219f78adc7fd76a83bde37e09eb"> 1316</a></span> <a class="code" href="a02258.html">MutableIterator</a>* <a class="code" href="a01625.html#ga29906219f78adc7fd76a83bde37e09eb">TessBaseAPI::GetMutableIterator</a>() {</div><div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>  <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="a02258.html">MutableIterator</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>,</div><div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">GetScaleFactor</a>(),</div><div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>(),</div><div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>  <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l01323"></a><span class="lineno"> 1323</span> }</div><div class="line"><a name="l01324"></a><span class="lineno"> 1324</span> </div><div class="line"><a name="l01326"></a><span class="lineno"><a class="line" href="a01625.html#ga115ef656f83352ba608b4f0bf9cfa2c4"> 1326</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga115ef656f83352ba608b4f0bf9cfa2c4">TessBaseAPI::GetUTF8Text</a>() {</div><div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>  (!<a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0))</div><div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>  <a class="code" href="a02834.html">STRING</a> text(<span class="stringliteral">""</span>);</div><div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>  <a class="code" href="a02346.html">ResultIterator</a> *it = <a class="code" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">GetIterator</a>();</div><div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>  <span class="keywordflow">if</span> (it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>)) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>  <span class="keyword">const</span> std::unique_ptr<const char[]> para_text(it-><a class="code" href="a02346.html#a22f65a94be27435440673d7c750808fb">GetUTF8Text</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>));</div><div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>  text += para_text.get();</div><div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>  } <span class="keywordflow">while</span> (it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>));</div><div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>  <span class="keywordtype">char</span>* result = <span class="keyword">new</span> <span class="keywordtype">char</span>[text.<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() + 1];</div><div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>  strncpy(result, text.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), text.<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() + 1);</div><div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l01341"></a><span class="lineno"> 1341</span> }</div><div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> </div><div class="line"><a name="l01346"></a><span class="lineno"> 1346</span> <span class="keyword">static</span> <a class="code" href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492f">tesseract::Orientation</a> GetBlockTextOrientation(<span class="keyword">const</span> <a class="code" href="a02278.html">PageIterator</a> *it) {</div><div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>  <a class="code" href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492f">tesseract::Orientation</a> orientation;</div><div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>  <a class="code" href="a01629.html#acac5bfbc6e9f8ca26f42ea3bad95d84e">tesseract::WritingDirection</a> writing_direction;</div><div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>  <a class="code" href="a01629.html#a28b14f9ab9d686fb45e130abc15c1781">tesseract::TextlineOrder</a> textline_order;</div><div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>  <span class="keywordtype">float</span> deskew_angle;</div><div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>  it-><a class="code" href="a02278.html#adc92bf8a6f06f7204579a695b744822e">Orientation</a>(&orientation, &writing_direction, &textline_order,</div><div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>  &deskew_angle);</div><div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>  <span class="keywordflow">return</span> orientation;</div><div class="line"><a name="l01354"></a><span class="lineno"> 1354</span> }</div><div class="line"><a name="l01355"></a><span class="lineno"> 1355</span> </div><div class="line"><a name="l01364"></a><span class="lineno"> 1364</span> <span class="keyword">static</span> <span class="keywordtype">void</span> AddBaselineCoordsTohOCR(<span class="keyword">const</span> PageIterator *it,</div><div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>  <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7">PageIteratorLevel</a> level,</div><div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>  <a class="code" href="a02834.html">STRING</a>* hocr_str) {</div><div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>  <a class="code" href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492f">tesseract::Orientation</a> orientation = GetBlockTextOrientation(it);</div><div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>  <span class="keywordflow">if</span> (orientation != <a class="code" href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492fa6e5beda212ea9e59ce8aad91ac47f248">ORIENTATION_PAGE_UP</a>) {</div><div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"; textangle "</span>, 360 - orientation * 90);</div><div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>  }</div><div class="line"><a name="l01372"></a><span class="lineno"> 1372</span> </div><div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>  it->BoundingBox(level, &left, &top, &right, &bottom);</div><div class="line"><a name="l01375"></a><span class="lineno"> 1375</span> </div><div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>  <span class="comment">// Try to get the baseline coordinates at this level.</span></div><div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>  <span class="keywordtype">int</span> x1, y1, x2, y2;</div><div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>  <span class="keywordflow">if</span> (!it->Baseline(level, &x1, &y1, &x2, &y2))</div><div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>  <span class="comment">// Following the description of this field of the hOCR spec, we convert the</span></div><div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>  <span class="comment">// baseline coordinates so that "the bottom left of the bounding box is the</span></div><div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>  <span class="comment">// origin".</span></div><div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>  x1 -= left;</div><div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>  x2 -= left;</div><div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>  y1 -= bottom;</div><div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>  y2 -= bottom;</div><div class="line"><a name="l01387"></a><span class="lineno"> 1387</span> </div><div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>  <span class="comment">// Now fit a line through the points so we can extract coefficients for the</span></div><div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>  <span class="comment">// equation: y = p1 x + p0</span></div><div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>  <span class="keywordtype">double</span> p1 = 0;</div><div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>  <span class="keywordtype">double</span> p0 = 0;</div><div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>  <span class="keywordflow">if</span> (x1 == x2) {</div><div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>  <span class="comment">// Problem computing the polynomial coefficients.</span></div><div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>  }</div><div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>  p1 = (y2 - y1) / static_cast<double>(x2 - x1);</div><div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>  p0 = y1 - <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(p1 * x1);</div><div class="line"><a name="l01398"></a><span class="lineno"> 1398</span> </div><div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>  hocr_str-><a class="code" href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">add_str_double</a>(<span class="stringliteral">"; baseline "</span>, round(p1 * 1000.0) / 1000.0);</div><div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>  hocr_str-><a class="code" href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">add_str_double</a>(<span class="stringliteral">" "</span>, round(p0 * 1000.0) / 1000.0);</div><div class="line"><a name="l01401"></a><span class="lineno"> 1401</span> }</div><div class="line"><a name="l01402"></a><span class="lineno"> 1402</span> </div><div class="line"><a name="l01403"></a><span class="lineno"> 1403</span> <span class="keyword">static</span> <span class="keywordtype">void</span> AddIdTohOCR(<a class="code" href="a02834.html">STRING</a>* hocr_str, <span class="keyword">const</span> std::string base, <span class="keywordtype">int</span> num1,</div><div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>  <span class="keywordtype">int</span> num2) {</div><div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> BUFSIZE = 64;</div><div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>  <span class="keywordtype">char</span> id_buffer[BUFSIZE];</div><div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>  <span class="keywordflow">if</span> (num2 >= 0) {</div><div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>  snprintf(id_buffer, BUFSIZE - 1, <span class="stringliteral">"%s_%d_%d"</span>, base.c_str(), num1, num2);</div><div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>  snprintf(id_buffer, BUFSIZE - 1, <span class="stringliteral">"%s_%d"</span>, base.c_str(), num1);</div><div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>  }</div><div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>  id_buffer[BUFSIZE - 1] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>  *hocr_str += <span class="stringliteral">" id='"</span>;</div><div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>  *hocr_str += id_buffer;</div><div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>  *hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01416"></a><span class="lineno"> 1416</span> }</div><div class="line"><a name="l01417"></a><span class="lineno"> 1417</span> </div><div class="line"><a name="l01418"></a><span class="lineno"> 1418</span> <span class="keyword">static</span> <span class="keywordtype">void</span> AddIdTohOCR(<a class="code" href="a02834.html">STRING</a>* hocr_str, <span class="keyword">const</span> std::string base, <span class="keywordtype">int</span> num1,</div><div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>  <span class="keywordtype">int</span> num2, <span class="keywordtype">int</span> num3) {</div><div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> BUFSIZE = 64;</div><div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>  <span class="keywordtype">char</span> id_buffer[BUFSIZE];</div><div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>  snprintf(id_buffer, BUFSIZE - 1, <span class="stringliteral">"%s_%d_%d_%d"</span>, base.c_str(), num1, num2,num3);</div><div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>  id_buffer[BUFSIZE - 1] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>  *hocr_str += <span class="stringliteral">" id='"</span>;</div><div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>  *hocr_str += id_buffer;</div><div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>  *hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> }</div><div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> </div><div class="line"><a name="l01429"></a><span class="lineno"> 1429</span> <span class="keyword">static</span> <span class="keywordtype">void</span> AddBoxTohOCR(<span class="keyword">const</span> ResultIterator* it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7">PageIteratorLevel</a> level,</div><div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>  <a class="code" href="a02834.html">STRING</a>* hocr_str) {</div><div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>  it->BoundingBox(level, &left, &top, &right, &bottom);</div><div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>  <span class="comment">// This is the only place we use double quotes instead of single quotes,</span></div><div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>  <span class="comment">// but it may too late to change for consistency</span></div><div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" title=\"bbox "</span>, left);</div><div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, top);</div><div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, right);</div><div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, bottom);</div><div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>  <span class="comment">// Add baseline coordinates & heights for textlines only.</span></div><div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>  <span class="keywordflow">if</span> (level == <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>) {</div><div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>  AddBaselineCoordsTohOCR(it, level, hocr_str);</div><div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>  <span class="comment">// add custom height measures</span></div><div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>  <span class="keywordtype">float</span> row_height, descenders, ascenders; <span class="comment">// row attributes</span></div><div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>  it->RowAttributes(&row_height, &descenders, &ascenders);</div><div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>  <span class="comment">// TODO(rays): Do we want to limit these to a single decimal place?</span></div><div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>  hocr_str-><a class="code" href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">add_str_double</a>(<span class="stringliteral">"; x_size "</span>, row_height);</div><div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>  hocr_str-><a class="code" href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">add_str_double</a>(<span class="stringliteral">"; x_descenders "</span>, descenders * -1);</div><div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>  hocr_str-><a class="code" href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">add_str_double</a>(<span class="stringliteral">"; x_ascenders "</span>, ascenders);</div><div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>  }</div><div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>  *hocr_str += <span class="stringliteral">"\">"</span>;</div><div class="line"><a name="l01451"></a><span class="lineno"> 1451</span> }</div><div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> </div><div class="line"><a name="l01453"></a><span class="lineno"> 1453</span> <span class="keyword">static</span> <span class="keywordtype">void</span> AddBoxToTSV(<span class="keyword">const</span> PageIterator* it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7">PageIteratorLevel</a> level,</div><div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>  <a class="code" href="a02834.html">STRING</a>* hocr_str) {</div><div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>  it->BoundingBox(level, &left, &top, &right, &bottom);</div><div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, left);</div><div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, top);</div><div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, right - left);</div><div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>  hocr_str-><a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, bottom - top);</div><div class="line"><a name="l01461"></a><span class="lineno"> 1461</span> }</div><div class="line"><a name="l01462"></a><span class="lineno"> 1462</span> </div><div class="line"><a name="l01472"></a><span class="lineno"><a class="line" href="a01625.html#ga655f906bbf64dcd6f33ce633ecce997d"> 1472</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga7fffd7934197b7c9ac91db5aac09bf78">TessBaseAPI::GetHOCRText</a>(<span class="keywordtype">int</span> page_number) {</div><div class="line"><a name="l01473"></a><span class="lineno"> 1473</span>  <span class="keywordflow">return</span> <a class="code" href="a01625.html#ga7fffd7934197b7c9ac91db5aac09bf78">GetHOCRText</a>(<span class="keyword">nullptr</span>, page_number);</div><div class="line"><a name="l01474"></a><span class="lineno"> 1474</span> }</div><div class="line"><a name="l01475"></a><span class="lineno"> 1475</span> </div><div class="line"><a name="l01485"></a><span class="lineno"><a class="line" href="a01625.html#ga7fffd7934197b7c9ac91db5aac09bf78"> 1485</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga7fffd7934197b7c9ac91db5aac09bf78">TessBaseAPI::GetHOCRText</a>(<a class="code" href="a02786.html">ETEXT_DESC</a>* monitor, <span class="keywordtype">int</span> page_number) {</div><div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || (<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(monitor) < 0))</div><div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01488"></a><span class="lineno"> 1488</span> </div><div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>  <span class="keywordtype">int</span> lcnt = 1, bcnt = 1, pcnt = 1, wcnt = 1, tcnt = 1, gcnt = 1;</div><div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>  <span class="keywordtype">int</span> page_id = page_number + 1; <span class="comment">// hOCR uses 1-based page numbers.</span></div><div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>  <span class="keywordtype">bool</span> para_is_ltr = <span class="keyword">true</span>; <span class="comment">// Default direction is LTR</span></div><div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* paragraph_lang = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>  <span class="keywordtype">bool</span> font_info = <span class="keyword">false</span>;</div><div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>  <a class="code" href="a02186.html#adc8316d75713a2abf5373f85f6f58a93">GetBoolVariable</a>(<span class="stringliteral">"hocr_font_info"</span>, &font_info);</div><div class="line"><a name="l01495"></a><span class="lineno"> 1495</span> </div><div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>  <a class="code" href="a02834.html">STRING</a> hocr_str(<span class="stringliteral">""</span>);</div><div class="line"><a name="l01497"></a><span class="lineno"> 1497</span> </div><div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>  <a class="code" href="a02186.html#a896312e68d246b58e704a8f5576e6917">SetInputName</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l01500"></a><span class="lineno"> 1500</span> </div><div class="line"><a name="l01501"></a><span class="lineno"> 1501</span> <span class="preprocessor">#ifdef _WIN32</span></div><div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>  <span class="comment">// convert input name from ANSI encoding to utf-8</span></div><div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>  <span class="keywordtype">int</span> str16_len =</div><div class="line"><a name="l01504"></a><span class="lineno"> 1504</span>  MultiByteToWideChar(CP_ACP, 0, <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), -1, <span class="keyword">nullptr</span>, 0);</div><div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>  <span class="keywordtype">wchar_t</span> *uni16_str = <span class="keyword">new</span> WCHAR[str16_len];</div><div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>  str16_len = MultiByteToWideChar(CP_ACP, 0, <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), -1,</div><div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>  uni16_str, str16_len);</div><div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>  <span class="keywordtype">int</span> utf8_len = WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, <span class="keyword">nullptr</span>, 0,</div><div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>  <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>  <span class="keywordtype">char</span> *utf8_str = <span class="keyword">new</span> <span class="keywordtype">char</span>[utf8_len];</div><div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>  WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, utf8_str,</div><div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>  utf8_len, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>  *<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> = utf8_str;</div><div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>  <span class="keyword">delete</span>[] uni16_str;</div><div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>  <span class="keyword">delete</span>[] utf8_str;</div><div class="line"><a name="l01516"></a><span class="lineno"> 1516</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l01517"></a><span class="lineno"> 1517</span> </div><div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>  hocr_str += <span class="stringliteral">" <div class='ocr_page'"</span>;</div><div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"page"</span>, page_id, -1);</div><div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>  hocr_str += <span class="stringliteral">" title='image \""</span>;</div><div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>) {</div><div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>  hocr_str += <a class="code" href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822">HOcrEscape</a>(<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>  hocr_str += <span class="stringliteral">"unknown"</span>;</div><div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>  }</div><div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\"; bbox "</span>, <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>);</div><div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>);</div><div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>);</div><div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"; ppageno "</span>, page_number);</div><div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>  hocr_str += <span class="stringliteral">"'>\n"</span>;</div><div class="line"><a name="l01532"></a><span class="lineno"> 1532</span> </div><div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>  <a class="code" href="a02346.html">ResultIterator</a> *res_it = <a class="code" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">GetIterator</a>();</div><div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>  <span class="keywordflow">while</span> (!res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>)) {</div><div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>)) {</div><div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>  res_it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>);</div><div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>  }</div><div class="line"><a name="l01539"></a><span class="lineno"> 1539</span> </div><div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>  <span class="comment">// Open any new block/paragraph/textline.</span></div><div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>)) {</div><div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>  para_is_ltr = <span class="keyword">true</span>; <span class="comment">// reset to default direction</span></div><div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>  hocr_str += <span class="stringliteral">" <div class='ocr_carea'"</span>;</div><div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"block"</span>, page_id, bcnt);</div><div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>  AddBoxTohOCR(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, &hocr_str);</div><div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>  }</div><div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>)) {</div><div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>  hocr_str += <span class="stringliteral">"\n <p class='ocr_par'"</span>;</div><div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>  para_is_ltr = res_it-><a class="code" href="a02346.html#a17891e56b5a812ee7728300dac362b40">ParagraphIsLtr</a>();</div><div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>  <span class="keywordflow">if</span> (!para_is_ltr) {</div><div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>  hocr_str += <span class="stringliteral">" dir='rtl'"</span>;</div><div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>  }</div><div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"par"</span>, page_id, pcnt);</div><div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>  paragraph_lang = res_it-><a class="code" href="a02250.html#a4ba498c7e88eeb2470216086eeb95f7e">WordRecognitionLanguage</a>();</div><div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>  <span class="keywordflow">if</span> (paragraph_lang) {</div><div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>  hocr_str += <span class="stringliteral">" lang='"</span>;</div><div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>  hocr_str += paragraph_lang;</div><div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>  hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>  }</div><div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>  AddBoxTohOCR(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>, &hocr_str);</div><div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>  }</div><div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>)) {</div><div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>  hocr_str += <span class="stringliteral">"\n <span class='ocr_line'"</span>;</div><div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"line"</span>, page_id, lcnt);</div><div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>  AddBoxTohOCR(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, &hocr_str);</div><div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>  }</div><div class="line"><a name="l01567"></a><span class="lineno"> 1567</span> </div><div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>  <span class="comment">// Now, process the word...</span></div><div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>  std::vector<std::vector<std::pair<const char*, float>>>* confidencemap = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab7a5193af82a227f15b4811003960da2">lstm_choice_mode</a>) {</div><div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>  confidencemap = res_it-><a class="code" href="a02346.html#a5c0e0a27f1cd412fd07332959056e69e">GetBestLSTMSymbolChoices</a>();</div><div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>  }</div><div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>  hocr_str += <span class="stringliteral">"\n <span class='ocrx_word'"</span>;</div><div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"word"</span>, page_id, wcnt);</div><div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>  <span class="keywordtype">bool</span> bold, italic, underlined, monospace, serif, smallcaps;</div><div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>  <span class="keywordtype">int</span> pointsize, font_id;</div><div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *font_name;</div><div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>  res_it-><a class="code" href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">BoundingBox</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>, &left, &top, &right, &bottom);</div><div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>  font_name = res_it-><a class="code" href="a02250.html#a1cae927f76fc372acc7c19549115ca4e">WordFontAttributes</a>(&bold, &italic, &underlined,</div><div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>  &monospace, &serif, &smallcaps,</div><div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>  &pointsize, &font_id);</div><div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" title='bbox "</span>, left);</div><div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, top);</div><div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, right);</div><div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" "</span>, bottom);</div><div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"; x_wconf "</span>, res_it-><a class="code" href="a02250.html#a6a640541c34bb3e1a395453d991267fa">Confidence</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>));</div><div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>  <span class="keywordflow">if</span> (font_info) {</div><div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>  <span class="keywordflow">if</span> (font_name) {</div><div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>  hocr_str += <span class="stringliteral">"; x_font "</span>;</div><div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>  hocr_str += <a class="code" href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822">HOcrEscape</a>(font_name);</div><div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>  }</div><div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"; x_fsize "</span>, pointsize);</div><div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>  }</div><div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>  hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* lang = res_it-><a class="code" href="a02250.html#a4ba498c7e88eeb2470216086eeb95f7e">WordRecognitionLanguage</a>();</div><div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>  <span class="keywordflow">if</span> (lang && (!paragraph_lang || strcmp(lang, paragraph_lang))) {</div><div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>  hocr_str += <span class="stringliteral">" lang='"</span>;</div><div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>  hocr_str += lang;</div><div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>  hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>  }</div><div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>  <span class="keywordflow">switch</span> (res_it-><a class="code" href="a02250.html#a1c5dc6da1ffd6e8132b2fca914146f02">WordDirection</a>()) {</div><div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>  <span class="comment">// Only emit direction if different from current paragraph direction</span></div><div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>  <span class="keywordflow">case</span> <a class="code" href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa5978cd698552a6106db1bf6528617317">DIR_LEFT_TO_RIGHT</a>:</div><div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>  <span class="keywordflow">if</span> (!para_is_ltr) hocr_str += <span class="stringliteral">" dir='ltr'"</span>;</div><div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>  <span class="keywordflow">case</span> <a class="code" href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa3c6da23f98ab8ac48598c21583d9297e">DIR_RIGHT_TO_LEFT</a>:</div><div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>  <span class="keywordflow">if</span> (para_is_ltr) hocr_str += <span class="stringliteral">" dir='rtl'"</span>;</div><div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>  <span class="keywordflow">case</span> <a class="code" href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa252615b6d7ebef9293183f6e94488cc1">DIR_MIX</a>:</div><div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>  <span class="keywordflow">case</span> <a class="code" href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaaacc5ec7fd402a8806e78fba831045aae">DIR_NEUTRAL</a>:</div><div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>  <span class="keywordflow">default</span>: <span class="comment">// Do nothing.</span></div><div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>  }</div><div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>  hocr_str += <span class="stringliteral">">"</span>;</div><div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>  <span class="keywordtype">bool</span> last_word_in_line = res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>);</div><div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>  <span class="keywordtype">bool</span> last_word_in_para = res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>);</div><div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>  <span class="keywordtype">bool</span> last_word_in_block = res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>);</div><div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>  <span class="keywordflow">if</span> (bold) hocr_str += <span class="stringliteral">"<strong>"</span>;</div><div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>  <span class="keywordflow">if</span> (italic) hocr_str += <span class="stringliteral">"<em>"</span>;</div><div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>  <span class="keyword">const</span> std::unique_ptr<const char[]> grapheme(</div><div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>  res_it-><a class="code" href="a02346.html#a22f65a94be27435440673d7c750808fb">GetUTF8Text</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>));</div><div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>  <span class="keywordflow">if</span> (grapheme && grapheme[0] != 0) {</div><div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>  hocr_str += <a class="code" href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822">HOcrEscape</a>(grapheme.get());</div><div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>  }</div><div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>  res_it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>);</div><div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>  } <span class="keywordflow">while</span> (!res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>) && !res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>));</div><div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>  <span class="keywordflow">if</span> (italic) hocr_str += <span class="stringliteral">"</em>"</span>;</div><div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>  <span class="keywordflow">if</span> (bold) hocr_str += <span class="stringliteral">"</strong>"</span>;</div><div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>  <span class="comment">// If the lstm choice mode is required it is added here</span></div><div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab7a5193af82a227f15b4811003960da2">lstm_choice_mode</a> == 1 && confidencemap != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < confidencemap->size(); i++) {</div><div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>  hocr_str += <span class="stringliteral">"\n <span class='ocrx_cinfo'"</span>;</div><div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"timestep"</span>, page_id, wcnt, tcnt);</div><div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>  hocr_str += <span class="stringliteral">">"</span>;</div><div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>  std::vector<std::pair<const char*, float>> timestep = (*confidencemap)[i];</div><div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>  <span class="keywordflow">for</span> (std::pair<const char*, float> conf : timestep) {</div><div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>  hocr_str += <span class="stringliteral">"<span class='ocr_glyph'"</span>;</div><div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"choice"</span>, page_id, wcnt, gcnt);</div><div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" title='x_confs "</span>, <span class="keywordtype">int</span>(conf.second * 100));</div><div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>  hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>  hocr_str += <span class="stringliteral">">"</span>;</div><div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>  hocr_str += conf.first;</div><div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>  hocr_str += <span class="stringliteral">"</span>"</span>;</div><div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>  gcnt++;</div><div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>  }</div><div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>  hocr_str += <span class="stringliteral">"</span>"</span>;</div><div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>  tcnt++;</div><div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>  }</div><div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ab7a5193af82a227f15b4811003960da2">lstm_choice_mode</a> == 2 && confidencemap != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < confidencemap->size(); i++) {</div><div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>  std::vector<std::pair<const char*, float>> timestep = (*confidencemap)[i];</div><div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>  <span class="keywordflow">if</span> (timestep.size() > 0) {</div><div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>  hocr_str += <span class="stringliteral">"\n <span class='ocrx_cinfo'"</span>;</div><div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"lstm_choices"</span>, page_id, wcnt, tcnt);</div><div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>  hocr_str += <span class="stringliteral">" chosen='"</span>;</div><div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>  hocr_str += timestep[0].first;</div><div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>  hocr_str += <span class="stringliteral">"'>"</span>;</div><div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 1; j < timestep.size(); j++) {</div><div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>  hocr_str += <span class="stringliteral">"<span class='ocr_glyph'"</span>;</div><div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>  AddIdTohOCR(&hocr_str, <span class="stringliteral">"choice"</span>, page_id, wcnt, gcnt);</div><div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>  hocr_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">" title='x_confs "</span>, <span class="keywordtype">int</span>(timestep[j].second * 100));</div><div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>  hocr_str += <span class="stringliteral">"'"</span>;</div><div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>  hocr_str += <span class="stringliteral">">"</span>;</div><div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>  hocr_str += timestep[j].first;</div><div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>  hocr_str += <span class="stringliteral">"</span>"</span>;</div><div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>  gcnt++;</div><div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>  }</div><div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>  hocr_str += <span class="stringliteral">"</span>"</span>;</div><div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>  tcnt++;</div><div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>  }</div><div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>  }</div><div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>  }</div><div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>  hocr_str += <span class="stringliteral">"</span>"</span>;</div><div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>  tcnt = 1;</div><div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>  gcnt = 1;</div><div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>  wcnt++;</div><div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>  <span class="comment">// Close any ending block/paragraph/textline.</span></div><div class="line"><a name="l01680"></a><span class="lineno"> 1680</span>  <span class="keywordflow">if</span> (last_word_in_line) {</div><div class="line"><a name="l01681"></a><span class="lineno"> 1681</span>  hocr_str += <span class="stringliteral">"\n </span>"</span>;</div><div class="line"><a name="l01682"></a><span class="lineno"> 1682</span>  lcnt++;</div><div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>  }</div><div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>  <span class="keywordflow">if</span> (last_word_in_para) {</div><div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>  hocr_str += <span class="stringliteral">"\n </p>\n"</span>;</div><div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>  pcnt++;</div><div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>  para_is_ltr = <span class="keyword">true</span>; <span class="comment">// back to default direction</span></div><div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>  }</div><div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>  <span class="keywordflow">if</span> (last_word_in_block) {</div><div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>  hocr_str += <span class="stringliteral">" </div>\n"</span>;</div><div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>  bcnt++;</div><div class="line"><a name="l01692"></a><span class="lineno"> 1692</span>  }</div><div class="line"><a name="l01693"></a><span class="lineno"> 1693</span>  }</div><div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>  hocr_str += <span class="stringliteral">" </div>\n"</span>;</div><div class="line"><a name="l01695"></a><span class="lineno"> 1695</span> </div><div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>  <span class="keywordtype">char</span> *ret = <span class="keyword">new</span> <span class="keywordtype">char</span>[hocr_str.<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() + 1];</div><div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>  strcpy(ret, hocr_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>  <span class="keyword">delete</span> res_it;</div><div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>  <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l01700"></a><span class="lineno"> 1700</span> }</div><div class="line"><a name="l01701"></a><span class="lineno"> 1701</span> </div><div class="line"><a name="l01707"></a><span class="lineno"><a class="line" href="a01625.html#ga868852254450655bb2e1c61ca81bab83"> 1707</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga868852254450655bb2e1c61ca81bab83">TessBaseAPI::GetTSVText</a>(<span class="keywordtype">int</span> page_number) {</div><div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || (<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0))</div><div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01710"></a><span class="lineno"> 1710</span> </div><div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>  <span class="keywordtype">int</span> lcnt = 1, bcnt = 1, pcnt = 1, wcnt = 1;</div><div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>  <span class="keywordtype">int</span> page_id = page_number + 1; <span class="comment">// we use 1-based page numbers.</span></div><div class="line"><a name="l01713"></a><span class="lineno"> 1713</span> </div><div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>  <a class="code" href="a02834.html">STRING</a> tsv_str(<span class="stringliteral">""</span>);</div><div class="line"><a name="l01715"></a><span class="lineno"> 1715</span> </div><div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>  <span class="keywordtype">int</span> page_num = page_id;</div><div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>  <span class="keywordtype">int</span> block_num = 0;</div><div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>  <span class="keywordtype">int</span> par_num = 0;</div><div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>  <span class="keywordtype">int</span> line_num = 0;</div><div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>  <span class="keywordtype">int</span> word_num = 0;</div><div class="line"><a name="l01721"></a><span class="lineno"> 1721</span> </div><div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"1\t"</span>, page_num); <span class="comment">// level 1 - page</span></div><div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, block_num);</div><div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, par_num);</div><div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, line_num);</div><div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, word_num);</div><div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, <a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>);</div><div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, <a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>);</div><div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, <a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>);</div><div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>);</div><div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>  tsv_str += <span class="stringliteral">"\t-1\t\n"</span>;</div><div class="line"><a name="l01732"></a><span class="lineno"> 1732</span> </div><div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>  <a class="code" href="a02346.html">ResultIterator</a>* res_it = <a class="code" href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">GetIterator</a>();</div><div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>  <span class="keywordflow">while</span> (!res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>)) {</div><div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>)) {</div><div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>  res_it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>);</div><div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>  }</div><div class="line"><a name="l01739"></a><span class="lineno"> 1739</span> </div><div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>  <span class="comment">// Add rows for any new block/paragraph/textline.</span></div><div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>)) {</div><div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>  block_num++;</div><div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>  par_num = 0;</div><div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>  line_num = 0;</div><div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>  word_num = 0;</div><div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"2\t"</span>, page_num); <span class="comment">// level 2 - block</span></div><div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, block_num);</div><div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, par_num);</div><div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, line_num);</div><div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, word_num);</div><div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>  AddBoxToTSV(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, &tsv_str);</div><div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>  tsv_str += <span class="stringliteral">"\t-1\t\n"</span>; <span class="comment">// end of row for block</span></div><div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>  }</div><div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>)) {</div><div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>  par_num++;</div><div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>  line_num = 0;</div><div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>  word_num = 0;</div><div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"3\t"</span>, page_num); <span class="comment">// level 3 - paragraph</span></div><div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, block_num);</div><div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, par_num);</div><div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, line_num);</div><div class="line"><a name="l01762"></a><span class="lineno"> 1762</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, word_num);</div><div class="line"><a name="l01763"></a><span class="lineno"> 1763</span>  AddBoxToTSV(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>, &tsv_str);</div><div class="line"><a name="l01764"></a><span class="lineno"> 1764</span>  tsv_str += <span class="stringliteral">"\t-1\t\n"</span>; <span class="comment">// end of row for para</span></div><div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>  }</div><div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>)) {</div><div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>  line_num++;</div><div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>  word_num = 0;</div><div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"4\t"</span>, page_num); <span class="comment">// level 4 - line</span></div><div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, block_num);</div><div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, par_num);</div><div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, line_num);</div><div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, word_num);</div><div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>  AddBoxToTSV(res_it, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, &tsv_str);</div><div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>  tsv_str += <span class="stringliteral">"\t-1\t\n"</span>; <span class="comment">// end of row for line</span></div><div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>  }</div><div class="line"><a name="l01777"></a><span class="lineno"> 1777</span> </div><div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>  <span class="comment">// Now, process the word...</span></div><div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>  res_it-><a class="code" href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">BoundingBox</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>, &left, &top, &right, &bottom);</div><div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>  word_num++;</div><div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"5\t"</span>, page_num); <span class="comment">// level 5 - word</span></div><div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, block_num);</div><div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, par_num);</div><div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, line_num);</div><div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, word_num);</div><div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, left);</div><div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, top);</div><div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, right - left);</div><div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, bottom - top);</div><div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>  tsv_str.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"\t"</span>, res_it-><a class="code" href="a02250.html#a6a640541c34bb3e1a395453d991267fa">Confidence</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>));</div><div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>  tsv_str += <span class="stringliteral">"\t"</span>;</div><div class="line"><a name="l01793"></a><span class="lineno"> 1793</span> </div><div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>  <span class="comment">// Increment counts if at end of block/paragraph/textline.</span></div><div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>)) lcnt++;</div><div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">RIL_PARA</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>)) pcnt++;</div><div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>  <span class="keywordflow">if</span> (res_it-><a class="code" href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">IsAtFinalElement</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>, <a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>)) bcnt++;</div><div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> </div><div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>  tsv_str +=</div><div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>  std::unique_ptr<const char[]>(res_it-><a class="code" href="a02346.html#a22f65a94be27435440673d7c750808fb">GetUTF8Text</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>)).<span class="keyword">get</span>();</div><div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>  res_it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>);</div><div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>  } <span class="keywordflow">while</span> (!res_it-><a class="code" href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">Empty</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>) && !res_it-><a class="code" href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">IsAtBeginningOf</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">RIL_WORD</a>));</div><div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>  tsv_str += <span class="stringliteral">"\n"</span>; <span class="comment">// end of row</span></div><div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>  wcnt++;</div><div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>  }</div><div class="line"><a name="l01807"></a><span class="lineno"> 1807</span> </div><div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>  <span class="keywordtype">char</span>* ret = <span class="keyword">new</span> <span class="keywordtype">char</span>[tsv_str.<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() + 1];</div><div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>  strcpy(ret, tsv_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>  <span class="keyword">delete</span> res_it;</div><div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>  <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l01812"></a><span class="lineno"> 1812</span> }</div><div class="line"><a name="l01813"></a><span class="lineno"> 1813</span> </div><div class="line"><a name="l01815"></a><span class="lineno"><a class="line" href="a01629.html#aa46d9454c58be9a34a7a91737d553900"> 1815</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#aa46d9454c58be9a34a7a91737d553900">kNumbersPerBlob</a> = 5;</div><div class="line"><a name="l01820"></a><span class="lineno"><a class="line" href="a01629.html#a929cce152875849d022496470235b437"> 1820</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a929cce152875849d022496470235b437">kBytesPerNumber</a> = 5;</div><div class="line"><a name="l01826"></a><span class="lineno"><a class="line" href="a01629.html#a294e870871cf3fb0928cbd5686346b3d"> 1826</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a294e870871cf3fb0928cbd5686346b3d">kBytesPerBoxFileLine</a> = (<a class="code" href="a01629.html#a929cce152875849d022496470235b437">kBytesPerNumber</a> + 1) * <a class="code" href="a01629.html#aa46d9454c58be9a34a7a91737d553900">kNumbersPerBlob</a> + 1;</div><div class="line"><a name="l01828"></a><span class="lineno"><a class="line" href="a01629.html#a6007ea2fe11067865156fb804c36079e"> 1828</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a6007ea2fe11067865156fb804c36079e">kBytesPer64BitNumber</a> = 20;</div><div class="line"><a name="l01835"></a><span class="lineno"><a class="line" href="a01629.html#a688dc51b653c642009af87c6d9b9dea2"> 1835</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a688dc51b653c642009af87c6d9b9dea2">kMaxBytesPerLine</a> = <a class="code" href="a01629.html#aa46d9454c58be9a34a7a91737d553900">kNumbersPerBlob</a> * (<a class="code" href="a01629.html#a6007ea2fe11067865156fb804c36079e">kBytesPer64BitNumber</a> + 1) + 1 +</div><div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>  <a class="code" href="a00605.html#a902bc40c9d89802bc063afe30ce9e708">UNICHAR_LEN</a>;</div><div class="line"><a name="l01837"></a><span class="lineno"> 1837</span> </div><div class="line"><a name="l01844"></a><span class="lineno"><a class="line" href="a01625.html#gaadda8cd6abe770d2f6a70a18329b1973"> 1844</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#gaadda8cd6abe770d2f6a70a18329b1973">TessBaseAPI::GetBoxText</a>(<span class="keywordtype">int</span> page_number) {</div><div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>  (!<a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0))</div><div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>  <span class="keywordtype">int</span> blob_count;</div><div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>  <span class="keywordtype">int</span> utf8_length = <a class="code" href="a02186.html#aed3d481fc0c7dffad24572bd1f449598">TextLength</a>(&blob_count);</div><div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>  <span class="keywordtype">int</span> total_length = blob_count * <a class="code" href="a01629.html#a294e870871cf3fb0928cbd5686346b3d">kBytesPerBoxFileLine</a> + utf8_length +</div><div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>  <a class="code" href="a01629.html#a688dc51b653c642009af87c6d9b9dea2">kMaxBytesPerLine</a>;</div><div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>  <span class="keywordtype">char</span>* result = <span class="keyword">new</span> <span class="keywordtype">char</span>[total_length];</div><div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>  result[0] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>  <span class="keywordtype">int</span> output_length = 0;</div><div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>  <a class="code" href="a02250.html">LTRResultIterator</a>* it = <a class="code" href="a02186.html#ad7a9b7f45f94801d7891035bf38d4861">GetLTRIterator</a>();</div><div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>  <span class="keywordflow">if</span> (it-><a class="code" href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">BoundingBox</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>, &left, &top, &right, &bottom)) {</div><div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>  <span class="keyword">const</span> std::unique_ptr<<span class="comment">/*non-const*/</span> <span class="keywordtype">char</span>[]> text(</div><div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>  it-><a class="code" href="a02250.html#a1438c0a14a5cfaec1306e11ac336eee1">GetUTF8Text</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>));</div><div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>  <span class="comment">// Tesseract uses space for recognition failure. Fix to a reject</span></div><div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>  <span class="comment">// character, kTesseractReject so we don't create illegal box files.</span></div><div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; text[i] != <span class="charliteral">'\0'</span>; ++i) {</div><div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>  <span class="keywordflow">if</span> (text[i] == <span class="charliteral">' '</span>)</div><div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>  text[i] = <a class="code" href="a01629.html#a1083ed81b6adbb6930e87d0c58671e26">kTesseractReject</a>;</div><div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>  }</div><div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>  snprintf(result + output_length, total_length - output_length,</div><div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>  <span class="stringliteral">"%s %d %d %d %d %d\n"</span>, text.get(), left, <a class="code" href="a01627.html#gab7d24a78f3565c5bfb42b2592b9e8df0">image_height_</a> - bottom,</div><div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>  right, <a class="code" href="a01627.html#gab7d24a78f3565c5bfb42b2592b9e8df0">image_height_</a> - top, page_number);</div><div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>  output_length += strlen(result + output_length);</div><div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>  <span class="comment">// Just in case...</span></div><div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>  <span class="keywordflow">if</span> (output_length + <a class="code" href="a01629.html#a688dc51b653c642009af87c6d9b9dea2">kMaxBytesPerLine</a> > total_length)</div><div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>  }</div><div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>  } <span class="keywordflow">while</span> (it-><a class="code" href="a02278.html#a415ea7c61e24868bc67e676184be0bb9">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">RIL_SYMBOL</a>));</div><div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l01878"></a><span class="lineno"> 1878</span> }</div><div class="line"><a name="l01879"></a><span class="lineno"> 1879</span> </div><div class="line"><a name="l01885"></a><span class="lineno"><a class="line" href="a01629.html#afa62cc25480d6eee8b1bb2ef4a1f8fc3"> 1885</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#afa62cc25480d6eee8b1bb2ef4a1f8fc3">kUniChs</a>[] = {</div><div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>  0x20ac, 0x201c, 0x201d, 0x2018, 0x2019, 0x2022, 0x2014, 0</div><div class="line"><a name="l01887"></a><span class="lineno"> 1887</span> };</div><div class="line"><a name="l01889"></a><span class="lineno"><a class="line" href="a01629.html#a7e0c7c50e2e05e503a51b8c33d35ade6"> 1889</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a01629.html#a7e0c7c50e2e05e503a51b8c33d35ade6">kLatinChs</a>[] = {</div><div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>  0x00a2, 0x0022, 0x0022, 0x0027, 0x0027, 0x00b7, 0x002d, 0</div><div class="line"><a name="l01891"></a><span class="lineno"> 1891</span> };</div><div class="line"><a name="l01892"></a><span class="lineno"> 1892</span> </div><div class="line"><a name="l01898"></a><span class="lineno"><a class="line" href="a01625.html#ga173b4289191b6c2faf2a4a4b7c94affc"> 1898</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga173b4289191b6c2faf2a4a4b7c94affc">TessBaseAPI::GetUNLVText</a>() {</div><div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>  (!<a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0))</div><div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>  <span class="keywordtype">bool</span> tilde_crunch_written = <span class="keyword">false</span>;</div><div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>  <span class="keywordtype">bool</span> last_char_was_newline = <span class="keyword">true</span>;</div><div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>  <span class="keywordtype">bool</span> last_char_was_tilde = <span class="keyword">false</span>;</div><div class="line"><a name="l01905"></a><span class="lineno"> 1905</span> </div><div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>  <span class="keywordtype">int</span> total_length = <a class="code" href="a02186.html#aed3d481fc0c7dffad24572bd1f449598">TextLength</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>  <span class="keywordtype">char</span>* result = <span class="keyword">new</span> <span class="keywordtype">char</span>[total_length];</div><div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>  <span class="keywordtype">char</span>* ptr = result;</div><div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>  <span class="keywordflow">for</span> (page_res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>(); page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a> () != <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>  <a class="code" href="a02542.html">WERD_RES</a> *word = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>  <span class="comment">// Process the current word.</span></div><div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a82d32a9f59bc1c08da9537303c56615b">unlv_crunch_mode</a> != <a class="code" href="a00344.html#affc9a96d31e23e645355e534f11c40e9a1eac25752f2c55f1809d11d4ef917ff9">CR_NONE</a>) {</div><div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a82d32a9f59bc1c08da9537303c56615b">unlv_crunch_mode</a> != <a class="code" href="a00344.html#affc9a96d31e23e645355e534f11c40e9a1799c83261446306e1d1527f1779d6a4">CR_DELETE</a> &&</div><div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>  (!tilde_crunch_written ||</div><div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>  (word-><a class="code" href="a02542.html#a82d32a9f59bc1c08da9537303c56615b">unlv_crunch_mode</a> == <a class="code" href="a00344.html#affc9a96d31e23e645355e534f11c40e9ad0198ebd5b9e3299dd94f0c5f4d3e003">CR_KEEP_SPACE</a> &&</div><div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>  word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#a43b4c52165d4b7fd811eb653c2aa9d8e">space</a>() > 0 &&</div><div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>  !word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea675eadd051ea82d1f288751799bfa31c">W_FUZZY_NON</a>) &&</div><div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>  !word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea3580884b5b0335502fb928db4a0a2024">W_FUZZY_SP</a>)))) {</div><div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaff21d7c8c8992120fff35942408a00d2">W_BOL</a>) &&</div><div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>  word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#a43b4c52165d4b7fd811eb653c2aa9d8e">space</a>() > 0 &&</div><div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>  !word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea675eadd051ea82d1f288751799bfa31c">W_FUZZY_NON</a>) &&</div><div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>  !word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea3580884b5b0335502fb928db4a0a2024">W_FUZZY_SP</a>)) {</div><div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>  <span class="comment">/* Write a space to separate from preceding good text */</span></div><div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>  *ptr++ = <span class="charliteral">' '</span>;</div><div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>  last_char_was_tilde = <span class="keyword">false</span>;</div><div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>  }</div><div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>  <span class="keywordflow">if</span> (!last_char_was_tilde) {</div><div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>  <span class="comment">// Write a reject char.</span></div><div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>  last_char_was_tilde = <span class="keyword">true</span>;</div><div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>  *ptr++ = <a class="code" href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106">kUNLVReject</a>;</div><div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>  tilde_crunch_written = <span class="keyword">true</span>;</div><div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>  last_char_was_newline = <span class="keyword">false</span>;</div><div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>  }</div><div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>  }</div><div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>  <span class="comment">// NORMAL PROCESSING of non tilde crunched words.</span></div><div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>  tilde_crunch_written = <span class="keyword">false</span>;</div><div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a2888f59985750554a12f173073305ad3">set_unlv_suspects</a>(word);</div><div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* wordstr = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>();</div><div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a>& lengths = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adaecd80cfe44e00e9c4647859b1c87e0">unichar_lengths</a>();</div><div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>  <span class="keywordtype">int</span> length = lengths.<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>();</div><div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>  <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>  <span class="keywordtype">int</span> offset = 0;</div><div class="line"><a name="l01946"></a><span class="lineno"> 1946</span> </div><div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>  <span class="keywordflow">if</span> (last_char_was_tilde &&</div><div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>  word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#a43b4c52165d4b7fd811eb653c2aa9d8e">space</a>() == 0 && wordstr[offset] == <span class="charliteral">' '</span>) {</div><div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>  <span class="comment">// Prevent adjacent tilde across words - we know that adjacent tildes</span></div><div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>  <span class="comment">// within words have been removed.</span></div><div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>  <span class="comment">// Skip the first character.</span></div><div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>  offset = lengths[i++];</div><div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>  }</div><div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>  <span class="keywordflow">if</span> (i < length && wordstr[offset] != 0) {</div><div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>  <span class="keywordflow">if</span> (!last_char_was_newline)</div><div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>  *ptr++ = <span class="charliteral">' '</span>;</div><div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>  last_char_was_newline = <span class="keyword">false</span>;</div><div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>  <span class="keywordflow">for</span> (; i < length; offset += lengths[i++]) {</div><div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>  <span class="keywordflow">if</span> (wordstr[offset] == <span class="charliteral">' '</span> ||</div><div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>  wordstr[offset] == <a class="code" href="a01629.html#a1083ed81b6adbb6930e87d0c58671e26">kTesseractReject</a>) {</div><div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>  *ptr++ = <a class="code" href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106">kUNLVReject</a>;</div><div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>  last_char_was_tilde = <span class="keyword">true</span>;</div><div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>[i].rejected())</div><div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>  *ptr++ = <a class="code" href="a01629.html#af7e73b761f145b66ffcc7585ed69d940">kUNLVSuspect</a>;</div><div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>  <a class="code" href="a03910.html">UNICHAR</a> ch(wordstr + offset, lengths[i]);</div><div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>  <span class="keywordtype">int</span> uni_ch = ch.<a class="code" href="a03910.html#a714633da3ef653acb2485c059e2472e1">first_uni</a>();</div><div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; <a class="code" href="a01629.html#afa62cc25480d6eee8b1bb2ef4a1f8fc3">kUniChs</a>[j] != 0; ++j) {</div><div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>  <span class="keywordflow">if</span> (<a class="code" href="a01629.html#afa62cc25480d6eee8b1bb2ef4a1f8fc3">kUniChs</a>[j] == uni_ch) {</div><div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>  uni_ch = <a class="code" href="a01629.html#a7e0c7c50e2e05e503a51b8c33d35ade6">kLatinChs</a>[j];</div><div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>  }</div><div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>  }</div><div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>  <span class="keywordflow">if</span> (uni_ch <= 0xff) {</div><div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>  *ptr++ = <span class="keyword">static_cast<</span><span class="keywordtype">char</span><span class="keyword">></span>(uni_ch);</div><div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>  last_char_was_tilde = <span class="keyword">false</span>;</div><div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>  *ptr++ = <a class="code" href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106">kUNLVReject</a>;</div><div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>  last_char_was_tilde = <span class="keyword">true</span>;</div><div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>  }</div><div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>  }</div><div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>  }</div><div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>  }</div><div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>  }</div><div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea62efb985a62d85e014ee5ab039dd50ce">W_EOL</a>) && !last_char_was_newline) {</div><div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>  <span class="comment">/* Add a new line output */</span></div><div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>  *ptr++ = <span class="charliteral">'\n'</span>;</div><div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>  tilde_crunch_written = <span class="keyword">false</span>;</div><div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>  last_char_was_newline = <span class="keyword">true</span>;</div><div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>  last_char_was_tilde = <span class="keyword">false</span>;</div><div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>  }</div><div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>  }</div><div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>  *ptr++ = <span class="charliteral">'\n'</span>;</div><div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>  *ptr = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l01997"></a><span class="lineno"> 1997</span> }</div><div class="line"><a name="l01998"></a><span class="lineno"> 1998</span> </div><div class="line"><a name="l01999"></a><span class="lineno"> 1999</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02000"></a><span class="lineno"> 2000</span> </div><div class="line"><a name="l02010"></a><span class="lineno"><a class="line" href="a01625.html#gaca4e9a0d9cf388510168d9b58864d1e5"> 2010</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#gaca4e9a0d9cf388510168d9b58864d1e5">TessBaseAPI::DetectOrientationScript</a>(<span class="keywordtype">int</span>* orient_deg, <span class="keywordtype">float</span>* orient_conf,</div><div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>** script_name,</div><div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>  <span class="keywordtype">float</span>* script_conf) {</div><div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>  <a class="code" href="a02266.html">OSResults</a> osr;</div><div class="line"><a name="l02014"></a><span class="lineno"> 2014</span> </div><div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>  <span class="keywordtype">bool</span> osd = <a class="code" href="a01625.html#ga5ed6e495e7f1c269588a8b85e4e19ca8">DetectOS</a>(&osr);</div><div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>  <span class="keywordflow">if</span> (!osd) {</div><div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>  }</div><div class="line"><a name="l02019"></a><span class="lineno"> 2019</span> </div><div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>  <span class="keywordtype">int</span> orient_id = osr.<a class="code" href="a02266.html#a25f64011ea65c038c1ef1a6cedd10f1c">best_result</a>.<a class="code" href="a02262.html#a6dfb6826b41a81524ce867b005ba5641">orientation_id</a>;</div><div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>  <span class="keywordtype">int</span> script_id = osr.<a class="code" href="a02266.html#ad92dc2530b0b907d6bbdafd50bc042e8">get_best_script</a>(orient_id);</div><div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>  <span class="keywordflow">if</span> (orient_conf) *orient_conf = osr.<a class="code" href="a02266.html#a25f64011ea65c038c1ef1a6cedd10f1c">best_result</a>.<a class="code" href="a02262.html#a67e009467e4db6c40777548ffdfe464e">oconfidence</a>;</div><div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>  <span class="keywordflow">if</span> (orient_deg) *orient_deg = orient_id * 90; <span class="comment">// convert quadrant to degrees</span></div><div class="line"><a name="l02024"></a><span class="lineno"> 2024</span> </div><div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>  <span class="keywordflow">if</span> (script_name) {</div><div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* script = osr.<a class="code" href="a02266.html#a78ebdae52f3c685095b56790598ad97c">unicharset</a>-><a class="code" href="a03950.html#a2c8e79b6fe0ac81f50d4f8d120278166">get_script_from_script_id</a>(script_id);</div><div class="line"><a name="l02027"></a><span class="lineno"> 2027</span> </div><div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>  *script_name = script;</div><div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>  }</div><div class="line"><a name="l02030"></a><span class="lineno"> 2030</span> </div><div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>  <span class="keywordflow">if</span> (script_conf) *script_conf = osr.<a class="code" href="a02266.html#a25f64011ea65c038c1ef1a6cedd10f1c">best_result</a>.<a class="code" href="a02262.html#ae39a2c718b010ed27eb7f820546da6d6">sconfidence</a>;</div><div class="line"><a name="l02032"></a><span class="lineno"> 2032</span> </div><div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l02034"></a><span class="lineno"> 2034</span> }</div><div class="line"><a name="l02035"></a><span class="lineno"> 2035</span> </div><div class="line"><a name="l02041"></a><span class="lineno"><a class="line" href="a01625.html#ga9357ba1744639613b65dc803d11b8a60"> 2041</a></span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga9357ba1744639613b65dc803d11b8a60">TessBaseAPI::GetOsdText</a>(<span class="keywordtype">int</span> page_number) {</div><div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>  <span class="keywordtype">int</span> orient_deg;</div><div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>  <span class="keywordtype">float</span> orient_conf;</div><div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* script_name;</div><div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>  <span class="keywordtype">float</span> script_conf;</div><div class="line"><a name="l02046"></a><span class="lineno"> 2046</span> </div><div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>  <span class="keywordflow">if</span> (!<a class="code" href="a01625.html#gaca4e9a0d9cf388510168d9b58864d1e5">DetectOrientationScript</a>(&orient_deg, &orient_conf, &script_name,</div><div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>  &script_conf))</div><div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02050"></a><span class="lineno"> 2050</span> </div><div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>  <span class="comment">// clockwise rotation needed to make the page upright</span></div><div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>  <span class="keywordtype">int</span> rotate = <a class="code" href="a00113.html#a2a5f7b79012274ece9289a2bb72979c7">OrientationIdToValue</a>(orient_deg / 90);</div><div class="line"><a name="l02053"></a><span class="lineno"> 2053</span> </div><div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> kOsdBufsize = 255;</div><div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>  <span class="keywordtype">char</span>* osd_buf = <span class="keyword">new</span> <span class="keywordtype">char</span>[kOsdBufsize];</div><div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>  snprintf(osd_buf, kOsdBufsize,</div><div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>  <span class="stringliteral">"Page number: %d\n"</span></div><div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>  <span class="stringliteral">"Orientation in degrees: %d\n"</span></div><div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>  <span class="stringliteral">"Rotate: %d\n"</span></div><div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>  <span class="stringliteral">"Orientation confidence: %.2f\n"</span></div><div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>  <span class="stringliteral">"Script: %s\n"</span></div><div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>  <span class="stringliteral">"Script confidence: %.2f\n"</span>,</div><div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>  page_number, orient_deg, rotate, orient_conf, script_name,</div><div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>  script_conf);</div><div class="line"><a name="l02065"></a><span class="lineno"> 2065</span> </div><div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>  <span class="keywordflow">return</span> osd_buf;</div><div class="line"><a name="l02067"></a><span class="lineno"> 2067</span> }</div><div class="line"><a name="l02068"></a><span class="lineno"> 2068</span> </div><div class="line"><a name="l02069"></a><span class="lineno"> 2069</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02070"></a><span class="lineno"> 2070</span> </div><div class="line"><a name="l02072"></a><span class="lineno"><a class="line" href="a01625.html#ga027054e6176889ff49a7108e174fce0f"> 2072</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#ga027054e6176889ff49a7108e174fce0f">TessBaseAPI::MeanTextConf</a>() {</div><div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>  <span class="keywordtype">int</span>* conf = <a class="code" href="a01625.html#ga4a67a12db21b3569b2b50ad05b9e146a">AllWordConfidences</a>();</div><div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>  <span class="keywordflow">if</span> (!conf) <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>  <span class="keywordtype">int</span> sum = 0;</div><div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>  <span class="keywordtype">int</span> *pt = conf;</div><div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>  <span class="keywordflow">while</span> (*pt >= 0) sum += *pt++;</div><div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>  <span class="keywordflow">if</span> (pt != conf) sum /= pt - conf;</div><div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>  <span class="keyword">delete</span> [] conf;</div><div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>  <span class="keywordflow">return</span> sum;</div><div class="line"><a name="l02081"></a><span class="lineno"> 2081</span> }</div><div class="line"><a name="l02082"></a><span class="lineno"> 2082</span> </div><div class="line"><a name="l02084"></a><span class="lineno"><a class="line" href="a01625.html#ga4a67a12db21b3569b2b50ad05b9e146a"> 2084</a></span> <span class="keywordtype">int</span>* <a class="code" href="a01625.html#ga4a67a12db21b3569b2b50ad05b9e146a">TessBaseAPI::AllWordConfidences</a>() {</div><div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>  (!<a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> && <a class="code" href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">Recognize</a>(<span class="keyword">nullptr</span>) < 0))</div><div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>  <span class="keywordtype">int</span> n_word = 0;</div><div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> res_it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>  <span class="keywordflow">for</span> (res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>(); res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>; res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>())</div><div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>  n_word++;</div><div class="line"><a name="l02092"></a><span class="lineno"> 2092</span> </div><div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>  <span class="keywordtype">int</span>* conf = <span class="keyword">new</span> <span class="keywordtype">int</span>[n_word+1];</div><div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>  n_word = 0;</div><div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>  <span class="keywordflow">for</span> (res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>(); res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>; res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>  <a class="code" href="a02542.html">WERD_RES</a> *word = res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>  <a class="code" href="a02606.html">WERD_CHOICE</a>* choice = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>;</div><div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>  <span class="keywordtype">int</span> w_conf = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(100 + 5 * choice-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>());</div><div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>  <span class="comment">// This is the eq for converting Tesseract confidence to 1..100</span></div><div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>  <span class="keywordflow">if</span> (w_conf < 0) w_conf = 0;</div><div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>  <span class="keywordflow">if</span> (w_conf > 100) w_conf = 100;</div><div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>  conf[n_word++] = w_conf;</div><div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>  }</div><div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>  conf[n_word] = -1;</div><div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>  <span class="keywordflow">return</span> conf;</div><div class="line"><a name="l02106"></a><span class="lineno"> 2106</span> }</div><div class="line"><a name="l02107"></a><span class="lineno"> 2107</span> </div><div class="line"><a name="l02108"></a><span class="lineno"> 2108</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02109"></a><span class="lineno"> 2109</span> </div><div class="line"><a name="l02119"></a><span class="lineno"><a class="line" href="a01625.html#gab8c2ee5d614382f0d25deb9a7adfe199"> 2119</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#gab8c2ee5d614382f0d25deb9a7adfe199">TessBaseAPI::AdaptToWordStr</a>(<a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> mode, <span class="keyword">const</span> <span class="keywordtype">char</span>* wordstr) {</div><div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>  <span class="keywordtype">int</span> debug = 0;</div><div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>  <a class="code" href="a02186.html#a25d71dd25faea83cc91db902f2997297">GetIntVariable</a>(<span class="stringliteral">"applybox_debug"</span>, &debug);</div><div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>  <span class="keywordtype">bool</span> success = <span class="keyword">true</span>;</div><div class="line"><a name="l02123"></a><span class="lineno"> 2123</span>  <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> current_psm = <a class="code" href="a02186.html#a61c5592b57a1b776416e643e2719a751">GetPageSegMode</a>();</div><div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>  <a class="code" href="a02186.html#a15a7a9c1afbba3078a55b4566de891ab">SetPageSegMode</a>(mode);</div><div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>  <a class="code" href="a02186.html#a2e09259c558c6d8e0f7e523cbaf5adf5">SetVariable</a>(<span class="stringliteral">"classify_enable_learning"</span>, <span class="stringliteral">"0"</span>);</div><div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>  <span class="keyword">const</span> std::unique_ptr<const char[]> text(<a class="code" href="a01625.html#ga115ef656f83352ba608b4f0bf9cfa2c4">GetUTF8Text</a>());</div><div class="line"><a name="l02127"></a><span class="lineno"> 2127</span>  <span class="keywordflow">if</span> (debug) {</div><div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Trying to adapt \"%s\" to \"%s\"\n"</span>, text.get(), wordstr);</div><div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>  }</div><div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>  <span class="keywordflow">if</span> (text != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res = it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>  <span class="keywordflow">if</span> (word_res != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>  word_res-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#a5decd0b33533bf908c26ad4b10336fb0">set_text</a>(wordstr);</div><div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>  <span class="comment">// Check to see if text matches wordstr.</span></div><div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>  <span class="keywordtype">int</span> w = 0;</div><div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>  <span class="keywordtype">int</span> t;</div><div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>  <span class="keywordflow">for</span> (t = 0; text[t] != <span class="charliteral">'\0'</span>; ++t) {</div><div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>  <span class="keywordflow">if</span> (text[t] == <span class="charliteral">'\n'</span> || text[t] == <span class="charliteral">' '</span>)</div><div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>  <span class="keywordflow">while</span> (wordstr[w] == <span class="charliteral">' '</span>) ++w;</div><div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>  <span class="keywordflow">if</span> (text[t] != wordstr[w])</div><div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>  ++w;</div><div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>  }</div><div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>  <span class="keywordflow">if</span> (text[t] != <span class="charliteral">'\0'</span> || wordstr[w] != <span class="charliteral">'\0'</span>) {</div><div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>  <span class="comment">// No match.</span></div><div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>;</div><div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>  <a class="code" href="a02182.html">GenericVector<TBOX></a> boxes;</div><div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#adee618f35a90de376370cb6f7930bc84">SetupApplyBoxes</a>(boxes, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>);</div><div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a6193fb469b62b12c1b999194fc5cd569">ReSegmentByClassification</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a420654e409a9d28fd133515b5f3ed2c3">TidyUp</a>(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> pr_it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>  <span class="keywordflow">if</span> (pr_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>  success = <span class="keyword">false</span>;</div><div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l02157"></a><span class="lineno"> 2157</span>  word_res = pr_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02158"></a><span class="lineno"> 2158</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02159"></a><span class="lineno"> 2159</span>  word_res-><a class="code" href="a02542.html#a8d4f5c6ed2c60b756a5c63e091cd331c">BestChoiceToCorrectText</a>();</div><div class="line"><a name="l02160"></a><span class="lineno"> 2160</span>  }</div><div class="line"><a name="l02161"></a><span class="lineno"> 2161</span>  <span class="keywordflow">if</span> (success) {</div><div class="line"><a name="l02162"></a><span class="lineno"> 2162</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a7d0ccfd06421346d8cda0f1b76fd8516">EnableLearning</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l02163"></a><span class="lineno"> 2163</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a2fc1971dc1e42946245c98a9312326ae">LearnWord</a>(<span class="keyword">nullptr</span>, word_res);</div><div class="line"><a name="l02164"></a><span class="lineno"> 2164</span>  }</div><div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>  success = <span class="keyword">false</span>;</div><div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>  }</div><div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>  success = <span class="keyword">false</span>;</div><div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>  }</div><div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>  <a class="code" href="a02186.html#a15a7a9c1afbba3078a55b4566de891ab">SetPageSegMode</a>(current_psm);</div><div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>  <span class="keywordflow">return</span> success;</div><div class="line"><a name="l02173"></a><span class="lineno"> 2173</span> }</div><div class="line"><a name="l02174"></a><span class="lineno"> 2174</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02175"></a><span class="lineno"> 2175</span> </div><div class="line"><a name="l02182"></a><span class="lineno"><a class="line" href="a01625.html#ga953b401286da174e609f09c5f275734e"> 2182</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga953b401286da174e609f09c5f275734e">TessBaseAPI::Clear</a>() {</div><div class="line"><a name="l02183"></a><span class="lineno"> 2183</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02184"></a><span class="lineno"> 2184</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#afe5b51a09de405a0fc04b1d72c3c908d">Clear</a>();</div><div class="line"><a name="l02185"></a><span class="lineno"> 2185</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l02186"></a><span class="lineno"> 2186</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) <a class="code" href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63">SetInputImage</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l02187"></a><span class="lineno"> 2187</span> }</div><div class="line"><a name="l02188"></a><span class="lineno"> 2188</span> </div><div class="line"><a name="l02195"></a><span class="lineno"><a class="line" href="a01625.html#ga38027513ee9c0348de1790bddcdc3391"> 2195</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga38027513ee9c0348de1790bddcdc3391">TessBaseAPI::End</a>() {</div><div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>  <a class="code" href="a01625.html#ga953b401286da174e609f09c5f275734e">Clear</a>();</div><div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>;</div><div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>;</div><div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>;</div><div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>  <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>  <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a>-><a class="code" href="a02182.html#a98f62dccd75224a60437c2761bd215cd">delete_data_pointers</a>();</div><div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a>;</div><div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>  <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>  }</div><div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> == <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>) <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>;</div><div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>;</div><div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>  <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a>;</div><div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>  <a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>;</div><div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>  <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02217"></a><span class="lineno"> 2217</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a>;</div><div class="line"><a name="l02218"></a><span class="lineno"> 2218</span>  <a class="code" href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">output_file_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02219"></a><span class="lineno"> 2219</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a>;</div><div class="line"><a name="l02220"></a><span class="lineno"> 2220</span>  <a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02221"></a><span class="lineno"> 2221</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a>;</div><div class="line"><a name="l02222"></a><span class="lineno"> 2222</span>  <a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02223"></a><span class="lineno"> 2223</span> }</div><div class="line"><a name="l02224"></a><span class="lineno"> 2224</span> </div><div class="line"><a name="l02225"></a><span class="lineno"> 2225</span> <span class="comment">// Clear any library-level memory caches.</span></div><div class="line"><a name="l02226"></a><span class="lineno"> 2226</span> <span class="comment">// There are a variety of expensive-to-load constant data structures (mostly</span></div><div class="line"><a name="l02227"></a><span class="lineno"> 2227</span> <span class="comment">// language dictionaries) that are cached globally -- surviving the Init()</span></div><div class="line"><a name="l02228"></a><span class="lineno"> 2228</span> <span class="comment">// and End() of individual TessBaseAPI's. This function allows the clearing</span></div><div class="line"><a name="l02229"></a><span class="lineno"> 2229</span> <span class="comment">// of these caches.</span></div><div class="line"><a name="l02230"></a><span class="lineno"><a class="line" href="a01625.html#ga7525d25bfca88c93ed7ffda4a6a86bef"> 2230</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga7525d25bfca88c93ed7ffda4a6a86bef">TessBaseAPI::ClearPersistentCache</a>() {</div><div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>  <a class="code" href="a04290.html#a21e49c729a6736b418f49014ac25b596">Dict::GlobalDawgCache</a>()-><a class="code" href="a04278.html#a2754644a4f3ae4937961dd5ea915637f">DeleteUnusedDawgs</a>();</div><div class="line"><a name="l02232"></a><span class="lineno"> 2232</span> }</div><div class="line"><a name="l02233"></a><span class="lineno"> 2233</span> </div><div class="line"><a name="l02238"></a><span class="lineno"><a class="line" href="a01625.html#ga2c06caf08c9a8aa97a08a2de2f6200df"> 2238</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#ga2c06caf08c9a8aa97a08a2de2f6200df">TessBaseAPI::IsValidWord</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *word) {</div><div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a76420e183f59bb67851892dadb548c07">valid_word</a>(word);</div><div class="line"><a name="l02240"></a><span class="lineno"> 2240</span> }</div><div class="line"><a name="l02241"></a><span class="lineno"> 2241</span> <span class="comment">// Returns true if utf8_character is defined in the UniCharset.</span></div><div class="line"><a name="l02242"></a><span class="lineno"><a class="line" href="a01625.html#ga045996c07e93669ff274cfab922eb39b"> 2242</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga045996c07e93669ff274cfab922eb39b">TessBaseAPI::IsValidCharacter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *utf8_character) {</div><div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a7b52b091edd0c1f5e17539f0d6af0e88">contains_unichar</a>(utf8_character);</div><div class="line"><a name="l02244"></a><span class="lineno"> 2244</span> }</div><div class="line"><a name="l02245"></a><span class="lineno"> 2245</span> </div><div class="line"><a name="l02246"></a><span class="lineno"> 2246</span> </div><div class="line"><a name="l02247"></a><span class="lineno"> 2247</span> <span class="comment">// TODO(rays) Obsolete this function and replace with a more aptly named</span></div><div class="line"><a name="l02248"></a><span class="lineno"> 2248</span> <span class="comment">// function that returns image coordinates rather than tesseract coordinates.</span></div><div class="line"><a name="l02249"></a><span class="lineno"><a class="line" href="a01625.html#ga535728aa13f5f5eb66cbece59a7737e5"> 2249</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga535728aa13f5f5eb66cbece59a7737e5">TessBaseAPI::GetTextDirection</a>(<span class="keywordtype">int</span>* out_offset, <span class="keywordtype">float</span>* out_slope) {</div><div class="line"><a name="l02250"></a><span class="lineno"> 2250</span>  <a class="code" href="a02278.html">PageIterator</a>* it = <a class="code" href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">AnalyseLayout</a>();</div><div class="line"><a name="l02251"></a><span class="lineno"> 2251</span>  <span class="keywordflow">if</span> (it == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02252"></a><span class="lineno"> 2252</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02253"></a><span class="lineno"> 2253</span>  }</div><div class="line"><a name="l02254"></a><span class="lineno"> 2254</span>  <span class="keywordtype">int</span> x1, x2, y1, y2;</div><div class="line"><a name="l02255"></a><span class="lineno"> 2255</span>  it-><a class="code" href="a02278.html#a85aeba464464350c89299216bf749f34">Baseline</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, &x1, &y1, &x2, &y2);</div><div class="line"><a name="l02256"></a><span class="lineno"> 2256</span>  <span class="comment">// Calculate offset and slope (NOTE: Kind of ugly)</span></div><div class="line"><a name="l02257"></a><span class="lineno"> 2257</span>  <span class="keywordflow">if</span> (x2 <= x1) x2 = x1 + 1;</div><div class="line"><a name="l02258"></a><span class="lineno"> 2258</span>  <span class="comment">// Convert the point pair to slope/offset of the baseline (in image coords.)</span></div><div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>  *out_slope = <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(y2 - y1) / (x2 - x1);</div><div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>  *out_offset = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(y1 - *out_slope * x1);</div><div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>  <span class="comment">// Get the y-coord of the baseline at the left and right edges of the</span></div><div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>  <span class="comment">// textline's bounding box.</span></div><div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>  <span class="keywordtype">int</span> left, top, right, bottom;</div><div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>  <span class="keywordflow">if</span> (!it-><a class="code" href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">BoundingBox</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">RIL_TEXTLINE</a>, &left, &top, &right, &bottom)) {</div><div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>  }</div><div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>  <span class="keywordtype">int</span> left_y = <a class="code" href="a00527.html#ab60e4f82956a1f5fdb54d0d8303e95b7">IntCastRounded</a>(*out_slope * left + *out_offset);</div><div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>  <span class="keywordtype">int</span> right_y = <a class="code" href="a00527.html#ab60e4f82956a1f5fdb54d0d8303e95b7">IntCastRounded</a>(*out_slope * right + *out_offset);</div><div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>  <span class="comment">// Shift the baseline down so it passes through the nearest bottom-corner</span></div><div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>  <span class="comment">// of the textline's bounding box. This is the difference between the y</span></div><div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>  <span class="comment">// at the lowest (max) edge of the box and the actual box bottom.</span></div><div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>  *out_offset += bottom - std::max(left_y, right_y);</div><div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>  <span class="comment">// Switch back to bottom-up tesseract coordinates. Requires negation of</span></div><div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>  <span class="comment">// the slope and height - offset for the offset.</span></div><div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>  *out_slope = -*out_slope;</div><div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>  *out_offset = <a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a> - *out_offset;</div><div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l02279"></a><span class="lineno"> 2279</span> </div><div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l02281"></a><span class="lineno"> 2281</span> }</div><div class="line"><a name="l02282"></a><span class="lineno"> 2282</span> </div><div class="line"><a name="l02284"></a><span class="lineno"><a class="line" href="a01625.html#ga7a7b2870798363811c011cec2bfbf22c"> 2284</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga7a7b2870798363811c011cec2bfbf22c">TessBaseAPI::SetDictFunc</a>(<a class="code" href="a01629.html#a75942705a59f93c72298f0c0444f9325">DictFunc</a> f) {</div><div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a30bca2131edadf5771122574c2fab30d">letter_is_okay_</a> = f;</div><div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>  }</div><div class="line"><a name="l02288"></a><span class="lineno"> 2288</span> }</div><div class="line"><a name="l02289"></a><span class="lineno"> 2289</span> </div><div class="line"><a name="l02298"></a><span class="lineno"><a class="line" href="a01625.html#gad7a52133fe0ebab22e97166c5e5cab67"> 2298</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#gad7a52133fe0ebab22e97166c5e5cab67">TessBaseAPI::SetProbabilityInContextFunc</a>(<a class="code" href="a01629.html#ad7ebf88af7dcdd155deb8655ba5991ff">ProbabilityInContextFunc</a> f) {</div><div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#ab24a33b89082414b75df5caa86bf6da8">probability_in_context_</a> = f;</div><div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>  <span class="comment">// Set it for the sublangs too.</span></div><div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>  <span class="keywordtype">int</span> num_subs = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a3af5306b9473bede1537854e54fa796d">num_sub_langs</a>();</div><div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < num_subs; ++i) {</div><div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#af0786d38a5addce72e377b9479170522">get_sub_lang</a>(i)-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#ab24a33b89082414b75df5caa86bf6da8">probability_in_context_</a> = f;</div><div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>  }</div><div class="line"><a name="l02306"></a><span class="lineno"> 2306</span>  }</div><div class="line"><a name="l02307"></a><span class="lineno"> 2307</span> }</div><div class="line"><a name="l02308"></a><span class="lineno"> 2308</span> </div><div class="line"><a name="l02309"></a><span class="lineno"> 2309</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02310"></a><span class="lineno"> 2310</span> </div><div class="line"><a name="l02311"></a><span class="lineno"><a class="line" href="a01625.html#ga36a739bd0dc23a819170ca40f35c4b58"> 2311</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga36a739bd0dc23a819170ca40f35c4b58">TessBaseAPI::SetFillLatticeFunc</a>(<a class="code" href="a01629.html#a0c8529ffdf3ba5c8d219e377c13b1288">FillLatticeFunc</a> f) {</div><div class="line"><a name="l02312"></a><span class="lineno"> 2312</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a0382a424e4d9afd8deb57a0a5d288868">fill_lattice_</a> = f;</div><div class="line"><a name="l02313"></a><span class="lineno"> 2313</span> }</div><div class="line"><a name="l02314"></a><span class="lineno"> 2314</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02315"></a><span class="lineno"> 2315</span> </div><div class="line"><a name="l02317"></a><span class="lineno"><a class="line" href="a02186.html#a17820a43c31b66c3a12eda59e0b51bba"> 2317</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#a17820a43c31b66c3a12eda59e0b51bba">TessBaseAPI::InternalSetImage</a>() {</div><div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Please call Init before attempting to set an image.\n"</span>);</div><div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>  }</div><div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> = <span class="keyword">new</span> <a class="code" href="a02362.html">ImageThresholder</a>;</div><div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l02326"></a><span class="lineno"> 2326</span> }</div><div class="line"><a name="l02327"></a><span class="lineno"> 2327</span> </div><div class="line"><a name="l02334"></a><span class="lineno"><a class="line" href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe"> 2334</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe">TessBaseAPI::Threshold</a>(Pix** pix) {</div><div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(pix != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>  <span class="keywordflow">if</span> (*pix != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>  pixDestroy(pix);</div><div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>  <span class="comment">// Zero resolution messes up the algorithms, so make sure it is credible.</span></div><div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>  <span class="keywordtype">int</span> user_dpi = 0;</div><div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>  <span class="keywordtype">bool</span> a = <a class="code" href="a02186.html#a25d71dd25faea83cc91db902f2997297">GetIntVariable</a>(<span class="stringliteral">"user_defined_dpi"</span>, &user_dpi);</div><div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>  <span class="keywordtype">int</span> y_res = <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">GetScaledYResolution</a>();</div><div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>  <span class="keywordflow">if</span> (user_dpi && (user_dpi < <a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a> ||</div><div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>  user_dpi > <a class="code" href="a00380.html#ab234efeaafa7336d56a5652a1891266e">kMaxCredibleResolution</a>)) {</div><div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Warning: User defined image dpi is outside of expected range "</span></div><div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>  <span class="stringliteral">"(%d - %d)!\n"</span>,</div><div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>  <a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a>, <a class="code" href="a00380.html#ab234efeaafa7336d56a5652a1891266e">kMaxCredibleResolution</a>);</div><div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>  }</div><div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>  <span class="comment">// Always use user defined dpi</span></div><div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>  <span class="keywordflow">if</span> (user_dpi) {</div><div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#af96fa2b6f4d1271640d5c8842f4fa9d6">SetSourceYResolution</a>(user_dpi);</div><div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (y_res < <a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a> ||</div><div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>  y_res > <a class="code" href="a00380.html#ab234efeaafa7336d56a5652a1891266e">kMaxCredibleResolution</a>) {</div><div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Warning: Invalid resolution %d dpi. Using %d instead.\n"</span>,</div><div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>  y_res, <a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a>);</div><div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#af96fa2b6f4d1271640d5c8842f4fa9d6">SetSourceYResolution</a>(<a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a>);</div><div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>  }</div><div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>  <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> pageseg_mode =</div><div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>  <span class="keyword">static_cast<</span><a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a><span class="keyword">></span>(</div><div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>  <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a>));</div><div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a348726ab5c2807eaad1bff0b2d951997">ThresholdToPix</a>(pageseg_mode, pix)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a4e7f450e7c88d85a3e8dd8fa2baa3776">GetImageSizes</a>(&<a class="code" href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">rect_left_</a>, &<a class="code" href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">rect_top_</a>,</div><div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>  &<a class="code" href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">rect_width_</a>, &<a class="code" href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">rect_height_</a>,</div><div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>  &<a class="code" href="a01627.html#gaf3238cd7ff2c0995e647c8c7846bdba3">image_width_</a>, &<a class="code" href="a01627.html#gab7d24a78f3565c5bfb42b2592b9e8df0">image_height_</a>);</div><div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#af2a1a0395542b9ccec4ed6da3a928416">IsBinary</a>()) {</div><div class="line"><a name="l02365"></a><span class="lineno"> 2365</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a94e454dba7e8fb5199f8150335299b8c">set_pix_thresholds</a>(<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a9750e2906caad2b016eea362b22fcbe1">GetPixRectThresholds</a>());</div><div class="line"><a name="l02366"></a><span class="lineno"> 2366</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a2c7fb16774479af5df8e8102aaa86ca1">set_pix_grey</a>(<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a0a01ac88f9d1193ebb80c96a09a9b01f">GetPixRectGrey</a>());</div><div class="line"><a name="l02367"></a><span class="lineno"> 2367</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02368"></a><span class="lineno"> 2368</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a94e454dba7e8fb5199f8150335299b8c">set_pix_thresholds</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l02369"></a><span class="lineno"> 2369</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a2c7fb16774479af5df8e8102aaa86ca1">set_pix_grey</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l02370"></a><span class="lineno"> 2370</span>  }</div><div class="line"><a name="l02371"></a><span class="lineno"> 2371</span>  <span class="comment">// Set the internal resolution that is used for layout parameters from the</span></div><div class="line"><a name="l02372"></a><span class="lineno"> 2372</span>  <span class="comment">// estimated resolution, rather than the image resolution, which may be</span></div><div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>  <span class="comment">// fabricated, but we will use the image resolution, if there is one, to</span></div><div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>  <span class="comment">// report output point sizes.</span></div><div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>  <span class="keywordtype">int</span> estimated_res = <a class="code" href="a00527.html#af8739168d5b3235996eeb25dac3c4044">ClipToRange</a>(<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a02256722855a56bb2ee79238df990b3b">GetScaledEstimatedResolution</a>(),</div><div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>  <a class="code" href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a>,</div><div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>  <a class="code" href="a00380.html#ab234efeaafa7336d56a5652a1891266e">kMaxCredibleResolution</a>);</div><div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>  <span class="keywordflow">if</span> (estimated_res != <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a02256722855a56bb2ee79238df990b3b">GetScaledEstimatedResolution</a>()) {</div><div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Estimated internal resolution %d out of range! "</span></div><div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>  <span class="stringliteral">"Corrected to %d.\n"</span>,</div><div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a02256722855a56bb2ee79238df990b3b">GetScaledEstimatedResolution</a>(), estimated_res);</div><div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>  }</div><div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aa9ae12f56af64186b021aea99cb6bd52">set_source_resolution</a>(estimated_res);</div><div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>  <a class="code" href="a00521.html#a372e5d26e8b39261140556e2b7e479d8">SavePixForCrash</a>(estimated_res, *pix);</div><div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l02386"></a><span class="lineno"> 2386</span> }</div><div class="line"><a name="l02387"></a><span class="lineno"> 2387</span> </div><div class="line"><a name="l02389"></a><span class="lineno"><a class="line" href="a02186.html#a86899716a1adde396be4efd57b547d27"> 2389</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">TessBaseAPI::FindLines</a>() {</div><div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a5e18e1384335b76f63ba3508ae048925">IsEmpty</a>()) {</div><div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Please call SetImage before attempting recognition.\n"</span>);</div><div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l02393"></a><span class="lineno"> 2393</span>  }</div><div class="line"><a name="l02394"></a><span class="lineno"> 2394</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a>)</div><div class="line"><a name="l02395"></a><span class="lineno"> 2395</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l02396"></a><span class="lineno"> 2396</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>->empty()) {</div><div class="line"><a name="l02397"></a><span class="lineno"> 2397</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02398"></a><span class="lineno"> 2398</span>  }</div><div class="line"><a name="l02399"></a><span class="lineno"> 2399</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02400"></a><span class="lineno"> 2400</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l02401"></a><span class="lineno"> 2401</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02402"></a><span class="lineno"> 2402</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#acf0658a5a3cf8ebc7d29f2b9213a8884">InitAdaptiveClassifier</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l02403"></a><span class="lineno"> 2403</span> <span class="preprocessor"> #endif</span></div><div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>  }</div><div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">pix_binary</a>() == <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>  !<a class="code" href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe">Threshold</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a512809e371c7bff1a24bb531721010a3">mutable_pix_binary</a>())) {</div><div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>  }</div><div class="line"><a name="l02409"></a><span class="lineno"> 2409</span> </div><div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ac91217d377d153e34cf89961cd9b0b2f">PrepareForPageseg</a>();</div><div class="line"><a name="l02411"></a><span class="lineno"> 2411</span> </div><div class="line"><a name="l02412"></a><span class="lineno"> 2412</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#aeec853f13be0d94e02e0f9dfad90e9bf">textord_equation_detect</a>) {</div><div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a> == <span class="keyword">nullptr</span> && <a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>  <a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a> = <span class="keyword">new</span> <a class="code" href="a02246.html">EquationDetect</a>(<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="keyword">nullptr</span>);</div><div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>  }</div><div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Warning: Could not set equation detector\n"</span>);</div><div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a0fd6abd523392fabfa8ec77c4a6bd550">SetEquationDetect</a>(<a class="code" href="a02186.html#a0222d0f645909860d13f71c078008133">equ_detect_</a>);</div><div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>  }</div><div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>  }</div><div class="line"><a name="l02423"></a><span class="lineno"> 2423</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02424"></a><span class="lineno"> 2424</span> </div><div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>  <a class="code" href="a02358.html">Tesseract</a>* osd_tess = <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>;</div><div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>  <a class="code" href="a02266.html">OSResults</a> osr;</div><div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>  <span class="keywordflow">if</span> (<a class="code" href="a01629.html#a30bf30e24d408ea5baf9bbc83f9930e2">PSM_OSD_ENABLED</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a>) &&</div><div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>  osd_tess == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>  <span class="keywordflow">if</span> (strcmp(<a class="code" href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">language_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="stringliteral">"osd"</span>) == 0) {</div><div class="line"><a name="l02430"></a><span class="lineno"> 2430</span>  osd_tess = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>;</div><div class="line"><a name="l02431"></a><span class="lineno"> 2431</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02432"></a><span class="lineno"> 2432</span>  <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> = <span class="keyword">new</span> <a class="code" href="a02358.html">Tesseract</a>;</div><div class="line"><a name="l02433"></a><span class="lineno"> 2433</span>  <a class="code" href="a03906.html">TessdataManager</a> mgr(<a class="code" href="a02186.html#a83549f01f06c140e14dad3f8c025d885">reader_</a>);</div><div class="line"><a name="l02434"></a><span class="lineno"> 2434</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02435"></a><span class="lineno"> 2435</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Warning: Auto orientation and script detection requested,"</span></div><div class="line"><a name="l02436"></a><span class="lineno"> 2436</span>  <span class="stringliteral">" but data path is undefined\n"</span>);</div><div class="line"><a name="l02437"></a><span class="lineno"> 2437</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>;</div><div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>  <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>-><a class="code" href="a02358.html#a1267fb55994276b60fa5f5a34f508135">init_tesseract</a>(<a class="code" href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">datapath_</a>-><a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="keyword">nullptr</span>,</div><div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>  <span class="stringliteral">"osd"</span>, <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aeaea8028f61e76a0f4def7cbe7905206cf">OEM_TESSERACT_ONLY</a>,</div><div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>  <span class="keyword">nullptr</span>, 0, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>  <span class="keyword">false</span>, &mgr) == 0) {</div><div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>  osd_tess = <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>;</div><div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>  <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>-><a class="code" href="a02358.html#aa9ae12f56af64186b021aea99cb6bd52">set_source_resolution</a>(</div><div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>  <a class="code" href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">thresholder_</a>-><a class="code" href="a02362.html#a39bd6e786e42ec230090189c9deb3657">GetSourceYResolution</a>());</div><div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Warning: Auto orientation and script detection requested,"</span></div><div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>  <span class="stringliteral">" but osd language failed to load\n"</span>);</div><div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a>;</div><div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>  <a class="code" href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">osd_tesseract_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>  }</div><div class="line"><a name="l02452"></a><span class="lineno"> 2452</span>  }</div><div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>  }</div><div class="line"><a name="l02454"></a><span class="lineno"> 2454</span> </div><div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a2f72a5b81529df216d9422ff92ab2762">SegmentPage</a>(<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>, osd_tess, &osr) < 0)</div><div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l02457"></a><span class="lineno"> 2457</span> </div><div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>  <span class="comment">// If Devanagari is being recognized, we use different images for page seg</span></div><div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>  <span class="comment">// and for OCR.</span></div><div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a8c193bd6f78f20373ed9b0fb63984733">PrepareForTessOCR</a>(<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>, osd_tess, &osr);</div><div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02462"></a><span class="lineno"> 2462</span> }</div><div class="line"><a name="l02463"></a><span class="lineno"> 2463</span> </div><div class="line"><a name="l02465"></a><span class="lineno"><a class="line" href="a02186.html#a83ca325b5e521416b1edcd020b169be0"> 2465</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">TessBaseAPI::ClearResults</a>() {</div><div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a55a27935c2314529c6fb4522ccf1de5a">Clear</a>();</div><div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>  }</div><div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>;</div><div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>  <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>  <a class="code" href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">recognition_done_</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>  <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a> = <span class="keyword">new</span> BLOCK_LIST;</div><div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>  <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>->clear();</div><div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>  <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a>-><a class="code" href="a02182.html#a98f62dccd75224a60437c2761bd215cd">delete_data_pointers</a>();</div><div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>  <span class="keyword">delete</span> <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a>;</div><div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>  <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>  }</div><div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>  <a class="code" href="a00521.html#a372e5d26e8b39261140556e2b7e479d8">SavePixForCrash</a>(0, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l02482"></a><span class="lineno"> 2482</span> }</div><div class="line"><a name="l02483"></a><span class="lineno"> 2483</span> </div><div class="line"><a name="l02491"></a><span class="lineno"><a class="line" href="a02186.html#aed3d481fc0c7dffad24572bd1f449598"> 2491</a></span> <span class="keywordtype">int</span> <a class="code" href="a02186.html#aed3d481fc0c7dffad24572bd1f449598">TessBaseAPI::TextLength</a>(<span class="keywordtype">int</span>* blob_count) {</div><div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || <a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l02494"></a><span class="lineno"> 2494</span> </div><div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(<a class="code" href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">page_res_</a>);</div><div class="line"><a name="l02496"></a><span class="lineno"> 2496</span>  <span class="keywordtype">int</span> total_length = 2;</div><div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>  <span class="keywordtype">int</span> total_blobs = 0;</div><div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>  <span class="comment">// Iterate over the data structures to extract the recognition result.</span></div><div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>  <span class="keywordflow">for</span> (page_res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>(); page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a> () != <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>  <a class="code" href="a02542.html">WERD_RES</a> *word = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>  <a class="code" href="a02606.html">WERD_CHOICE</a>* choice = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>;</div><div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>  <span class="keywordflow">if</span> (choice != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>  total_blobs += choice-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>() + 2;</div><div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>  total_length += choice-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>().<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() + 2;</div><div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#adb462d55dc4b682e0a77090185a58011">length</a>(); ++i) {</div><div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>[i].rejected())</div><div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>  ++total_length;</div><div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>  }</div><div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>  }</div><div class="line"><a name="l02511"></a><span class="lineno"> 2511</span>  }</div><div class="line"><a name="l02512"></a><span class="lineno"> 2512</span>  <span class="keywordflow">if</span> (blob_count != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02513"></a><span class="lineno"> 2513</span>  *blob_count = total_blobs;</div><div class="line"><a name="l02514"></a><span class="lineno"> 2514</span>  <span class="keywordflow">return</span> total_length;</div><div class="line"><a name="l02515"></a><span class="lineno"> 2515</span> }</div><div class="line"><a name="l02516"></a><span class="lineno"> 2516</span> </div><div class="line"><a name="l02517"></a><span class="lineno"> 2517</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02518"></a><span class="lineno"> 2518</span> </div><div class="line"><a name="l02522"></a><span class="lineno"><a class="line" href="a01625.html#ga5ed6e495e7f1c269588a8b85e4e19ca8"> 2522</a></span> <span class="keywordtype">bool</span> <a class="code" href="a01625.html#ga5ed6e495e7f1c269588a8b85e4e19ca8">TessBaseAPI::DetectOS</a>(<a class="code" href="a02266.html">OSResults</a>* osr) {</div><div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>  <a class="code" href="a02186.html#a83ca325b5e521416b1edcd020b169be0">ClearResults</a>();</div><div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">pix_binary</a>() == <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>  !<a class="code" href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe">Threshold</a>(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a512809e371c7bff1a24bb531721010a3">mutable_pix_binary</a>())) {</div><div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>  }</div><div class="line"><a name="l02530"></a><span class="lineno"> 2530</span> </div><div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>  <a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a> = <span class="keyword">new</span> <a class="code" href="a02834.html">STRING</a>(<a class="code" href="a01629.html#a3ba7b8d4b2132f72118c62fba346ffd0">kInputFile</a>);</div><div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>  <span class="keywordflow">return</span> <a class="code" href="a00113.html#aec0e2284de8927ea9f29b61ff30d052a">orientation_and_script_detection</a>(*<a class="code" href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">input_file_</a>, osr, <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>) > 0;</div><div class="line"><a name="l02534"></a><span class="lineno"> 2534</span> }</div><div class="line"><a name="l02535"></a><span class="lineno"> 2535</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02536"></a><span class="lineno"> 2536</span> </div><div class="line"><a name="l02537"></a><span class="lineno"><a class="line" href="a01625.html#gac4a301ee35d57b0a7572d4434cae284c"> 2537</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#gac4a301ee35d57b0a7572d4434cae284c">TessBaseAPI::set_min_orientation_margin</a>(<span class="keywordtype">double</span> margin) {</div><div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a08c494cab700c493b52a3417b16e9afa">min_orientation_margin</a>.set_value(margin);</div><div class="line"><a name="l02539"></a><span class="lineno"> 2539</span> }</div><div class="line"><a name="l02540"></a><span class="lineno"> 2540</span> </div><div class="line"><a name="l02555"></a><span class="lineno"><a class="line" href="a01625.html#ga16c4b28cadc2160bf18b84c3f897a2d2"> 2555</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga16c4b28cadc2160bf18b84c3f897a2d2">TessBaseAPI::GetBlockTextOrientations</a>(<span class="keywordtype">int</span>** block_orientation,</div><div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>  <span class="keywordtype">bool</span>** vertical_writing) {</div><div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>  <span class="keyword">delete</span>[] *block_orientation;</div><div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>  *block_orientation = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>  <span class="keyword">delete</span>[] *vertical_writing;</div><div class="line"><a name="l02560"></a><span class="lineno"> 2560</span>  *vertical_writing = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>  BLOCK_IT block_it(<a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>);</div><div class="line"><a name="l02562"></a><span class="lineno"> 2562</span> </div><div class="line"><a name="l02563"></a><span class="lineno"> 2563</span>  block_it.move_to_first();</div><div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>  <span class="keywordtype">int</span> num_blocks = 0;</div><div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>  <span class="keywordflow">for</span> (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {</div><div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>  <span class="keywordflow">if</span> (!block_it.data()->pdblk.poly_block()->IsText()) {</div><div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02568"></a><span class="lineno"> 2568</span>  }</div><div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>  ++num_blocks;</div><div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>  }</div><div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>  <span class="keywordflow">if</span> (!num_blocks) {</div><div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"WARNING: Found no blocks\n"</span>);</div><div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>  }</div><div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>  *block_orientation = <span class="keyword">new</span> <span class="keywordtype">int</span>[num_blocks];</div><div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>  *vertical_writing = <span class="keyword">new</span> <span class="keywordtype">bool</span>[num_blocks];</div><div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>  block_it.move_to_first();</div><div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>  <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>  <span class="keywordflow">for</span> (block_it.mark_cycle_pt(); !block_it.cycled_list();</div><div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>  block_it.forward()) {</div><div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>  <span class="keywordflow">if</span> (!block_it.data()->pdblk.poly_block()->IsText()) {</div><div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>  }</div><div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>  <a class="code" href="a02578.html">FCOORD</a> re_rotation = block_it.data()->re_rotation();</div><div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>  <span class="keywordtype">float</span> re_theta = re_rotation.<a class="code" href="a02578.html#aab5b14bc328998adc252ffe7476d7f22">angle</a>();</div><div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>  <a class="code" href="a02578.html">FCOORD</a> classify_rotation = block_it.data()->classify_rotation();</div><div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>  <span class="keywordtype">float</span> classify_theta = classify_rotation.<a class="code" href="a02578.html#aab5b14bc328998adc252ffe7476d7f22">angle</a>();</div><div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>  <span class="keywordtype">double</span> rot_theta = - (re_theta - classify_theta) * 2.0 / M_PI;</div><div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>  <span class="keywordflow">if</span> (rot_theta < 0) rot_theta += 4;</div><div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>  <span class="keywordtype">int</span> num_rotations = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(rot_theta + 0.5);</div><div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>  (*block_orientation)[i] = num_rotations;</div><div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>  <span class="comment">// The classify_rotation is non-zero only if the text has vertical</span></div><div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>  <span class="comment">// writing direction.</span></div><div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>  (*vertical_writing)[i] = classify_rotation.<a class="code" href="a02578.html#abb9516f874133b689b0e62ac70874385">y</a>() != 0.0f;</div><div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>  ++i;</div><div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>  }</div><div class="line"><a name="l02597"></a><span class="lineno"> 2597</span> }</div><div class="line"><a name="l02598"></a><span class="lineno"> 2598</span> </div><div class="line"><a name="l02599"></a><span class="lineno"> 2599</span> </div><div class="line"><a name="l02600"></a><span class="lineno"><a class="line" href="a02186.html#a33cf8d85c3714857bc8753fef035ea95"> 2600</a></span> <span class="keywordtype">void</span> <a class="code" href="a02186.html#a33cf8d85c3714857bc8753fef035ea95">TessBaseAPI::DetectParagraphs</a>(<span class="keywordtype">bool</span> after_text_recognition) {</div><div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>  <span class="keywordtype">int</span> debug_level = 0;</div><div class="line"><a name="l02602"></a><span class="lineno"> 2602</span>  <a class="code" href="a02186.html#a25d71dd25faea83cc91db902f2997297">GetIntVariable</a>(<span class="stringliteral">"paragraph_debug_level"</span>, &debug_level);</div><div class="line"><a name="l02603"></a><span class="lineno"> 2603</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l02604"></a><span class="lineno"> 2604</span>  <a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> = <span class="keyword">new</span> <a class="code" href="a02182.html">GenericVector<ParagraphModel*></a>;</div><div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>  <a class="code" href="a02258.html">MutableIterator</a> *result_it = <a class="code" href="a01625.html#ga29906219f78adc7fd76a83bde37e09eb">GetMutableIterator</a>();</div><div class="line"><a name="l02606"></a><span class="lineno"> 2606</span>  <span class="keywordflow">do</span> { <span class="comment">// Detect paragraphs for this block</span></div><div class="line"><a name="l02607"></a><span class="lineno"> 2607</span>  <a class="code" href="a02182.html">GenericVector<ParagraphModel *></a> models;</div><div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>  <a class="code" href="a01629.html#a65cdf27a58055de3324687ee56b1dcba">::tesseract::DetectParagraphs</a>(debug_level, after_text_recognition,</div><div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>  result_it, &models);</div><div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>  *<a class="code" href="a02186.html#a06084d66b830a388515663761d842041">paragraph_models_</a> += models;</div><div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>  } <span class="keywordflow">while</span> (result_it-><a class="code" href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">Next</a>(<a class="code" href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">RIL_BLOCK</a>));</div><div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>  <span class="keyword">delete</span> result_it;</div><div class="line"><a name="l02613"></a><span class="lineno"> 2613</span> }</div><div class="line"><a name="l02614"></a><span class="lineno"> 2614</span> </div><div class="line"><a name="l02616"></a><span class="lineno"><a class="line" href="a01625.html#ga34314bb3635a6e0d171e33d4b4181db2"> 2616</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="a01625.html#ga34314bb3635a6e0d171e33d4b4181db2">TessBaseAPI::GetUnichar</a>(<span class="keywordtype">int</span> unichar_id) {</div><div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#aa19fb595808fe4688c580334937dfa45">id_to_unichar</a>(unichar_id);</div><div class="line"><a name="l02618"></a><span class="lineno"> 2618</span> }</div><div class="line"><a name="l02619"></a><span class="lineno"> 2619</span> </div><div class="line"><a name="l02621"></a><span class="lineno"><a class="line" href="a01625.html#ga7d47d44548a1158018150e28863ba4eb"> 2621</a></span> <span class="keyword">const</span> <a class="code" href="a04258.html">Dawg</a> *<a class="code" href="a01625.html#ga7d47d44548a1158018150e28863ba4eb">TessBaseAPI::GetDawg</a>(<span class="keywordtype">int</span> i)<span class="keyword"> const </span>{</div><div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>  <span class="keywordflow">if</span> (<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> || i >= <a class="code" href="a01625.html#ga28d59ef954b789bef7c6766f6e265f49">NumDawgs</a>()) <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a592e165554ca0cb0839da97874314ac8">GetDawg</a>(i);</div><div class="line"><a name="l02624"></a><span class="lineno"> 2624</span> }</div><div class="line"><a name="l02625"></a><span class="lineno"> 2625</span> </div><div class="line"><a name="l02627"></a><span class="lineno"><a class="line" href="a01625.html#ga28d59ef954b789bef7c6766f6e265f49"> 2627</a></span> <span class="keywordtype">int</span> <a class="code" href="a01625.html#ga28d59ef954b789bef7c6766f6e265f49">TessBaseAPI::NumDawgs</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l02628"></a><span class="lineno"> 2628</span>  <span class="keywordflow">return</span> <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a> == <span class="keyword">nullptr</span> ? 0 : <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a82c256d078ecd1362de8764a5c3c4fa9">NumDawgs</a>();</div><div class="line"><a name="l02629"></a><span class="lineno"> 2629</span> }</div><div class="line"><a name="l02630"></a><span class="lineno"> 2630</span> </div><div class="line"><a name="l02632"></a><span class="lineno"><a class="line" href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822"> 2632</a></span> <a class="code" href="a02834.html">STRING</a> <a class="code" href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822">HOcrEscape</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* text) {</div><div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>  <a class="code" href="a02834.html">STRING</a> ret;</div><div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *ptr;</div><div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>  <span class="keywordflow">for</span> (ptr = text; *ptr; ptr++) {</div><div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>  <span class="keywordflow">switch</span> (*ptr) {</div><div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>  <span class="keywordflow">case</span> <span class="charliteral">'<'</span>: ret += <span class="stringliteral">"&lt;"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>  <span class="keywordflow">case</span> <span class="charliteral">'>'</span>: ret += <span class="stringliteral">"&gt;"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>  <span class="keywordflow">case</span> <span class="charliteral">'&'</span>: ret += <span class="stringliteral">"&amp;"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>  <span class="keywordflow">case</span> <span class="charliteral">'"'</span>: ret += <span class="stringliteral">"&quot;"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>  <span class="keywordflow">case</span> <span class="charliteral">'\''</span>: ret += <span class="stringliteral">"&#39;"</span>; <span class="keywordflow">break</span>;</div><div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>  <span class="keywordflow">default</span>: ret += *ptr;</div><div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>  }</div><div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>  }</div><div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>  <span class="keywordflow">return</span> ret;</div><div class="line"><a name="l02646"></a><span class="lineno"> 2646</span> }</div><div class="line"><a name="l02647"></a><span class="lineno"> 2647</span> </div><div class="line"><a name="l02648"></a><span class="lineno"> 2648</span> </div><div class="line"><a name="l02649"></a><span class="lineno"> 2649</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02650"></a><span class="lineno"> 2650</span> </div><div class="line"><a name="l02651"></a><span class="lineno"> 2651</span> </div><div class="line"><a name="l02652"></a><span class="lineno"> 2652</span> <span class="comment">// ____________________________________________________________________________</span></div><div class="line"><a name="l02653"></a><span class="lineno"> 2653</span> <span class="comment">// Ocropus add-ons.</span></div><div class="line"><a name="l02654"></a><span class="lineno"> 2654</span> </div><div class="line"><a name="l02656"></a><span class="lineno"><a class="line" href="a01625.html#ga12273df6a36cd7b618029c21d0c53cfa"> 2656</a></span> BLOCK_LIST* <a class="code" href="a01625.html#ga12273df6a36cd7b618029c21d0c53cfa">TessBaseAPI::FindLinesCreateBlockList</a>() {</div><div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(<a class="code" href="a02186.html#a86899716a1adde396be4efd57b547d27">FindLines</a>() == 0);</div><div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>  BLOCK_LIST* result = <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a>;</div><div class="line"><a name="l02659"></a><span class="lineno"> 2659</span>  <a class="code" href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">block_list_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l02661"></a><span class="lineno"> 2661</span> }</div><div class="line"><a name="l02662"></a><span class="lineno"> 2662</span> </div><div class="line"><a name="l02668"></a><span class="lineno"><a class="line" href="a01625.html#ga8f69791ff9730a032068c87bd7b92ca1"> 2668</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga8f69791ff9730a032068c87bd7b92ca1">TessBaseAPI::DeleteBlockList</a>(BLOCK_LIST *block_list) {</div><div class="line"><a name="l02669"></a><span class="lineno"> 2669</span>  <span class="keyword">delete</span> block_list;</div><div class="line"><a name="l02670"></a><span class="lineno"> 2670</span> }</div><div class="line"><a name="l02671"></a><span class="lineno"> 2671</span> </div><div class="line"><a name="l02672"></a><span class="lineno"> 2672</span> </div><div class="line"><a name="l02673"></a><span class="lineno"><a class="line" href="a01625.html#ga6188cb0fdcf944408db772131c545429"> 2673</a></span> <a class="code" href="a02526.html">ROW</a> *<a class="code" href="a01625.html#ga6188cb0fdcf944408db772131c545429">TessBaseAPI::MakeTessOCRRow</a>(<span class="keywordtype">float</span> <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>,</div><div class="line"><a name="l02674"></a><span class="lineno"> 2674</span>  <span class="keywordtype">float</span> xheight,</div><div class="line"><a name="l02675"></a><span class="lineno"> 2675</span>  <span class="keywordtype">float</span> descender,</div><div class="line"><a name="l02676"></a><span class="lineno"> 2676</span>  <span class="keywordtype">float</span> ascender) {</div><div class="line"><a name="l02677"></a><span class="lineno"> 2677</span>  int32_t xstarts[] = {-32000};</div><div class="line"><a name="l02678"></a><span class="lineno"> 2678</span>  <span class="keywordtype">double</span> quad_coeffs[] = {0, 0, <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>};</div><div class="line"><a name="l02679"></a><span class="lineno"> 2679</span>  <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="a02526.html">ROW</a>(1,</div><div class="line"><a name="l02680"></a><span class="lineno"> 2680</span>  xstarts,</div><div class="line"><a name="l02681"></a><span class="lineno"> 2681</span>  quad_coeffs,</div><div class="line"><a name="l02682"></a><span class="lineno"> 2682</span>  xheight,</div><div class="line"><a name="l02683"></a><span class="lineno"> 2683</span>  ascender - (<a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a> + xheight),</div><div class="line"><a name="l02684"></a><span class="lineno"> 2684</span>  descender - <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>,</div><div class="line"><a name="l02685"></a><span class="lineno"> 2685</span>  0,</div><div class="line"><a name="l02686"></a><span class="lineno"> 2686</span>  0);</div><div class="line"><a name="l02687"></a><span class="lineno"> 2687</span> }</div><div class="line"><a name="l02688"></a><span class="lineno"> 2688</span> </div><div class="line"><a name="l02690"></a><span class="lineno"><a class="line" href="a01625.html#ga0306bec5d154260922c203d8022832ca"> 2690</a></span> <a class="code" href="a02398.html">TBLOB</a> *<a class="code" href="a01625.html#ga0306bec5d154260922c203d8022832ca">TessBaseAPI::MakeTBLOB</a>(Pix *pix) {</div><div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>  <span class="keywordtype">int</span> width = pixGetWidth(pix);</div><div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>  <span class="keywordtype">int</span> height = pixGetHeight(pix);</div><div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>  <a class="code" href="a02514.html">BLOCK</a> block(<span class="stringliteral">"a character"</span>, <a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>, 0, 0, 0, 0, width, height);</div><div class="line"><a name="l02694"></a><span class="lineno"> 2694</span> </div><div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>  <span class="comment">// Create C_BLOBs from the page</span></div><div class="line"><a name="l02696"></a><span class="lineno"> 2696</span>  <a class="code" href="a01160.html#a16ca13da58e65267e7e34355091ca891">extract_edges</a>(pix, &block);</div><div class="line"><a name="l02697"></a><span class="lineno"> 2697</span> </div><div class="line"><a name="l02698"></a><span class="lineno"> 2698</span>  <span class="comment">// Merge all C_BLOBs</span></div><div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>  C_BLOB_LIST *list = block.<a class="code" href="a02514.html#a23196fe0d7230572b44aa77031a1d72a">blob_list</a>();</div><div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>  C_BLOB_IT c_blob_it(list);</div><div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>  <span class="keywordflow">if</span> (c_blob_it.empty())</div><div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>  <span class="comment">// Move all the outlines to the first blob.</span></div><div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>  C_OUTLINE_IT ol_it(c_blob_it.data()->out_list());</div><div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>  <span class="keywordflow">for</span> (c_blob_it.forward();</div><div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>  !c_blob_it.at_first();</div><div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>  c_blob_it.forward()) {</div><div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>  <a class="code" href="a02634.html">C_BLOB</a> *c_blob = c_blob_it.data();</div><div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>  ol_it.add_list_after(c_blob-><a class="code" href="a02634.html#ae510f3d0e7398fbb46608082429eac89">out_list</a>());</div><div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>  }</div><div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>  <span class="comment">// Convert the first blob to the output TBLOB.</span></div><div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>  <span class="keywordflow">return</span> <a class="code" href="a02398.html#a7b6051e1c1934265a91e1ee864bd5164">TBLOB::PolygonalCopy</a>(<span class="keyword">false</span>, c_blob_it.data());</div><div class="line"><a name="l02713"></a><span class="lineno"> 2713</span> }</div><div class="line"><a name="l02714"></a><span class="lineno"> 2714</span> </div><div class="line"><a name="l02720"></a><span class="lineno"><a class="line" href="a01625.html#ga8250efe0683da2a44fa6ec050240a8b2"> 2720</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga8250efe0683da2a44fa6ec050240a8b2">TessBaseAPI::NormalizeTBLOB</a>(<a class="code" href="a02398.html">TBLOB</a> *tblob, <a class="code" href="a02526.html">ROW</a> *row, <span class="keywordtype">bool</span> numeric_mode) {</div><div class="line"><a name="l02721"></a><span class="lineno"> 2721</span>  <a class="code" href="a02610.html">TBOX</a> box = tblob-><a class="code" href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">bounding_box</a>();</div><div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>  <span class="keywordtype">float</span> x_center = (box.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>() + box.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>()) / 2.0f;</div><div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>  <span class="keywordtype">float</span> <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a> = row-><a class="code" href="a02526.html#a8d6262ab8c857cb5c62fef75b2d96181">base_line</a>(x_center);</div><div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>  <span class="keywordtype">float</span> scale = <a class="code" href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a> / row-><a class="code" href="a02526.html#aced2e98c94f532c5c5809d63aef4b9de">x_height</a>();</div><div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>  tblob-><a class="code" href="a02398.html#a6aef0201c756ed33e68a94abc8ac2b8e">Normalize</a>(<span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, x_center, <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>, scale, scale,</div><div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>  0.0f, static_cast<float>(<a class="code" href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a>), <span class="keyword">false</span>, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l02727"></a><span class="lineno"> 2727</span> }</div><div class="line"><a name="l02728"></a><span class="lineno"> 2728</span> </div><div class="line"><a name="l02733"></a><span class="lineno"> 2733</span> <span class="keyword">static</span> <a class="code" href="a02398.html">TBLOB</a> *make_tesseract_blob(<span class="keywordtype">float</span> <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>, <span class="keywordtype">float</span> xheight,</div><div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>  <span class="keywordtype">float</span> descender, <span class="keywordtype">float</span> ascender,</div><div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>  <span class="keywordtype">bool</span> numeric_mode, Pix* pix) {</div><div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>  <a class="code" href="a02398.html">TBLOB</a> *tblob = <a class="code" href="a01625.html#ga0306bec5d154260922c203d8022832ca">TessBaseAPI::MakeTBLOB</a>(pix);</div><div class="line"><a name="l02737"></a><span class="lineno"> 2737</span> </div><div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>  <span class="comment">// Normalize TBLOB</span></div><div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>  <a class="code" href="a02526.html">ROW</a> *row =</div><div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>  <a class="code" href="a01625.html#ga6188cb0fdcf944408db772131c545429">TessBaseAPI::MakeTessOCRRow</a>(<a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>, xheight, descender, ascender);</div><div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>  <a class="code" href="a01625.html#ga8250efe0683da2a44fa6ec050240a8b2">TessBaseAPI::NormalizeTBLOB</a>(tblob, row, numeric_mode);</div><div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>  <span class="keyword">delete</span> row;</div><div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>  <span class="keywordflow">return</span> tblob;</div><div class="line"><a name="l02744"></a><span class="lineno"> 2744</span> }</div><div class="line"><a name="l02745"></a><span class="lineno"> 2745</span> </div><div class="line"><a name="l02751"></a><span class="lineno"><a class="line" href="a01626.html#gaf62a3be9f3b8ca4f8260ec2cc1628ecc"> 2751</a></span> <span class="keywordtype">void</span> <a class="code" href="a01626.html#gaf62a3be9f3b8ca4f8260ec2cc1628ecc">TessBaseAPI::AdaptToCharacter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *unichar_repr,</div><div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>  <span class="keywordtype">int</span> length,</div><div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>  <span class="keywordtype">float</span> <a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>,</div><div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>  <span class="keywordtype">float</span> xheight,</div><div class="line"><a name="l02755"></a><span class="lineno"> 2755</span>  <span class="keywordtype">float</span> descender,</div><div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>  <span class="keywordtype">float</span> ascender) {</div><div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>  <a class="code" href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a> <span class="keywordtype">id</span> = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#aeb2253dcb5f01c81fcba5f4af417eadf">unichar_to_id</a>(unichar_repr, length);</div><div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>  <a class="code" href="a02398.html">TBLOB</a> *blob = make_tesseract_blob(<a class="code" href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a>, xheight, descender, ascender,</div><div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">classify_bln_numeric_mode</a>,</div><div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">pix_binary</a>());</div><div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>  <span class="keywordtype">float</span> threshold;</div><div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>  <span class="keywordtype">float</span> best_rating = -100;</div><div class="line"><a name="l02763"></a><span class="lineno"> 2763</span> </div><div class="line"><a name="l02764"></a><span class="lineno"> 2764</span> </div><div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>  <span class="comment">// Classify to get a raw choice.</span></div><div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>  BLOB_CHOICE_LIST choices;</div><div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#ab39a42222f621c9a5f1bd1b31db3a930">AdaptiveClassifier</a>(blob, &choices);</div><div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>  BLOB_CHOICE_IT choice_it;</div><div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>  choice_it.set_to_list(&choices);</div><div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>  <span class="keywordflow">for</span> (choice_it.mark_cycle_pt(); !choice_it.cycled_list();</div><div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>  choice_it.forward()) {</div><div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>  <span class="keywordflow">if</span> (choice_it.data()->rating() > best_rating) {</div><div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>  best_rating = choice_it.data()->rating();</div><div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>  }</div><div class="line"><a name="l02775"></a><span class="lineno"> 2775</span>  }</div><div class="line"><a name="l02776"></a><span class="lineno"> 2776</span> </div><div class="line"><a name="l02777"></a><span class="lineno"> 2777</span>  threshold = <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#adc3a809a1a219f741a9e45a32e0d11bc">matcher_good_threshold</a>;</div><div class="line"><a name="l02778"></a><span class="lineno"> 2778</span> </div><div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>  <span class="keywordflow">if</span> (blob-><a class="code" href="a02398.html#a3c9282cad4102157d214bcc6311cda07">outlines</a>)</div><div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#aebf3ab5242102dae50387686363b7bce">AdaptToChar</a>(blob, <span class="keywordtype">id</span>, kUnknownFontinfoId, threshold,</div><div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a49c2bec2694a12cb6518001d8193d58d">AdaptedTemplates</a>);</div><div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>  <span class="keyword">delete</span> blob;</div><div class="line"><a name="l02783"></a><span class="lineno"> 2783</span> }</div><div class="line"><a name="l02784"></a><span class="lineno"> 2784</span> </div><div class="line"><a name="l02785"></a><span class="lineno"> 2785</span> </div><div class="line"><a name="l02786"></a><span class="lineno"><a class="line" href="a01626.html#ga0384f67e497ea3e81436d09da0ad7270"> 2786</a></span> <a class="code" href="a02530.html">PAGE_RES</a>* <a class="code" href="a01626.html#ga0384f67e497ea3e81436d09da0ad7270">TessBaseAPI::RecognitionPass1</a>(BLOCK_LIST* block_list) {</div><div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>  <a class="code" href="a02530.html">PAGE_RES</a> *page_res = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(<span class="keyword">false</span>, block_list,</div><div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>  &(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a>));</div><div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed">recog_all_words</a>(page_res, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, 1);</div><div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>  <span class="keywordflow">return</span> page_res;</div><div class="line"><a name="l02791"></a><span class="lineno"> 2791</span> }</div><div class="line"><a name="l02792"></a><span class="lineno"> 2792</span> </div><div class="line"><a name="l02793"></a><span class="lineno"><a class="line" href="a01626.html#ga158cc2af7170f3efa8cb140f2745d9b8"> 2793</a></span> <a class="code" href="a02530.html">PAGE_RES</a>* <a class="code" href="a01626.html#ga158cc2af7170f3efa8cb140f2745d9b8">TessBaseAPI::RecognitionPass2</a>(BLOCK_LIST* block_list,</div><div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>  <a class="code" href="a02530.html">PAGE_RES</a>* pass1_result) {</div><div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>  <span class="keywordflow">if</span> (!pass1_result)</div><div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>  pass1_result = <span class="keyword">new</span> <a class="code" href="a02530.html">PAGE_RES</a>(<span class="keyword">false</span>, block_list,</div><div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>  &(<a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a>));</div><div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed">recog_all_words</a>(pass1_result, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, 2);</div><div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>  <span class="keywordflow">return</span> pass1_result;</div><div class="line"><a name="l02800"></a><span class="lineno"> 2800</span> }</div><div class="line"><a name="l02801"></a><span class="lineno"> 2801</span> </div><div class="line"><a name="l02802"></a><span class="lineno"><a class="line" href="a02178.html"> 2802</a></span> <span class="keyword">struct </span><a class="code" href="a02178.html">TESS_CHAR</a> : <a class="code" href="a02686.html">ELIST_LINK</a> {</div><div class="line"><a name="l02803"></a><span class="lineno"><a class="line" href="a02178.html#a26571c64aee9fc53688c36e7b636f442"> 2803</a></span>  <span class="keywordtype">char</span> *<a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a>;</div><div class="line"><a name="l02804"></a><span class="lineno"><a class="line" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558"> 2804</a></span>  <span class="keywordtype">int</span> <a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>; <span class="comment">// of unicode_repr</span></div><div class="line"><a name="l02805"></a><span class="lineno"><a class="line" href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3"> 2805</a></span>  <span class="keywordtype">float</span> <a class="code" href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3">cost</a>;</div><div class="line"><a name="l02806"></a><span class="lineno"><a class="line" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244"> 2806</a></span>  <a class="code" href="a02610.html">TBOX</a> <a class="code" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">box</a>;</div><div class="line"><a name="l02807"></a><span class="lineno"> 2807</span> </div><div class="line"><a name="l02808"></a><span class="lineno"><a class="line" href="a02178.html#ad9c35da31a6b36d0cf1dd9dce0572da4"> 2808</a></span>  <a class="code" href="a02178.html#ad9c35da31a6b36d0cf1dd9dce0572da4">TESS_CHAR</a>(<span class="keywordtype">float</span> _cost, <span class="keyword">const</span> <span class="keywordtype">char</span> *repr, <span class="keywordtype">int</span> len = -1) : <a class="code" href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3">cost</a>(_cost) {</div><div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>  <a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a> = (len == -1 ? strlen(repr) : len);</div><div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>  <a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a> = <span class="keyword">new</span> <span class="keywordtype">char</span>[<a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a> + 1];</div><div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>  strncpy(<a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a>, repr, <a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>);</div><div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>  }</div><div class="line"><a name="l02813"></a><span class="lineno"> 2813</span> </div><div class="line"><a name="l02814"></a><span class="lineno"><a class="line" href="a02178.html#a790acae1a0c7dcd6bf9622ee384d3e3c"> 2814</a></span>  <a class="code" href="a02178.html#a790acae1a0c7dcd6bf9622ee384d3e3c">TESS_CHAR</a>()</div><div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>  : <a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a>(nullptr),</div><div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>  <a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>(0),</div><div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>  <a class="code" href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3">cost</a>(0.0f)</div><div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>  { <span class="comment">// Satisfies ELISTIZE.</span></div><div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>  }</div><div class="line"><a name="l02820"></a><span class="lineno"><a class="line" href="a02178.html#afe67e07224557403466b301b29acb124"> 2820</a></span>  <a class="code" href="a02178.html#afe67e07224557403466b301b29acb124">~TESS_CHAR</a>() {</div><div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>  <span class="keyword">delete</span> [] <a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a>;</div><div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>  }</div><div class="line"><a name="l02823"></a><span class="lineno"> 2823</span> };</div><div class="line"><a name="l02824"></a><span class="lineno"> 2824</span> </div><div class="line"><a name="l02825"></a><span class="lineno"> 2825</span> <a class="code" href="a00491.html#a6cf5144252ef24ea7bb5e0da1e698a0b">ELISTIZEH</a>(TESS_CHAR)</div><div class="line"><a name="l02826"></a><span class="lineno"> 2826</span> <a class="code" href="a00491.html#ab54325a3cfcd9bee58697d77e1902240">ELISTIZE</a>(TESS_CHAR)</div><div class="line"><a name="l02827"></a><span class="lineno"> 2827</span> </div><div class="line"><a name="l02828"></a><span class="lineno"> 2828</span> <span class="keyword">static</span> <span class="keywordtype">void</span> add_space(TESS_CHAR_IT* it) {</div><div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>  TESS_CHAR *t = <span class="keyword">new</span> TESS_CHAR(0, <span class="stringliteral">" "</span>);</div><div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>  it->add_after_then_move(t);</div><div class="line"><a name="l02831"></a><span class="lineno"> 2831</span> }</div><div class="line"><a name="l02832"></a><span class="lineno"> 2832</span> </div><div class="line"><a name="l02833"></a><span class="lineno"> 2833</span> </div><div class="line"><a name="l02834"></a><span class="lineno"> 2834</span> <span class="keyword">static</span> <span class="keywordtype">float</span> rating_to_cost(<span class="keywordtype">float</span> rating) {</div><div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>  rating = 100 + rating;</div><div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>  <span class="comment">// cuddled that to save from coverage profiler</span></div><div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>  <span class="comment">// (I have never seen ratings worse than -100,</span></div><div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>  <span class="comment">// but the check won't hurt)</span></div><div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>  <span class="keywordflow">if</span> (rating < 0) rating = 0;</div><div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>  <span class="keywordflow">return</span> rating;</div><div class="line"><a name="l02841"></a><span class="lineno"> 2841</span> }</div><div class="line"><a name="l02842"></a><span class="lineno"> 2842</span> </div><div class="line"><a name="l02847"></a><span class="lineno"> 2847</span> <span class="keyword">static</span> <span class="keywordtype">void</span> extract_result(TESS_CHAR_IT* out,</div><div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>  <a class="code" href="a02530.html">PAGE_RES</a>* page_res) {</div><div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>  <span class="keywordtype">int</span> word_count = 0;</div><div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>  <span class="keywordflow">while</span> (page_res_it.word() != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>  <a class="code" href="a02542.html">WERD_RES</a> *word = page_res_it.<a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>();</div><div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *str = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>();</div><div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *len = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adaecd80cfe44e00e9c4647859b1c87e0">unichar_lengths</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>();</div><div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>  <a class="code" href="a02610.html">TBOX</a> real_rect = word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">bounding_box</a>();</div><div class="line"><a name="l02856"></a><span class="lineno"> 2856</span> </div><div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>  <span class="keywordflow">if</span> (word_count)</div><div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>  add_space(out);</div><div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>  <span class="keywordtype">int</span> n = strlen(len);</div><div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < n; i++) {</div><div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>  TESS_CHAR *tc = <span class="keyword">new</span> TESS_CHAR(rating_to_cost(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>()),</div><div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>  str, *len);</div><div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>  tc->box = real_rect.<a class="code" href="a02610.html#abaa57ee82b89cfab6b80d3ac3d31bd60">intersection</a>(word-><a class="code" href="a02542.html#a3a92c8c9750d78631d75998f008f366a">box_word</a>-><a class="code" href="a02410.html#a94891d405fd3837d235bb8916df1c89e">BlobBox</a>(i));</div><div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>  out->add_after_then_move(tc);</div><div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>  str += *len;</div><div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>  len++;</div><div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>  }</div><div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>  page_res_it.forward();</div><div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>  word_count++;</div><div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>  }</div><div class="line"><a name="l02871"></a><span class="lineno"> 2871</span> }</div><div class="line"><a name="l02872"></a><span class="lineno"> 2872</span> </div><div class="line"><a name="l02877"></a><span class="lineno"><a class="line" href="a01626.html#ga554e33b4a8fa10ccd2200698ded6753d"> 2877</a></span> <span class="keywordtype">int</span> <a class="code" href="a01626.html#ga554e33b4a8fa10ccd2200698ded6753d">TessBaseAPI::TesseractExtractResult</a>(<span class="keywordtype">char</span>** text,</div><div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>  <span class="keywordtype">int</span>** lengths,</div><div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>  <span class="keywordtype">float</span>** costs,</div><div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>  <span class="keywordtype">int</span>** x0,</div><div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>  <span class="keywordtype">int</span>** y0,</div><div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>  <span class="keywordtype">int</span>** x1,</div><div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>  <span class="keywordtype">int</span>** y1,</div><div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>  <a class="code" href="a02530.html">PAGE_RES</a>* page_res) {</div><div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>  TESS_CHAR_LIST tess_chars;</div><div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>  TESS_CHAR_IT tess_chars_it(&tess_chars);</div><div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>  extract_result(&tess_chars_it, page_res);</div><div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>  tess_chars_it.move_to_first();</div><div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>  <span class="keywordtype">int</span> n = tess_chars.length();</div><div class="line"><a name="l02890"></a><span class="lineno"> 2890</span>  <span class="keywordtype">int</span> text_len = 0;</div><div class="line"><a name="l02891"></a><span class="lineno"> 2891</span>  *lengths = <span class="keyword">new</span> <span class="keywordtype">int</span>[n];</div><div class="line"><a name="l02892"></a><span class="lineno"> 2892</span>  *costs = <span class="keyword">new</span> <span class="keywordtype">float</span>[n];</div><div class="line"><a name="l02893"></a><span class="lineno"> 2893</span>  *x0 = <span class="keyword">new</span> <span class="keywordtype">int</span>[n];</div><div class="line"><a name="l02894"></a><span class="lineno"> 2894</span>  *y0 = <span class="keyword">new</span> <span class="keywordtype">int</span>[n];</div><div class="line"><a name="l02895"></a><span class="lineno"> 2895</span>  *x1 = <span class="keyword">new</span> <span class="keywordtype">int</span>[n];</div><div class="line"><a name="l02896"></a><span class="lineno"> 2896</span>  *y1 = <span class="keyword">new</span> <span class="keywordtype">int</span>[n];</div><div class="line"><a name="l02897"></a><span class="lineno"> 2897</span>  <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l02898"></a><span class="lineno"> 2898</span>  <span class="keywordflow">for</span> (tess_chars_it.mark_cycle_pt();</div><div class="line"><a name="l02899"></a><span class="lineno"> 2899</span>  !tess_chars_it.cycled_list();</div><div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>  tess_chars_it.forward(), i++) {</div><div class="line"><a name="l02901"></a><span class="lineno"> 2901</span>  <a class="code" href="a02178.html">TESS_CHAR</a> *tc = tess_chars_it.data();</div><div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>  text_len += (*lengths)[i] = tc-><a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>;</div><div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>  (*costs)[i] = tc-><a class="code" href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3">cost</a>;</div><div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>  (*x0)[i] = tc-><a class="code" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">box</a>.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>();</div><div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>  (*y0)[i] = tc-><a class="code" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">box</a>.<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>();</div><div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>  (*x1)[i] = tc-><a class="code" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">box</a>.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>();</div><div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>  (*y1)[i] = tc-><a class="code" href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">box</a>.<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>();</div><div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>  }</div><div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>  <span class="keywordtype">char</span> *p = *text = <span class="keyword">new</span> <span class="keywordtype">char</span>[text_len];</div><div class="line"><a name="l02910"></a><span class="lineno"> 2910</span> </div><div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>  tess_chars_it.move_to_first();</div><div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>  <span class="keywordflow">for</span> (tess_chars_it.mark_cycle_pt();</div><div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>  !tess_chars_it.cycled_list();</div><div class="line"><a name="l02914"></a><span class="lineno"> 2914</span>  tess_chars_it.forward()) {</div><div class="line"><a name="l02915"></a><span class="lineno"> 2915</span>  <a class="code" href="a02178.html">TESS_CHAR</a> *tc = tess_chars_it.data();</div><div class="line"><a name="l02916"></a><span class="lineno"> 2916</span>  strncpy(p, tc-><a class="code" href="a02178.html#a26571c64aee9fc53688c36e7b636f442">unicode_repr</a>, tc-><a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>);</div><div class="line"><a name="l02917"></a><span class="lineno"> 2917</span>  p += tc-><a class="code" href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">length</a>;</div><div class="line"><a name="l02918"></a><span class="lineno"> 2918</span>  }</div><div class="line"><a name="l02919"></a><span class="lineno"> 2919</span>  <span class="keywordflow">return</span> n;</div><div class="line"><a name="l02920"></a><span class="lineno"> 2920</span> }</div><div class="line"><a name="l02921"></a><span class="lineno"> 2921</span> </div><div class="line"><a name="l02923"></a><span class="lineno"> 2923</span> <span class="comment">// The resulting features are returned in int_features, which must be</span></div><div class="line"><a name="l02924"></a><span class="lineno"> 2924</span> <span class="comment">// of size MAX_NUM_INT_FEATURES. The number of features is returned in</span></div><div class="line"><a name="l02925"></a><span class="lineno"> 2925</span> <span class="comment">// num_features (or 0 if there was a failure).</span></div><div class="line"><a name="l02926"></a><span class="lineno"> 2926</span> <span class="comment">// On return feature_outline_index is filled with an index of the outline</span></div><div class="line"><a name="l02927"></a><span class="lineno"> 2927</span> <span class="comment">// corresponding to each feature in int_features.</span></div><div class="line"><a name="l02928"></a><span class="lineno"> 2928</span> <span class="comment">// TODO(rays) Fix the caller to out outline_counts instead.</span></div><div class="line"><a name="l02929"></a><span class="lineno"><a class="line" href="a01625.html#ga5520fb5647d0696717e9ecbd86dc0067"> 2929</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga5520fb5647d0696717e9ecbd86dc0067">TessBaseAPI::GetFeaturesForBlob</a>(<a class="code" href="a02398.html">TBLOB</a>* blob,</div><div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>  <a class="code" href="a04130.html">INT_FEATURE_STRUCT</a>* int_features,</div><div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>  <span class="keywordtype">int</span>* num_features,</div><div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>  <span class="keywordtype">int</span>* feature_outline_index) {</div><div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>  <a class="code" href="a02182.html">GenericVector<int></a> outline_counts;</div><div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>  <a class="code" href="a02182.html">GenericVector<INT_FEATURE_STRUCT></a> bl_features;</div><div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>  <a class="code" href="a02182.html">GenericVector<INT_FEATURE_STRUCT></a> cn_features;</div><div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>  <a class="code" href="a04078.html">INT_FX_RESULT_STRUCT</a> fx_info;</div><div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#a2e861cf56ef6e2eb15a0f2a1544e738a">ExtractFeatures</a>(*blob, <span class="keyword">false</span>, &bl_features,</div><div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>  &cn_features, &fx_info, &outline_counts);</div><div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>  <span class="keywordflow">if</span> (cn_features.<a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>() || cn_features.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() > <a class="code" href="a00737.html#a4f7caedc4bed99355cae19efa51ade51">MAX_NUM_INT_FEATURES</a>) {</div><div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>  *num_features = 0;</div><div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>  <span class="keywordflow">return</span>; <span class="comment">// Feature extraction failed.</span></div><div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>  }</div><div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>  *num_features = cn_features.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>();</div><div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>  memcpy(int_features, &cn_features[0], *num_features * <span class="keyword">sizeof</span>(cn_features[0]));</div><div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>  <span class="comment">// TODO(rays) Pass outline_counts back and simplify the calling code.</span></div><div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>  <span class="keywordflow">if</span> (feature_outline_index != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>  <span class="keywordtype">int</span> f = 0;</div><div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < outline_counts.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>  <span class="keywordflow">while</span> (f < outline_counts[i])</div><div class="line"><a name="l02950"></a><span class="lineno"> 2950</span>  feature_outline_index[f++] = i;</div><div class="line"><a name="l02951"></a><span class="lineno"> 2951</span>  }</div><div class="line"><a name="l02952"></a><span class="lineno"> 2952</span>  }</div><div class="line"><a name="l02953"></a><span class="lineno"> 2953</span> }</div><div class="line"><a name="l02954"></a><span class="lineno"> 2954</span> </div><div class="line"><a name="l02955"></a><span class="lineno"> 2955</span> <span class="comment">// This method returns the row to which a box of specified dimensions would</span></div><div class="line"><a name="l02956"></a><span class="lineno"> 2956</span> <span class="comment">// belong. If no good match is found, it returns nullptr.</span></div><div class="line"><a name="l02957"></a><span class="lineno"><a class="line" href="a01625.html#gab73311ecd1bf8f7e6f98585a76328740"> 2957</a></span> <a class="code" href="a02526.html">ROW</a>* <a class="code" href="a01625.html#gab73311ecd1bf8f7e6f98585a76328740">TessBaseAPI::FindRowForBox</a>(BLOCK_LIST* blocks,</div><div class="line"><a name="l02958"></a><span class="lineno"> 2958</span>  <span class="keywordtype">int</span> left, <span class="keywordtype">int</span> top, <span class="keywordtype">int</span> right, <span class="keywordtype">int</span> bottom) {</div><div class="line"><a name="l02959"></a><span class="lineno"> 2959</span>  <a class="code" href="a02610.html">TBOX</a> box(left, bottom, right, top);</div><div class="line"><a name="l02960"></a><span class="lineno"> 2960</span>  BLOCK_IT b_it(blocks);</div><div class="line"><a name="l02961"></a><span class="lineno"> 2961</span>  <span class="keywordflow">for</span> (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {</div><div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>  <a class="code" href="a02514.html">BLOCK</a>* block = b_it.data();</div><div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>  <span class="keywordflow">if</span> (!box.<a class="code" href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">major_overlap</a>(block-><a class="code" href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">pdblk</a>.<a class="code" href="a02558.html#a3f06f8e34fc5962f342daff9623463e9">bounding_box</a>()))</div><div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>  ROW_IT r_it(block-><a class="code" href="a02514.html#ae9826e422b0bf17a7592dee8db3fe058">row_list</a>());</div><div class="line"><a name="l02966"></a><span class="lineno"> 2966</span>  <span class="keywordflow">for</span> (r_it.mark_cycle_pt(); !r_it.cycled_list(); r_it.forward()) {</div><div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>  <a class="code" href="a02526.html">ROW</a>* row = r_it.data();</div><div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>  <span class="keywordflow">if</span> (!box.<a class="code" href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">major_overlap</a>(row-><a class="code" href="a02526.html#aa79de9c912a3875be44fdc3131fdc687">bounding_box</a>()))</div><div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>  WERD_IT w_it(row-><a class="code" href="a02526.html#ac9d07f978420b3564bf5508ad294fb70">word_list</a>());</div><div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>  <span class="keywordflow">for</span> (w_it.mark_cycle_pt(); !w_it.cycled_list(); w_it.forward()) {</div><div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>  <a class="code" href="a02638.html">WERD</a>* word = w_it.data();</div><div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>  <span class="keywordflow">if</span> (box.<a class="code" href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">major_overlap</a>(word-><a class="code" href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">bounding_box</a>()))</div><div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>  <span class="keywordflow">return</span> row;</div><div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>  }</div><div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>  }</div><div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>  }</div><div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02979"></a><span class="lineno"> 2979</span> }</div><div class="line"><a name="l02980"></a><span class="lineno"> 2980</span> </div><div class="line"><a name="l02982"></a><span class="lineno"><a class="line" href="a01625.html#ga58cc9fcbd423459db097f912e08d524f"> 2982</a></span> <span class="keywordtype">void</span> <a class="code" href="a01625.html#ga58cc9fcbd423459db097f912e08d524f">TessBaseAPI::RunAdaptiveClassifier</a>(<a class="code" href="a02398.html">TBLOB</a>* blob,</div><div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>  <span class="keywordtype">int</span> num_max_matches,</div><div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>  <span class="keywordtype">int</span>* unichar_ids,</div><div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>  <span class="keywordtype">float</span>* ratings,</div><div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>  <span class="keywordtype">int</span>* num_matches_returned) {</div><div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>  BLOB_CHOICE_LIST* choices = <span class="keyword">new</span> BLOB_CHOICE_LIST;</div><div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>  <a class="code" href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract_</a>-><a class="code" href="a03998.html#ab39a42222f621c9a5f1bd1b31db3a930">AdaptiveClassifier</a>(blob, choices);</div><div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>  BLOB_CHOICE_IT choices_it(choices);</div><div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>  <span class="keywordtype">int</span>& index = *num_matches_returned;</div><div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>  index = 0;</div><div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>  <span class="keywordflow">for</span> (choices_it.mark_cycle_pt();</div><div class="line"><a name="l02993"></a><span class="lineno"> 2993</span>  !choices_it.cycled_list() && index < num_max_matches;</div><div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>  choices_it.forward()) {</div><div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>  <a class="code" href="a02602.html">BLOB_CHOICE</a>* choice = choices_it.data();</div><div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>  unichar_ids[index] = choice-><a class="code" href="a02602.html#ad448095b666bfb864211714ec2c2375e">unichar_id</a>();</div><div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>  ratings[index] = choice-><a class="code" href="a02602.html#ab90b9f9f303420fee80622acd9d268f2">rating</a>();</div><div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>  ++index;</div><div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>  }</div><div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>  *num_matches_returned = index;</div><div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>  <span class="keyword">delete</span> choices;</div><div class="line"><a name="l03002"></a><span class="lineno"> 3002</span> }</div><div class="line"><a name="l03003"></a><span class="lineno"> 3003</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l03004"></a><span class="lineno"> 3004</span> </div><div class="line"><a name="l03005"></a><span class="lineno"> 3005</span> } <span class="comment">// namespace tesseract.</span></div><div class="ttc" id="a02266_html_a78ebdae52f3c685095b56790598ad97c"><div class="ttname"><a href="a02266.html#a78ebdae52f3c685095b56790598ad97c">OSResults::unicharset</a></div><div class="ttdeci">UNICHARSET * unicharset</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00080">osdetect.h:80</a></div></div>
<div class="ttc" id="a02358_html_a2888f59985750554a12f173073305ad3"><div class="ttname"><a href="a02358.html#a2888f59985750554a12f173073305ad3">tesseract::Tesseract::set_unlv_suspects</a></div><div class="ttdeci">void set_unlv_suspects(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00119_source.html#l00280">output.cpp:280</a></div></div>
<div class="ttc" id="a02186_html_ad7a9b7f45f94801d7891035bf38d4861"><div class="ttname"><a href="a02186.html#ad7a9b7f45f94801d7891035bf38d4861">tesseract::TessBaseAPI::GetLTRIterator</a></div><div class="ttdeci">TESS_LOCAL LTRResultIterator * GetLTRIterator()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01282">baseapi.cpp:1282</a></div></div>
<div class="ttc" id="a02546_html_a997c382ddd2cf2f539532a1d91780963"><div class="ttname"><a href="a02546.html#a997c382ddd2cf2f539532a1d91780963">PAGE_RES_IT::block</a></div><div class="ttdeci">BLOCK_RES * block() const</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00757">pageres.h:757</a></div></div>
<div class="ttc" id="a02358_html_a512809e371c7bff1a24bb531721010a3"><div class="ttname"><a href="a02358.html#a512809e371c7bff1a24bb531721010a3">tesseract::Tesseract::mutable_pix_binary</a></div><div class="ttdeci">Pix ** mutable_pix_binary()</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00197">tesseractclass.h:197</a></div></div>
<div class="ttc" id="a04290_html_a21e49c729a6736b418f49014ac25b596"><div class="ttname"><a href="a04290.html#a21e49c729a6736b418f49014ac25b596">tesseract::Dict::GlobalDawgCache</a></div><div class="ttdeci">static DawgCache * GlobalDawgCache()</div><div class="ttdef"><b>Definition:</b> <a href="a00905_source.html#l00193">dict.cpp:193</a></div></div>
<div class="ttc" id="a02358_html_aab153649250a4b8bd6ffb4e22f44f79f"><div class="ttname"><a href="a02358.html#aab153649250a4b8bd6ffb4e22f44f79f">tesseract::Tesseract::MaximallyChopWord</a></div><div class="ttdeci">void MaximallyChopWord(const GenericVector< TBOX > &boxes, BLOCK *block, ROW *row, WERD_RES *word_res)</div></div>
<div class="ttc" id="a00524_html"><div class="ttname"><a href="a00524.html">globaloc.h</a></div></div>
<div class="ttc" id="a02186_html_a86899716a1adde396be4efd57b547d27"><div class="ttname"><a href="a02186.html#a86899716a1adde396be4efd57b547d27">tesseract::TessBaseAPI::FindLines</a></div><div class="ttdeci">TESS_LOCAL int FindLines()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02389">baseapi.cpp:2389</a></div></div>
<div class="ttc" id="a02358_html_a6193fb469b62b12c1b999194fc5cd569"><div class="ttname"><a href="a02358.html#a6193fb469b62b12c1b999194fc5cd569">tesseract::Tesseract::ReSegmentByClassification</a></div><div class="ttdeci">void ReSegmentByClassification(PAGE_RES *page_res)</div></div>
<div class="ttc" id="a02186_html_a7762996878d9588a72e76de414af9773"><div class="ttname"><a href="a02186.html#a7762996878d9588a72e76de414af9773">tesseract::TessBaseAPI::GetLoadedLanguagesAsVector</a></div><div class="ttdeci">void GetLoadedLanguagesAsVector(GenericVector< STRING > *langs) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00456">baseapi.cpp:456</a></div></div>
<div class="ttc" id="a02186_html_af997008815be7af2edcd9ff1a5d55896"><div class="ttname"><a href="a02186.html#af997008815be7af2edcd9ff1a5d55896">tesseract::TessBaseAPI::SetOutputName</a></div><div class="ttdeci">void SetOutputName(const char *name)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00286">baseapi.cpp:286</a></div></div>
<div class="ttc" id="a02186_html_a61c5592b57a1b776416e643e2719a751"><div class="ttname"><a href="a02186.html#a61c5592b57a1b776416e643e2719a751">tesseract::TessBaseAPI::GetPageSegMode</a></div><div class="ttdeci">PageSegMode GetPageSegMode() const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00536">baseapi.cpp:536</a></div></div>
<div class="ttc" id="a02186_html_aed3d481fc0c7dffad24572bd1f449598"><div class="ttname"><a href="a02186.html#aed3d481fc0c7dffad24572bd1f449598">tesseract::TessBaseAPI::TextLength</a></div><div class="ttdeci">TESS_LOCAL int TextLength(int *blob_count)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02491">baseapi.cpp:2491</a></div></div>
<div class="ttc" id="a02358_html_ab0c56686c9d207a42e67ba1f8c31a00b"><div class="ttname"><a href="a02358.html#ab0c56686c9d207a42e67ba1f8c31a00b">tesseract::Tesseract::tessedit_write_images</a></div><div class="ttdeci">bool tessedit_write_images</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01088">tesseractclass.h:1088</a></div></div>
<div class="ttc" id="a00605_html_afedceee7ea132dae3d224db2cf8b5618"><div class="ttname"><a href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a></div><div class="ttdeci">int UNICHAR_ID</div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00035">unichar.h:35</a></div></div>
<div class="ttc" id="a02358_html_a2f72a5b81529df216d9422ff92ab2762"><div class="ttname"><a href="a02358.html#a2f72a5b81529df216d9422ff92ab2762">tesseract::Tesseract::SegmentPage</a></div><div class="ttdeci">int SegmentPage(const STRING *input_file, BLOCK_LIST *blocks, Tesseract *osd_tess, OSResults *osr)</div><div class="ttdef"><b>Definition:</b> <a href="a00131_source.html#l00100">pagesegmain.cpp:100</a></div></div>
<div class="ttc" id="a00110_html"><div class="ttname"><a href="a00110.html">mutableiterator.h</a></div></div>
<div class="ttc" id="a02278_html_a459b75dc035557448d27a73f74682e2a"><div class="ttname"><a href="a02278.html#a459b75dc035557448d27a73f74682e2a">tesseract::PageIterator::BlockType</a></div><div class="ttdeci">PolyBlockType BlockType() const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00359">pageiterator.cpp:359</a></div></div>
<div class="ttc" id="a01629_html_aa011b40b5e90b4087d0e42ea5fcce12c"><div class="ttname"><a href="a01629.html#aa011b40b5e90b4087d0e42ea5fcce12c">tesseract::ExtractFontName</a></div><div class="ttdeci">void ExtractFontName(const STRING &filename, STRING *fontname)</div><div class="ttdef"><b>Definition:</b> <a href="a00650_source.html#l00047">blobclass.cpp:47</a></div></div>
<div class="ttc" id="a02358_html_a03e51d9200586d7164574b8ae9498d69"><div class="ttname"><a href="a02358.html#a03e51d9200586d7164574b8ae9498d69">tesseract::Tesseract::pix_grey</a></div><div class="ttdeci">Pix * pix_grey() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00204">tesseractclass.h:204</a></div></div>
<div class="ttc" id="a02398_html_a7b6051e1c1934265a91e1ee864bd5164"><div class="ttname"><a href="a02398.html#a7b6051e1c1934265a91e1ee864bd5164">TBLOB::PolygonalCopy</a></div><div class="ttdeci">static TBLOB * PolygonalCopy(bool allow_detailed_fx, C_BLOB *src)</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00337">blobs.cpp:337</a></div></div>
<div class="ttc" id="a03998_html_acf0658a5a3cf8ebc7d29f2b9213a8884"><div class="ttname"><a href="a03998.html#acf0658a5a3cf8ebc7d29f2b9213a8884">tesseract::Classify::InitAdaptiveClassifier</a></div><div class="ttdeci">void InitAdaptiveClassifier(TessdataManager *mgr)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00528">adaptmatch.cpp:528</a></div></div>
<div class="ttc" id="a02182_html_a20cfad5c58c50cb85a9529d8ddbd96af"><div class="ttname"><a href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">GenericVector::size</a></div><div class="ttdeci">int size() const</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00071">genericvector.h:71</a></div></div>
<div class="ttc" id="a00593_html"><div class="ttname"><a href="a00593.html">tessdatamanager.h</a></div></div>
<div class="ttc" id="a02186_html_a15a7a9c1afbba3078a55b4566de891ab"><div class="ttname"><a href="a02186.html#a15a7a9c1afbba3078a55b4566de891ab">tesseract::TessBaseAPI::SetPageSegMode</a></div><div class="ttdeci">void SetPageSegMode(PageSegMode mode)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00529">baseapi.cpp:529</a></div></div>
<div class="ttc" id="a01625_html_ga7fffd7934197b7c9ac91db5aac09bf78"><div class="ttname"><a href="a01625.html#ga7fffd7934197b7c9ac91db5aac09bf78">tesseract::TessBaseAPI::GetHOCRText</a></div><div class="ttdeci">char * GetHOCRText(ETEXT_DESC *monitor, int page_number)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01485">baseapi.cpp:1485</a></div></div>
<div class="ttc" id="a01625_html_ga0e4065c20b142d69a2324ee0c74ae0b0"><div class="ttname"><a href="a01625.html#ga0e4065c20b142d69a2324ee0c74ae0b0">tesseract::TessBaseAPI::Recognize</a></div><div class="ttdeci">int Recognize(ETEXT_DESC *monitor)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00844">baseapi.cpp:844</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a3e63980691bf64801c704f59bd795bd9">tesseract::RIL_PARA</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00221">publictypes.h:221</a></div></div>
<div class="ttc" id="a02186_html_a20c9b24d670ab01dd7f011727b7a8daa"><div class="ttname"><a href="a02186.html#a20c9b24d670ab01dd7f011727b7a8daa">tesseract::TessBaseAPI::SetDebugVariable</a></div><div class="ttdeci">bool SetDebugVariable(const char *name, const char *value)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00299">baseapi.cpp:299</a></div></div>
<div class="ttc" id="a02346_html_a17891e56b5a812ee7728300dac362b40"><div class="ttname"><a href="a02346.html#a17891e56b5a812ee7728300dac362b40">tesseract::ResultIterator::ParagraphIsLtr</a></div><div class="ttdeci">bool ParagraphIsLtr() const</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00055">resultiterator.cpp:55</a></div></div>
<div class="ttc" id="a00491_html"><div class="ttname"><a href="a00491.html">elst.h</a></div></div>
<div class="ttc" id="a00014_html_aa8cecfc5c5c054d2875c03e77b7be15d"><div class="ttname"><a href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a></div><div class="ttdeci">#define TRUE</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00051">capi.h:51</a></div></div>
<div class="ttc" id="a00191_html"><div class="ttname"><a href="a00191.html">tesseractclass.h</a></div></div>
<div class="ttc" id="a00356_html"><div class="ttname"><a href="a00356.html">pdblock.h</a></div></div>
<div class="ttc" id="a02790_html_a22c42b48d2c626d2f3f3b0abd21bc902"><div class="ttname"><a href="a02790.html#a22c42b48d2c626d2f3f3b0abd21bc902">tesseract::ParamsVectors::int_params</a></div><div class="ttdeci">GenericVector< IntParam * > int_params</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00044">params.h:44</a></div></div>
<div class="ttc" id="a01073_html"><div class="ttname"><a href="a01073.html">openclwrapper.h</a></div></div>
<div class="ttc" id="a02362_html_a6273ef2894757191288f857702fdd044"><div class="ttname"><a href="a02362.html#a6273ef2894757191288f857702fdd044">tesseract::ImageThresholder::SetImage</a></div><div class="ttdeci">void SetImage(const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00063">thresholder.cpp:63</a></div></div>
<div class="ttc" id="a02790_html_a6bb13133287d8d8d18c81bb974b1b54f"><div class="ttname"><a href="a02790.html#a6bb13133287d8d8d18c81bb974b1b54f">tesseract::ParamsVectors::bool_params</a></div><div class="ttdeci">GenericVector< BoolParam * > bool_params</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00045">params.h:45</a></div></div>
<div class="ttc" id="a03910_html_a714633da3ef653acb2485c059e2472e1"><div class="ttname"><a href="a03910.html#a714633da3ef653acb2485c059e2472e1">tesseract::UNICHAR::first_uni</a></div><div class="ttdeci">int first_uni() const</div><div class="ttdef"><b>Definition:</b> <a href="a00602_source.html#l00099">unichar.cpp:99</a></div></div>
<div class="ttc" id="a02794_html_ac9884aced9c9941e8df8763960d798c4"><div class="ttname"><a href="a02794.html#ac9884aced9c9941e8df8763960d798c4">tesseract::ParamUtils::PrintParams</a></div><div class="ttdeci">static void PrintParams(FILE *fp, const ParamsVectors *member_params)</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00171">params.cpp:171</a></div></div>
<div class="ttc" id="a00557_html_a442e7f541a050acf5ebda026db177877"><div class="ttname"><a href="a00557.html#a442e7f541a050acf5ebda026db177877">BOOL_VAR</a></div><div class="ttdeci">#define BOOL_VAR(name, val, comment)</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00279">params.h:279</a></div></div>
<div class="ttc" id="a02802_html"><div class="ttname"><a href="a02802.html">tesseract::IntParam</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00142">params.h:142</a></div></div>
<div class="ttc" id="a01625_html_gac16fdadc30b12935b793be4a42ad8448"><div class="ttname"><a href="a01625.html#gac16fdadc30b12935b793be4a42ad8448">tesseract::TessBaseAPI::tesseract</a></div><div class="ttdeci">Tesseract * tesseract() const</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00783">baseapi.h:783</a></div></div>
<div class="ttc" id="a02602_html"><div class="ttname"><a href="a02602.html">BLOB_CHOICE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00049">ratngs.h:49</a></div></div>
<div class="ttc" id="a02186_html_a0386e985be293558230c5515e5612075"><div class="ttname"><a href="a02186.html#a0386e985be293558230c5515e5612075">tesseract::TessBaseAPI::GetInitLanguagesAsString</a></div><div class="ttdeci">const char * GetInitLanguagesAsString() const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00446">baseapi.cpp:446</a></div></div>
<div class="ttc" id="a00527_html"><div class="ttname"><a href="a00527.html">helpers.h</a></div></div>
<div class="ttc" id="a02358_html_a8c193bd6f78f20373ed9b0fb63984733"><div class="ttname"><a href="a02358.html#a8c193bd6f78f20373ed9b0fb63984733">tesseract::Tesseract::PrepareForTessOCR</a></div><div class="ttdeci">void PrepareForTessOCR(BLOCK_LIST *block_list, Tesseract *osd_tess, OSResults *osr)</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00655">tesseractclass.cpp:655</a></div></div>
<div class="ttc" id="a02546_html_a2038f4bd5c4c0eac4dba7f1d6bcdb5bf"><div class="ttname"><a href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">PAGE_RES_IT::row</a></div><div class="ttdeci">ROW_RES * row() const</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00754">pageres.h:754</a></div></div>
<div class="ttc" id="a03998_html_a2e861cf56ef6e2eb15a0f2a1544e738a"><div class="ttname"><a href="a03998.html#a2e861cf56ef6e2eb15a0f2a1544e738a">tesseract::Classify::ExtractFeatures</a></div><div class="ttdeci">static void ExtractFeatures(const TBLOB &blob, bool nonlinear_norm, GenericVector< INT_FEATURE_STRUCT > *bl_features, GenericVector< INT_FEATURE_STRUCT > *cn_features, INT_FX_RESULT_STRUCT *results, GenericVector< int > *outline_cn_counts)</div><div class="ttdef"><b>Definition:</b> <a href="a00722_source.html#l00444">intfx.cpp:444</a></div></div>
<div class="ttc" id="a00521_html_a372e5d26e8b39261140556e2b7e479d8"><div class="ttname"><a href="a00521.html#a372e5d26e8b39261140556e2b7e479d8">SavePixForCrash</a></div><div class="ttdeci">void SavePixForCrash(int resolution, Pix *pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00521_source.html#l00035">globaloc.cpp:35</a></div></div>
<div class="ttc" id="a00491_html_a6cf5144252ef24ea7bb5e0da1e698a0b"><div class="ttname"><a href="a00491.html#a6cf5144252ef24ea7bb5e0da1e698a0b">ELISTIZEH</a></div><div class="ttdeci">#define ELISTIZEH(CLASSNAME)</div><div class="ttdef"><b>Definition:</b> <a href="a00491_source.html#l00948">elst.h:948</a></div></div>
<div class="ttc" id="a01629_html_a338d4c8b5d497b5ec3e6e4269d8ac66aab76fe3ca390d99e070ea60b892ee18ef"><div class="ttname"><a href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aab76fe3ca390d99e070ea60b892ee18ef">tesseract::PSM_SINGLE_BLOCK</a></div><div class="ttdoc">Assume a single uniform block of text. (Default.) </div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00172">publictypes.h:172</a></div></div>
<div class="ttc" id="a04866_html_a143608f482c6c0c4f312740e6a5f5fd9"><div class="ttname"><a href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">tesseract::Wordrec::prev_word_best_choice_</a></div><div class="ttdeci">WERD_CHOICE * prev_word_best_choice_</div><div class="ttdef"><b>Definition:</b> <a href="a01622_source.html#l00481">wordrec.h:481</a></div></div>
<div class="ttc" id="a04290_html_a76420e183f59bb67851892dadb548c07"><div class="ttname"><a href="a04290.html#a76420e183f59bb67851892dadb548c07">tesseract::Dict::valid_word</a></div><div class="ttdeci">int valid_word(const WERD_CHOICE &word, bool numbers_ok) const</div><div class="ttdef"><b>Definition:</b> <a href="a00905_source.html#l00753">dict.cpp:753</a></div></div>
<div class="ttc" id="a00344_html"><div class="ttname"><a href="a00344.html">pageres.h</a></div></div>
<div class="ttc" id="a01629_html_a30bf30e24d408ea5baf9bbc83f9930e2"><div class="ttname"><a href="a01629.html#a30bf30e24d408ea5baf9bbc83f9930e2">tesseract::PSM_OSD_ENABLED</a></div><div class="ttdeci">bool PSM_OSD_ENABLED(int pageseg_mode)</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00191">publictypes.h:191</a></div></div>
<div class="ttc" id="a02358_html_ad939110e64fbd875014afa70ee72f43b"><div class="ttname"><a href="a02358.html#ad939110e64fbd875014afa70ee72f43b">tesseract::Tesseract::set_pix_original</a></div><div class="ttdeci">void set_pix_original(Pix *original_pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00213">tesseractclass.h:213</a></div></div>
<div class="ttc" id="a02358_html_a67d107ceaab00c9e98d6473d4024d409"><div class="ttname"><a href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">tesseract::Tesseract::getDict</a></div><div class="ttdeci">Dict & getDict() override</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00556">tesseractclass.cpp:556</a></div></div>
<div class="ttc" id="a01625_html_ga868852254450655bb2e1c61ca81bab83"><div class="ttname"><a href="a01625.html#ga868852254450655bb2e1c61ca81bab83">tesseract::TessBaseAPI::GetTSVText</a></div><div class="ttdeci">char * GetTSVText(int page_number)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01707">baseapi.cpp:1707</a></div></div>
<div class="ttc" id="a02358_html_a08c494cab700c493b52a3417b16e9afa"><div class="ttname"><a href="a02358.html#a08c494cab700c493b52a3417b16e9afa">tesseract::Tesseract::min_orientation_margin</a></div><div class="ttdeci">double min_orientation_margin</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01099">tesseractclass.h:1099</a></div></div>
<div class="ttc" id="a01629_html_af7e73b761f145b66ffcc7585ed69d940"><div class="ttname"><a href="a01629.html#af7e73b761f145b66ffcc7585ed69d940">tesseract::kUNLVSuspect</a></div><div class="ttdeci">const char kUNLVSuspect</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00103">baseapi.cpp:103</a></div></div>
<div class="ttc" id="a04290_html_ab24a33b89082414b75df5caa86bf6da8"><div class="ttname"><a href="a04290.html#ab24a33b89082414b75df5caa86bf6da8">tesseract::Dict::probability_in_context_</a></div><div class="ttdeci">double(Dict::* probability_in_context_)(const char *lang, const char *context, int context_bytes, const char *character, int character_bytes)</div><div class="ttdoc">Probability in context function used by the ngram permuter. </div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00369">dict.h:369</a></div></div>
<div class="ttc" id="a02358_html_ab7a5193af82a227f15b4811003960da2"><div class="ttname"><a href="a02358.html#ab7a5193af82a227f15b4811003960da2">tesseract::Tesseract::lstm_choice_mode</a></div><div class="ttdeci">int lstm_choice_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01125">tesseractclass.h:1125</a></div></div>
<div class="ttc" id="a01629_html_a99bec48b41ccb504c28851dbe5b1f106"><div class="ttname"><a href="a01629.html#a99bec48b41ccb504c28851dbe5b1f106">tesseract::kUNLVReject</a></div><div class="ttdeci">const char kUNLVReject</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00101">baseapi.cpp:101</a></div></div>
<div class="ttc" id="a02278_html_a5cc369eb577150a3a677f9c342ce1240"><div class="ttname"><a href="a02278.html#a5cc369eb577150a3a677f9c342ce1240">tesseract::PageIterator::Begin</a></div><div class="ttdeci">virtual void Begin()</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00106">pageiterator.cpp:106</a></div></div>
<div class="ttc" id="a01625_html_ga535728aa13f5f5eb66cbece59a7737e5"><div class="ttname"><a href="a01625.html#ga535728aa13f5f5eb66cbece59a7737e5">tesseract::TessBaseAPI::GetTextDirection</a></div><div class="ttdeci">bool GetTextDirection(int *out_offset, float *out_slope)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02249">baseapi.cpp:2249</a></div></div>
<div class="ttc" id="a01629_html_a0fc9989588ecf8f236da49b58f96a6c5a713c7bc13788ed69eb16dd9e5f309d12"><div class="ttname"><a href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5a713c7bc13788ed69eb16dd9e5f309d12">tesseract::SET_PARAM_CONSTRAINT_NON_INIT_ONLY</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00040">params.h:40</a></div></div>
<div class="ttc" id="a00503_html"><div class="ttname"><a href="a00503.html">errcode.h</a></div></div>
<div class="ttc" id="a02182_html_a999bbd8ff336c81fe1198ea714c7936d"><div class="ttname"><a href="a02182.html#a999bbd8ff336c81fe1198ea714c7936d">GenericVector::sort</a></div><div class="ttdeci">void sort()</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l01065">genericvector.h:1065</a></div></div>
<div class="ttc" id="a02610_html_abaa57ee82b89cfab6b80d3ac3d31bd60"><div class="ttname"><a href="a02610.html#abaa57ee82b89cfab6b80d3ac3d31bd60">TBOX::intersection</a></div><div class="ttdeci">TBOX intersection(const TBOX &box) const</div><div class="ttdef"><b>Definition:</b> <a href="a00404_source.html#l00087">rect.cpp:87</a></div></div>
<div class="ttc" id="a03910_html"><div class="ttname"><a href="a03910.html">tesseract::UNICHAR</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00058">unichar.h:58</a></div></div>
<div class="ttc" id="a02278_html_aae57ed588b6bffae18c15bc02fbe4f68"><div class="ttname"><a href="a02278.html#aae57ed588b6bffae18c15bc02fbe4f68">tesseract::PageIterator::BoundingBox</a></div><div class="ttdeci">bool BoundingBox(PageIteratorLevel level, int *left, int *top, int *right, int *bottom) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00326">pageiterator.cpp:326</a></div></div>
<div class="ttc" id="a01629_html_a929cce152875849d022496470235b437"><div class="ttname"><a href="a01629.html#a929cce152875849d022496470235b437">tesseract::kBytesPerNumber</a></div><div class="ttdeci">const int kBytesPerNumber</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01820">baseapi.cpp:1820</a></div></div>
<div class="ttc" id="a01629_html_a91558c5771a593a5c2e3e62e9ad8e822"><div class="ttname"><a href="a01629.html#a91558c5771a593a5c2e3e62e9ad8e822">tesseract::HOcrEscape</a></div><div class="ttdeci">STRING HOcrEscape(const char *text)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02632">baseapi.cpp:2632</a></div></div>
<div class="ttc" id="a00530_html"><div class="ttname"><a href="a00530.html">host.h</a></div></div>
<div class="ttc" id="a02362_html_a0b855cc35144b84f150bf39d5342d7f1"><div class="ttname"><a href="a02362.html#a0b855cc35144b84f150bf39d5342d7f1">tesseract::ImageThresholder::GetPixRect</a></div><div class="ttdeci">Pix * GetPixRect()</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00235">thresholder.cpp:235</a></div></div>
<div class="ttc" id="a02542_html_ae24eb58be06cf275aee411d947fd31ef"><div class="ttname"><a href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">WERD_RES::reject_map</a></div><div class="ttdeci">REJMAP reject_map</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00287">pageres.h:287</a></div></div>
<div class="ttc" id="a02786_html_a4844a3e9868a0fde7ad2fcaa37f5c5f1"><div class="ttname"><a href="a02786.html#a4844a3e9868a0fde7ad2fcaa37f5c5f1">ETEXT_DESC::cancel_this</a></div><div class="ttdeci">void * cancel_this</div><div class="ttdoc">monitor-aware progress callback </div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00132">ocrclass.h:132</a></div></div>
<div class="ttc" id="a02186_html_adc8316d75713a2abf5373f85f6f58a93"><div class="ttname"><a href="a02186.html#adc8316d75713a2abf5373f85f6f58a93">tesseract::TessBaseAPI::GetBoolVariable</a></div><div class="ttdeci">bool GetBoolVariable(const char *name, bool *value) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00313">baseapi.cpp:313</a></div></div>
<div class="ttc" id="a03950_html_a2c8e79b6fe0ac81f50d4f8d120278166"><div class="ttname"><a href="a03950.html#a2c8e79b6fe0ac81f50d4f8d120278166">UNICHARSET::get_script_from_script_id</a></div><div class="ttdeci">const char * get_script_from_script_id(int id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00849">unicharset.h:849</a></div></div>
<div class="ttc" id="a00449_html_ad6968adbf8f2cc44adf333ec96efb0bea675eadd051ea82d1f288751799bfa31c"><div class="ttname"><a href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea675eadd051ea82d1f288751799bfa31c">W_FUZZY_NON</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00042">werd.h:42</a></div></div>
<div class="ttc" id="a01629_html_a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0"><div class="ttname"><a href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0">tesseract::SET_PARAM_CONSTRAINT_DEBUG_ONLY</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00038">params.h:38</a></div></div>
<div class="ttc" id="a02834_html_abf0a7b3c6ae39a46e5441f28f61de5de"><div class="ttname"><a href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">STRING::string</a></div><div class="ttdeci">const char * string() const</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00196">strngs.cpp:196</a></div></div>
<div class="ttc" id="a03906_html_adde3e0fbebf692babd33bfe4c7eabeef"><div class="ttname"><a href="a03906.html#adde3e0fbebf692babd33bfe4c7eabeef">tesseract::TessdataManager::LoadMemBuffer</a></div><div class="ttdeci">bool LoadMemBuffer(const char *name, const char *data, int size)</div><div class="ttdef"><b>Definition:</b> <a href="a00590_source.html#l00066">tessdatamanager.cpp:66</a></div></div>
<div class="ttc" id="a03998_html_ab39a42222f621c9a5f1bd1b31db3a930"><div class="ttname"><a href="a03998.html#ab39a42222f621c9a5f1bd1b31db3a930">tesseract::Classify::AdaptiveClassifier</a></div><div class="ttdeci">void AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00192">adaptmatch.cpp:192</a></div></div>
<div class="ttc" id="a02186_html_a9d93e1d92ca230ae02b81d44bc88a55c"><div class="ttname"><a href="a02186.html#a9d93e1d92ca230ae02b81d44bc88a55c">tesseract::TessBaseAPI::thresholder_</a></div><div class="ttdeci">ImageThresholder * thresholder_</div><div class="ttdoc">Image thresholding module. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00874">baseapi.h:874</a></div></div>
<div class="ttc" id="a02186_html_ac5fdc031598e1237ec7e30c5efa95840"><div class="ttname"><a href="a02186.html#ac5fdc031598e1237ec7e30c5efa95840">tesseract::TessBaseAPI::InitLangMod</a></div><div class="ttdeci">int InitLangMod(const char *datapath, const char *language)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00487">baseapi.cpp:487</a></div></div>
<div class="ttc" id="a02638_html_ad35a2fd78555195a3dedcdd01094d0d4"><div class="ttname"><a href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">WERD::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00446_source.html#l00159">werd.cpp:159</a></div></div>
<div class="ttc" id="a02794_html_aecfd4f0112e3753b19c856d210fb8f69"><div class="ttname"><a href="a02794.html#aecfd4f0112e3753b19c856d210fb8f69">tesseract::ParamUtils::SetParam</a></div><div class="ttdeci">static bool SetParam(const char *name, const char *value, SetParamConstraint constraint, ParamsVectors *member_params)</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00089">params.cpp:89</a></div></div>
<div class="ttc" id="a02526_html_a8d6262ab8c857cb5c62fef75b2d96181"><div class="ttname"><a href="a02526.html#a8d6262ab8c857cb5c62fef75b2d96181">ROW::base_line</a></div><div class="ttdeci">float base_line(float xpos) const</div><div class="ttdef"><b>Definition:</b> <a href="a00332_source.html#l00059">ocrrow.h:59</a></div></div>
<div class="ttc" id="a03998_html_a57e449d38b255fe82e61d88ded8b0020"><div class="ttname"><a href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">tesseract::Classify::classify_bln_numeric_mode</a></div><div class="ttdeci">bool classify_bln_numeric_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00541">classify.h:541</a></div></div>
<div class="ttc" id="a00365_html_a6c8de73bb604d91743c7f6f356eb171e"><div class="ttname"><a href="a00365.html#a6c8de73bb604d91743c7f6f356eb171e">DIR</a></div><div class="ttdeci">#define DIR</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00044">polyaprx.cpp:44</a></div></div>
<div class="ttc" id="a02358_html_aa70b2ded9dec4174cac0c3475811629f"><div class="ttname"><a href="a02358.html#aa70b2ded9dec4174cac0c3475811629f">tesseract::Tesseract::init_tesseract_lm</a></div><div class="ttdeci">int init_tesseract_lm(const char *arg0, const char *textbase, const char *language, TessdataManager *mgr)</div><div class="ttdef"><b>Definition:</b> <a href="a00182_source.html#l00462">tessedit.cpp:462</a></div></div>
<div class="ttc" id="a02362_html_afe5b51a09de405a0fc04b1d72c3c908d"><div class="ttname"><a href="a02362.html#afe5b51a09de405a0fc04b1d72c3c908d">tesseract::ImageThresholder::Clear</a></div><div class="ttdeci">virtual void Clear()</div><div class="ttdoc">Destroy the Pix if there is one, freeing memory. </div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00046">thresholder.cpp:46</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a2dcea8d4208c16055353029d26f9bf49">tesseract::RIL_BLOCK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00220">publictypes.h:220</a></div></div>
<div class="ttc" id="a02514_html_ae9826e422b0bf17a7592dee8db3fe058"><div class="ttname"><a href="a02514.html#ae9826e422b0bf17a7592dee8db3fe058">BLOCK::row_list</a></div><div class="ttdeci">ROW_LIST * row_list()</div><div class="ttdoc">get rows </div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00118">ocrblock.h:118</a></div></div>
<div class="ttc" id="a02810_html"><div class="ttname"><a href="a02810.html">tesseract::StringParam</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00190">params.h:190</a></div></div>
<div class="ttc" id="a02610_html"><div class="ttname"><a href="a02610.html">TBOX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00034">rect.h:34</a></div></div>
<div class="ttc" id="a02358_html_a87360c517f48316e9817bdc8ede63d0e"><div class="ttname"><a href="a02358.html#a87360c517f48316e9817bdc8ede63d0e">tesseract::Tesseract::pix_original</a></div><div class="ttdeci">Pix * pix_original() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00211">tesseractclass.h:211</a></div></div>
<div class="ttc" id="a02526_html_ac9d07f978420b3564bf5508ad294fb70"><div class="ttname"><a href="a02526.html#ac9d07f978420b3564bf5508ad294fb70">ROW::word_list</a></div><div class="ttdeci">WERD_LIST * word_list()</div><div class="ttdef"><b>Definition:</b> <a href="a00332_source.html#l00055">ocrrow.h:55</a></div></div>
<div class="ttc" id="a00023_html"><div class="ttname"><a href="a00023.html">renderer.h</a></div></div>
<div class="ttc" id="a02794_html_a7cd09c9e0e69f8acbc519cc1c8bbbf17"><div class="ttname"><a href="a02794.html#a7cd09c9e0e69f8acbc519cc1c8bbbf17">tesseract::ParamUtils::ResetToDefaults</a></div><div class="ttdeci">static void ResetToDefaults(ParamsVectors *member_params)</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00196">params.cpp:196</a></div></div>
<div class="ttc" id="a02186_html_a33cf8d85c3714857bc8753fef035ea95"><div class="ttname"><a href="a02186.html#a33cf8d85c3714857bc8753fef035ea95">tesseract::TessBaseAPI::DetectParagraphs</a></div><div class="ttdeci">TESS_LOCAL void DetectParagraphs(bool after_text_recognition)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02600">baseapi.cpp:2600</a></div></div>
<div class="ttc" id="a02618_html_adb462d55dc4b682e0a77090185a58011"><div class="ttname"><a href="a02618.html#adb462d55dc4b682e0a77090185a58011">REJMAP::length</a></div><div class="ttdeci">int32_t length() const</div><div class="ttdef"><b>Definition:</b> <a href="a00413_source.html#l00223">rejctmap.h:223</a></div></div>
<div class="ttc" id="a00362_html"><div class="ttname"><a href="a00362.html">points.h</a></div></div>
<div class="ttc" id="a00449_html_ad6968adbf8f2cc44adf333ec96efb0bea62efb985a62d85e014ee5ab039dd50ce"><div class="ttname"><a href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea62efb985a62d85e014ee5ab039dd50ce">W_EOL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00035">werd.h:35</a></div></div>
<div class="ttc" id="a02186_html_ac22c36258b0cd727188505a9a1dbc7e1"><div class="ttname"><a href="a02186.html#ac22c36258b0cd727188505a9a1dbc7e1">tesseract::TessBaseAPI::block_list_</a></div><div class="ttdeci">BLOCK_LIST * block_list_</div><div class="ttdoc">The page layout. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00876">baseapi.h:876</a></div></div>
<div class="ttc" id="a01625_html_ga58cc9fcbd423459db097f912e08d524f"><div class="ttname"><a href="a01625.html#ga58cc9fcbd423459db097f912e08d524f">tesseract::TessBaseAPI::RunAdaptiveClassifier</a></div><div class="ttdeci">void RunAdaptiveClassifier(TBLOB *blob, int num_max_matches, int *unichar_ids, float *ratings, int *num_matches_returned)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02982">baseapi.cpp:2982</a></div></div>
<div class="ttc" id="a02790_html_a446a70d7d7c85af255d053ae54c5df8a"><div class="ttname"><a href="a02790.html#a446a70d7d7c85af255d053ae54c5df8a">tesseract::ParamsVectors::string_params</a></div><div class="ttdeci">GenericVector< StringParam * > string_params</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00046">params.h:46</a></div></div>
<div class="ttc" id="a00314_html_af974e6755e636c8bc7cbe57e3bcbdd73"><div class="ttname"><a href="a00314.html#af974e6755e636c8bc7cbe57e3bcbdd73">kBlnXHeight</a></div><div class="ttdeci">const int kBlnXHeight</div><div class="ttdef"><b>Definition:</b> <a href="a00314_source.html#l00024">normalis.h:24</a></div></div>
<div class="ttc" id="a02186_html_ad7b44f5b470c9e04289c348d82726b27"><div class="ttname"><a href="a02186.html#ad7b44f5b470c9e04289c348d82726b27">tesseract::TessBaseAPI::osd_tesseract_</a></div><div class="ttdeci">Tesseract * osd_tesseract_</div><div class="ttdoc">For orientation & script detection. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00871">baseapi.h:871</a></div></div>
<div class="ttc" id="a02358_html_a62f5e64459a2d2a15526c3229c12e6a0"><div class="ttname"><a href="a02358.html#a62f5e64459a2d2a15526c3229c12e6a0">tesseract::Tesseract::tessedit_resegment_from_boxes</a></div><div class="ttdeci">bool tessedit_resegment_from_boxes</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00811">tesseractclass.h:811</a></div></div>
<div class="ttc" id="a02358_html_a689717c48a88c667883d31a5b03139bc"><div class="ttname"><a href="a02358.html#a689717c48a88c667883d31a5b03139bc">tesseract::Tesseract::ApplyBoxTraining</a></div><div class="ttdeci">void ApplyBoxTraining(const STRING &fontname, PAGE_RES *page_res)</div></div>
<div class="ttc" id="a02362_html_a0a01ac88f9d1193ebb80c96a09a9b01f"><div class="ttname"><a href="a02362.html#a0a01ac88f9d1193ebb80c96a09a9b01f">tesseract::ImageThresholder::GetPixRectGrey</a></div><div class="ttdeci">virtual Pix * GetPixRectGrey()</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00252">thresholder.cpp:252</a></div></div>
<div class="ttc" id="a04130_html"><div class="ttname"><a href="a04130.html">INT_FEATURE_STRUCT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00737_source.html#l00132">intproto.h:132</a></div></div>
<div class="ttc" id="a02178_html_afe67e07224557403466b301b29acb124"><div class="ttname"><a href="a02178.html#afe67e07224557403466b301b29acb124">tesseract::TESS_CHAR::~TESS_CHAR</a></div><div class="ttdeci">~TESS_CHAR()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02820">baseapi.cpp:2820</a></div></div>
<div class="ttc" id="a02358_html_a2c7fb16774479af5df8e8102aaa86ca1"><div class="ttname"><a href="a02358.html#a2c7fb16774479af5df8e8102aaa86ca1">tesseract::Tesseract::set_pix_grey</a></div><div class="ttdeci">void set_pix_grey(Pix *grey_pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00207">tesseractclass.h:207</a></div></div>
<div class="ttc" id="a02186_html_a17820a43c31b66c3a12eda59e0b51bba"><div class="ttname"><a href="a02186.html#a17820a43c31b66c3a12eda59e0b51bba">tesseract::TessBaseAPI::InternalSetImage</a></div><div class="ttdeci">TESS_LOCAL bool InternalSetImage()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02317">baseapi.cpp:2317</a></div></div>
<div class="ttc" id="a00605_html_abc3119a959ecd5cffc1d9b9d57479dbaa5978cd698552a6106db1bf6528617317"><div class="ttname"><a href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa5978cd698552a6106db1bf6528617317">DIR_LEFT_TO_RIGHT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00044">unichar.h:44</a></div></div>
<div class="ttc" id="a03950_html_aeb2253dcb5f01c81fcba5f4af417eadf"><div class="ttname"><a href="a03950.html#aeb2253dcb5f01c81fcba5f4af417eadf">UNICHARSET::unichar_to_id</a></div><div class="ttdeci">UNICHAR_ID unichar_to_id(const char *const unichar_repr) const</div><div class="ttdef"><b>Definition:</b> <a href="a00620_source.html#l00209">unicharset.cpp:209</a></div></div>
<div class="ttc" id="a02578_html_aab5b14bc328998adc252ffe7476d7f22"><div class="ttname"><a href="a02578.html#aab5b14bc328998adc252ffe7476d7f22">FCOORD::angle</a></div><div class="ttdeci">float angle() const</div><div class="ttdoc">find angle </div><div class="ttdef"><b>Definition:</b> <a href="a00362_source.html#l00248">points.h:248</a></div></div>
<div class="ttc" id="a01625_html_ga5520fb5647d0696717e9ecbd86dc0067"><div class="ttname"><a href="a01625.html#ga5520fb5647d0696717e9ecbd86dc0067">tesseract::TessBaseAPI::GetFeaturesForBlob</a></div><div class="ttdeci">void GetFeaturesForBlob(TBLOB *blob, INT_FEATURE_STRUCT *int_features, int *num_features, int *feature_outline_index)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02929">baseapi.cpp:2929</a></div></div>
<div class="ttc" id="a02514_html_a23196fe0d7230572b44aa77031a1d72a"><div class="ttname"><a href="a02514.html#a23196fe0d7230572b44aa77031a1d72a">BLOCK::blob_list</a></div><div class="ttdeci">C_BLOB_LIST * blob_list()</div><div class="ttdoc">get blobs </div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00130">ocrblock.h:130</a></div></div>
<div class="ttc" id="a01627_html_ga31dbaec91a5dd8ee7d399786a4bd5ef8"><div class="ttname"><a href="a01627.html#ga31dbaec91a5dd8ee7d399786a4bd5ef8">tesseract::TessBaseAPI::rect_width_</a></div><div class="ttdeci">int rect_width_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00893">baseapi.h:893</a></div></div>
<div class="ttc" id="a02606_html_afa672748d2585eea64ab79592dd02eb3"><div class="ttname"><a href="a02606.html#afa672748d2585eea64ab79592dd02eb3">WERD_CHOICE::rating</a></div><div class="ttdeci">float rating() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00327">ratngs.h:327</a></div></div>
<div class="ttc" id="a02346_html_a22f65a94be27435440673d7c750808fb"><div class="ttname"><a href="a02346.html#a22f65a94be27435440673d7c750808fb">tesseract::ResultIterator::GetUTF8Text</a></div><div class="ttdeci">virtual char * GetUTF8Text(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00564">resultiterator.cpp:564</a></div></div>
<div class="ttc" id="a00587_html_ad000c6729bae0f97075ca10a0b5bf7d6"><div class="ttname"><a href="a00587.html#ad000c6729bae0f97075ca10a0b5bf7d6">NewPermanentTessCallback</a></div><div class="ttdeci">_ConstTessMemberResultCallback_0_0< false, R, T1 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)() const)</div><div class="ttdef"><b>Definition:</b> <a href="a00587_source.html#l00116">tesscallback.h:116</a></div></div>
<div class="ttc" id="a01625_html_ga12273df6a36cd7b618029c21d0c53cfa"><div class="ttname"><a href="a01625.html#ga12273df6a36cd7b618029c21d0c53cfa">tesseract::TessBaseAPI::FindLinesCreateBlockList</a></div><div class="ttdeci">BLOCK_LIST * FindLinesCreateBlockList()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02656">baseapi.cpp:2656</a></div></div>
<div class="ttc" id="a02606_html_acea3ee4af3377da8f4c10627e4ba42cf"><div class="ttname"><a href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">WERD_CHOICE::certainty</a></div><div class="ttdeci">float certainty() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00330">ratngs.h:330</a></div></div>
<div class="ttc" id="a00314_html_abe10ce41bf7240ae8a053dea471d6ed5"><div class="ttname"><a href="a00314.html#abe10ce41bf7240ae8a053dea471d6ed5">kBlnBaselineOffset</a></div><div class="ttdeci">const int kBlnBaselineOffset</div><div class="ttdef"><b>Definition:</b> <a href="a00314_source.html#l00025">normalis.h:25</a></div></div>
<div class="ttc" id="a01073_html_a7b1e67112c5c3cc13ba8f90c8b60f05e"><div class="ttname"><a href="a01073.html#a7b1e67112c5c3cc13ba8f90c8b60f05e">PERF_COUNT_START</a></div><div class="ttdeci">#define PERF_COUNT_START(FUNCT_NAME)</div><div class="ttdef"><b>Definition:</b> <a href="a01073_source.html#l00134">openclwrapper.h:134</a></div></div>
<div class="ttc" id="a01625_html_ga115ef656f83352ba608b4f0bf9cfa2c4"><div class="ttname"><a href="a01625.html#ga115ef656f83352ba608b4f0bf9cfa2c4">tesseract::TessBaseAPI::GetUTF8Text</a></div><div class="ttdeci">char * GetUTF8Text()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01326">baseapi.cpp:1326</a></div></div>
<div class="ttc" id="a02542_html"><div class="ttname"><a href="a02542.html">WERD_RES</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00169">pageres.h:169</a></div></div>
<div class="ttc" id="a02362_html_a9750e2906caad2b016eea362b22fcbe1"><div class="ttname"><a href="a02362.html#a9750e2906caad2b016eea362b22fcbe1">tesseract::ImageThresholder::GetPixRectThresholds</a></div><div class="ttdeci">virtual Pix * GetPixRectThresholds()</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00208">thresholder.cpp:208</a></div></div>
<div class="ttc" id="a01629_html_afa62cc25480d6eee8b1bb2ef4a1f8fc3"><div class="ttname"><a href="a01629.html#afa62cc25480d6eee8b1bb2ef4a1f8fc3">tesseract::kUniChs</a></div><div class="ttdeci">const int kUniChs[]</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01885">baseapi.cpp:1885</a></div></div>
<div class="ttc" id="a02638_html_a5decd0b33533bf908c26ad4b10336fb0"><div class="ttname"><a href="a02638.html#a5decd0b33533bf908c26ad4b10336fb0">WERD::set_text</a></div><div class="ttdeci">void set_text(const char *new_text)</div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00124">werd.h:124</a></div></div>
<div class="ttc" id="a00605_html_a902bc40c9d89802bc063afe30ce9e708"><div class="ttname"><a href="a00605.html#a902bc40c9d89802bc063afe30ce9e708">UNICHAR_LEN</a></div><div class="ttdeci">#define UNICHAR_LEN</div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00031">unichar.h:31</a></div></div>
<div class="ttc" id="a00113_html_aec0e2284de8927ea9f29b61ff30d052a"><div class="ttname"><a href="a00113.html#aec0e2284de8927ea9f29b61ff30d052a">orientation_and_script_detection</a></div><div class="ttdeci">int orientation_and_script_detection(STRING &filename, OSResults *osr, tesseract::Tesseract *tess)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00190">osdetect.cpp:190</a></div></div>
<div class="ttc" id="a00584_html"><div class="ttname"><a href="a00584.html">strngs.h</a></div></div>
<div class="ttc" id="a01625_html_ga36a739bd0dc23a819170ca40f35c4b58"><div class="ttname"><a href="a01625.html#ga36a739bd0dc23a819170ca40f35c4b58">tesseract::TessBaseAPI::SetFillLatticeFunc</a></div><div class="ttdeci">void SetFillLatticeFunc(FillLatticeFunc f)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02311">baseapi.cpp:2311</a></div></div>
<div class="ttc" id="a02186_html_a0b6ce89d83566df247cb112bcc58fabe"><div class="ttname"><a href="a02186.html#a0b6ce89d83566df247cb112bcc58fabe">tesseract::TessBaseAPI::Threshold</a></div><div class="ttdeci">virtual TESS_LOCAL bool Threshold(Pix **pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02334">baseapi.cpp:2334</a></div></div>
<div class="ttc" id="a02530_html"><div class="ttname"><a href="a02530.html">PAGE_RES</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00077">pageres.h:77</a></div></div>
<div class="ttc" id="a02362_html_a5e18e1384335b76f63ba3508ae048925"><div class="ttname"><a href="a02362.html#a5e18e1384335b76f63ba3508ae048925">tesseract::ImageThresholder::IsEmpty</a></div><div class="ttdeci">bool IsEmpty() const</div><div class="ttdoc">Return true if no image has been set. </div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00051">thresholder.cpp:51</a></div></div>
<div class="ttc" id="a01625_html_gaa463622111f3b11d8fca5863709cc699"><div class="ttname"><a href="a01625.html#gaa463622111f3b11d8fca5863709cc699">tesseract::TessBaseAPI::SetImage</a></div><div class="ttdeci">void SetImage(const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00594">baseapi.cpp:594</a></div></div>
<div class="ttc" id="a00014_html_ae4cc35dcc70810fa972cc8a5185a28fa"><div class="ttname"><a href="a00014.html#ae4cc35dcc70810fa972cc8a5185a28fa">BOOL</a></div><div class="ttdeci">#define BOOL</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00050">capi.h:50</a></div></div>
<div class="ttc" id="a02250_html_a4ba498c7e88eeb2470216086eeb95f7e"><div class="ttname"><a href="a02250.html#a4ba498c7e88eeb2470216086eeb95f7e">tesseract::LTRResultIterator::WordRecognitionLanguage</a></div><div class="ttdeci">const char * WordRecognitionLanguage() const</div><div class="ttdef"><b>Definition:</b> <a href="a00101_source.html#l00198">ltrresultiterator.cpp:198</a></div></div>
<div class="ttc" id="a02638_html_a43b4c52165d4b7fd811eb653c2aa9d8e"><div class="ttname"><a href="a02638.html#a43b4c52165d4b7fd811eb653c2aa9d8e">WERD::space</a></div><div class="ttdeci">uint8_t space()</div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00102">werd.h:102</a></div></div>
<div class="ttc" id="a00143_html"><div class="ttname"><a href="a00143.html">paragraphs.h</a></div></div>
<div class="ttc" id="a02178_html_a790acae1a0c7dcd6bf9622ee384d3e3c"><div class="ttname"><a href="a02178.html#a790acae1a0c7dcd6bf9622ee384d3e3c">tesseract::TESS_CHAR::TESS_CHAR</a></div><div class="ttdeci">TESS_CHAR()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02814">baseapi.cpp:2814</a></div></div>
<div class="ttc" id="a02810_html_a87f73f314269f6a105854984981a5f8d"><div class="ttname"><a href="a02810.html#a87f73f314269f6a105854984981a5f8d">tesseract::StringParam::string</a></div><div class="ttdeci">const char * string() const</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00202">params.h:202</a></div></div>
<div class="ttc" id="a02358_html_a7fc8d9323b89b20e8d153eef861266b8"><div class="ttname"><a href="a02358.html#a7fc8d9323b89b20e8d153eef861266b8">tesseract::Tesseract::tessedit_resegment_from_line_boxes</a></div><div class="ttdeci">bool tessedit_resegment_from_line_boxes</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00813">tesseractclass.h:813</a></div></div>
<div class="ttc" id="a02358_html_ab079fbbd71433f3de894f912e5b11e6d"><div class="ttname"><a href="a02358.html#ab079fbbd71433f3de894f912e5b11e6d">tesseract::Tesseract::tessedit_make_boxes_from_boxes</a></div><div class="ttdeci">bool tessedit_make_boxes_from_boxes</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00817">tesseractclass.h:817</a></div></div>
<div class="ttc" id="a02410_html_a94891d405fd3837d235bb8916df1c89e"><div class="ttname"><a href="a02410.html#a94891d405fd3837d235bb8916df1c89e">tesseract::BoxWord::BlobBox</a></div><div class="ttdeci">const TBOX & BlobBox(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00248_source.html#l00084">boxword.h:84</a></div></div>
<div class="ttc" id="a04866_html_a0382a424e4d9afd8deb57a0a5d288868"><div class="ttname"><a href="a04866.html#a0382a424e4d9afd8deb57a0a5d288868">tesseract::Wordrec::fill_lattice_</a></div><div class="ttdeci">void(Wordrec::* fill_lattice_)(const MATRIX &ratings, const WERD_CHOICE_LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle)</div><div class="ttdef"><b>Definition:</b> <a href="a01622_source.html#l00485">wordrec.h:485</a></div></div>
<div class="ttc" id="a02178_html_a26571c64aee9fc53688c36e7b636f442"><div class="ttname"><a href="a02178.html#a26571c64aee9fc53688c36e7b636f442">tesseract::TESS_CHAR::unicode_repr</a></div><div class="ttdeci">char * unicode_repr</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02803">baseapi.cpp:2803</a></div></div>
<div class="ttc" id="a04290_html_a82c256d078ecd1362de8764a5c3c4fa9"><div class="ttname"><a href="a04290.html#a82c256d078ecd1362de8764a5c3c4fa9">tesseract::Dict::NumDawgs</a></div><div class="ttdeci">int NumDawgs() const</div><div class="ttdoc">Return the number of dawgs in the dawgs_ vector. </div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00415">dict.h:415</a></div></div>
<div class="ttc" id="a02186_html_ab19ab050d998ca02561bb417eb6969c1"><div class="ttname"><a href="a02186.html#ab19ab050d998ca02561bb417eb6969c1">tesseract::TessBaseAPI::GetStringVariable</a></div><div class="ttdeci">const char * GetStringVariable(const char *name) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00321">baseapi.cpp:321</a></div></div>
<div class="ttc" id="a00206_html"><div class="ttname"><a href="a00206.html">thresholder.h</a></div></div>
<div class="ttc" id="a01629_html_a6007ea2fe11067865156fb804c36079e"><div class="ttname"><a href="a01629.html#a6007ea2fe11067865156fb804c36079e">tesseract::kBytesPer64BitNumber</a></div><div class="ttdeci">const int kBytesPer64BitNumber</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01828">baseapi.cpp:1828</a></div></div>
<div class="ttc" id="a01626_html_ga158cc2af7170f3efa8cb140f2745d9b8"><div class="ttname"><a href="a01626.html#ga158cc2af7170f3efa8cb140f2745d9b8">tesseract::TessBaseAPI::RecognitionPass2</a></div><div class="ttdeci">TESS_LOCAL PAGE_RES * RecognitionPass2(BLOCK_LIST *block_list, PAGE_RES *pass1_result)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02793">baseapi.cpp:2793</a></div></div>
<div class="ttc" id="a01625_html_gab73311ecd1bf8f7e6f98585a76328740"><div class="ttname"><a href="a01625.html#gab73311ecd1bf8f7e6f98585a76328740">tesseract::TessBaseAPI::FindRowForBox</a></div><div class="ttdeci">static ROW * FindRowForBox(BLOCK_LIST *blocks, int left, int top, int right, int bottom)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02957">baseapi.cpp:2957</a></div></div>
<div class="ttc" id="a02178_html_a1ca1136f40f70eb41350f7cd5d65a244"><div class="ttname"><a href="a02178.html#a1ca1136f40f70eb41350f7cd5d65a244">tesseract::TESS_CHAR::box</a></div><div class="ttdeci">TBOX box</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02806">baseapi.cpp:2806</a></div></div>
<div class="ttc" id="a01625_html_gaadda8cd6abe770d2f6a70a18329b1973"><div class="ttname"><a href="a01625.html#gaadda8cd6abe770d2f6a70a18329b1973">tesseract::TessBaseAPI::GetBoxText</a></div><div class="ttdeci">char * GetBoxText(int page_number)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01844">baseapi.cpp:1844</a></div></div>
<div class="ttc" id="a02362_html_adce88ad081b8ab379cb286a0dd0e8845"><div class="ttname"><a href="a02362.html#adce88ad081b8ab379cb286a0dd0e8845">tesseract::ImageThresholder::GetScaleFactor</a></div><div class="ttdeci">int GetScaleFactor() const</div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00079">thresholder.h:79</a></div></div>
<div class="ttc" id="a01625_html_gaee19c9ea78a647420bbe99a447569995"><div class="ttname"><a href="a01625.html#gaee19c9ea78a647420bbe99a447569995">tesseract::TessBaseAPI::GetThresholdedImage</a></div><div class="ttdeci">Pix * GetThresholdedImage()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00649">baseapi.cpp:649</a></div></div>
<div class="ttc" id="a02186_html_a23d63e2cac00b958eb8803cab4943b4c"><div class="ttname"><a href="a02186.html#a23d63e2cac00b958eb8803cab4943b4c">tesseract::TessBaseAPI::InitForAnalysePage</a></div><div class="ttdeci">void InitForAnalysePage()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00501">baseapi.cpp:501</a></div></div>
<div class="ttc" id="a02178_html_a59dbd81cf9a36e402f6bbecee62c1bb3"><div class="ttname"><a href="a02178.html#a59dbd81cf9a36e402f6bbecee62c1bb3">tesseract::TESS_CHAR::cost</a></div><div class="ttdeci">float cost</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02805">baseapi.cpp:2805</a></div></div>
<div class="ttc" id="a01629_html_a75942705a59f93c72298f0c0444f9325"><div class="ttname"><a href="a01629.html#a75942705a59f93c72298f0c0444f9325">tesseract::DictFunc</a></div><div class="ttdeci">int(Dict::* DictFunc)(void *void_dawg_args, const UNICHARSET &unicharset, UNICHAR_ID unichar_id, bool word_end) const</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00076">baseapi.h:76</a></div></div>
<div class="ttc" id="a02190_html_a8f910e5251ee7ebd65f69072b358b445"><div class="ttname"><a href="a02190.html#a8f910e5251ee7ebd65f69072b358b445">tesseract::TessResultRenderer::BeginDocument</a></div><div class="ttdeci">bool BeginDocument(const char *title)</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00072">renderer.cpp:72</a></div></div>
<div class="ttc" id="a01625_html_gaf2b4f88c53457fa5153dc80f5a60e152"><div class="ttname"><a href="a01625.html#gaf2b4f88c53457fa5153dc80f5a60e152">tesseract::TessBaseAPI::GetConnectedComponents</a></div><div class="ttdeci">Boxa * GetConnectedComponents(Pixa **cc)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00708">baseapi.cpp:708</a></div></div>
<div class="ttc" id="a00599_html"><div class="ttname"><a href="a00599.html">tprintf.h</a></div></div>
<div class="ttc" id="a02346_html_a5c0e0a27f1cd412fd07332959056e69e"><div class="ttname"><a href="a02346.html#a5c0e0a27f1cd412fd07332959056e69e">tesseract::ResultIterator::GetBestLSTMSymbolChoices</a></div><div class="ttdeci">virtual std::vector< std::vector< std::pair< const char *, float > > > * GetBestLSTMSymbolChoices() const</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00607">resultiterator.cpp:607</a></div></div>
<div class="ttc" id="a02262_html_ae39a2c718b010ed27eb7f820546da6d6"><div class="ttname"><a href="a02262.html#ae39a2c718b010ed27eb7f820546da6d6">OSBestResult::sconfidence</a></div><div class="ttdeci">float sconfidence</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00045">osdetect.h:45</a></div></div>
<div class="ttc" id="a02186_html_aa40487f19e71221f05bb3ad5dd36c437"><div class="ttname"><a href="a02186.html#aa40487f19e71221f05bb3ad5dd36c437">tesseract::TessBaseAPI::GetVariableAsString</a></div><div class="ttdeci">bool GetVariableAsString(const char *name, STRING *val)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00336">baseapi.cpp:336</a></div></div>
<div class="ttc" id="a02266_html_a25f64011ea65c038c1ef1a6cedd10f1c"><div class="ttname"><a href="a02266.html#a25f64011ea65c038c1ef1a6cedd10f1c">OSResults::best_result</a></div><div class="ttdeci">OSBestResult best_result</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00081">osdetect.h:81</a></div></div>
<div class="ttc" id="a02362_html"><div class="ttname"><a href="a02362.html">tesseract::ImageThresholder</a></div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00036">thresholder.h:36</a></div></div>
<div class="ttc" id="a02186_html_a212b46c962fc197a316e366de937ba96"><div class="ttname"><a href="a02186.html#a212b46c962fc197a316e366de937ba96">tesseract::TessBaseAPI::GetDatapath</a></div><div class="ttdeci">const char * GetDatapath()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00978">baseapi.cpp:978</a></div></div>
<div class="ttc" id="a01629_html_a1083ed81b6adbb6930e87d0c58671e26"><div class="ttname"><a href="a01629.html#a1083ed81b6adbb6930e87d0c58671e26">tesseract::kTesseractReject</a></div><div class="ttdeci">const char kTesseractReject</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00099">baseapi.cpp:99</a></div></div>
<div class="ttc" id="a01625_html_ga34314bb3635a6e0d171e33d4b4181db2"><div class="ttname"><a href="a01625.html#ga34314bb3635a6e0d171e33d4b4181db2">tesseract::TessBaseAPI::GetUnichar</a></div><div class="ttdeci">const char * GetUnichar(int unichar_id)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02616">baseapi.cpp:2616</a></div></div>
<div class="ttc" id="a02362_html_a8e9f61a2ab3883e370cb91b870c3d4ec"><div class="ttname"><a href="a02362.html#a8e9f61a2ab3883e370cb91b870c3d4ec">tesseract::ImageThresholder::GetScaledYResolution</a></div><div class="ttdeci">int GetScaledYResolution() const</div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00093">thresholder.h:93</a></div></div>
<div class="ttc" id="a02262_html_a6dfb6826b41a81524ce867b005ba5641"><div class="ttname"><a href="a02262.html#a6dfb6826b41a81524ce867b005ba5641">OSBestResult::orientation_id</a></div><div class="ttdeci">int orientation_id</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00043">osdetect.h:43</a></div></div>
<div class="ttc" id="a02358_html_a51f1cb37c2fff5e2ade385b160c3a0e3"><div class="ttname"><a href="a02358.html#a51f1cb37c2fff5e2ade385b160c3a0e3">tesseract::Tesseract::interactive_display_mode</a></div><div class="ttdeci">bool interactive_display_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01089">tesseractclass.h:1089</a></div></div>
<div class="ttc" id="a02834_html_a552838a146145cb7993f42aefb740ea4"><div class="ttname"><a href="a02834.html#a552838a146145cb7993f42aefb740ea4">STRING::c_str</a></div><div class="ttdeci">const char * c_str() const</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00207">strngs.cpp:207</a></div></div>
<div class="ttc" id="a02182_html_a9cdbff49b186574b83e43afba606fdd9"><div class="ttname"><a href="a02182.html#a9cdbff49b186574b83e43afba606fdd9">GenericVector::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00868">genericvector.h:868</a></div></div>
<div class="ttc" id="a02358_html_a55a27935c2314529c6fb4522ccf1de5a"><div class="ttname"><a href="a02358.html#a55a27935c2314529c6fb4522ccf1de5a">tesseract::Tesseract::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00569">tesseractclass.cpp:569</a></div></div>
<div class="ttc" id="a02250_html"><div class="ttname"><a href="a02250.html">tesseract::LTRResultIterator</a></div><div class="ttdef"><b>Definition:</b> <a href="a00104_source.html#l00048">ltrresultiterator.h:48</a></div></div>
<div class="ttc" id="a02178_html_addc50bcc00bf59b95831fe5c7a8de558"><div class="ttname"><a href="a02178.html#addc50bcc00bf59b95831fe5c7a8de558">tesseract::TESS_CHAR::length</a></div><div class="ttdeci">int length</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02804">baseapi.cpp:2804</a></div></div>
<div class="ttc" id="a01067_html"><div class="ttname"><a href="a01067.html">opencl_device_selection.h</a></div></div>
<div class="ttc" id="a02850_html"><div class="ttname"><a href="a02850.html">TessResultCallback</a></div><div class="ttdef"><b>Definition:</b> <a href="a00587_source.html#l00036">tesscallback.h:36</a></div></div>
<div class="ttc" id="a02546_html_a15febd45d0904bb3c5f7d506368177f0"><div class="ttname"><a href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">PAGE_RES_IT::restart_page</a></div><div class="ttdeci">WERD_RES * restart_page()</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00698">pageres.h:698</a></div></div>
<div class="ttc" id="a02358_html_a0fd6abd523392fabfa8ec77c4a6bd550"><div class="ttname"><a href="a02358.html#a0fd6abd523392fabfa8ec77c4a6bd550">tesseract::Tesseract::SetEquationDetect</a></div><div class="ttdeci">void SetEquationDetect(EquationDetect *detector)</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00586">tesseractclass.cpp:586</a></div></div>
<div class="ttc" id="a02358_html_a1267fb55994276b60fa5f5a34f508135"><div class="ttname"><a href="a02358.html#a1267fb55994276b60fa5f5a34f508135">tesseract::Tesseract::init_tesseract</a></div><div class="ttdeci">int init_tesseract(const char *arg0, const char *textbase, const char *language, OcrEngineMode oem, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_init_params, TessdataManager *mgr)</div><div class="ttdef"><b>Definition:</b> <a href="a00182_source.html#l00296">tessedit.cpp:296</a></div></div>
<div class="ttc" id="a02250_html_a1cae927f76fc372acc7c19549115ca4e"><div class="ttname"><a href="a02250.html#a1cae927f76fc372acc7c19549115ca4e">tesseract::LTRResultIterator::WordFontAttributes</a></div><div class="ttdeci">const char * WordFontAttributes(bool *is_bold, bool *is_italic, bool *is_underlined, bool *is_monospace, bool *is_serif, bool *is_smallcaps, int *pointsize, int *font_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00101_source.html#l00166">ltrresultiterator.cpp:166</a></div></div>
<div class="ttc" id="a01625_html_gad7a52133fe0ebab22e97166c5e5cab67"><div class="ttname"><a href="a01625.html#gad7a52133fe0ebab22e97166c5e5cab67">tesseract::TessBaseAPI::SetProbabilityInContextFunc</a></div><div class="ttdeci">void SetProbabilityInContextFunc(ProbabilityInContextFunc f)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02298">baseapi.cpp:2298</a></div></div>
<div class="ttc" id="a02186_html_a4f3eec49763f76c347c216eed79cae93"><div class="ttname"><a href="a02186.html#a4f3eec49763f76c347c216eed79cae93">tesseract::TessBaseAPI::ReadDebugConfigFile</a></div><div class="ttdeci">void ReadDebugConfigFile(const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00520">baseapi.cpp:520</a></div></div>
<div class="ttc" id="a01625_html_ga38027513ee9c0348de1790bddcdc3391"><div class="ttname"><a href="a01625.html#ga38027513ee9c0348de1790bddcdc3391">tesseract::TessBaseAPI::End</a></div><div class="ttdeci">void End()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02195">baseapi.cpp:2195</a></div></div>
<div class="ttc" id="a02534_html_ae7c240d4878247ebdfe78433446751bf"><div class="ttname"><a href="a02534.html#ae7c240d4878247ebdfe78433446751bf">BLOCK_RES::block</a></div><div class="ttdeci">BLOCK * block</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00117">pageres.h:117</a></div></div>
<div class="ttc" id="a02186_html_af8bd418033a2157e14c2fd0c6ab47b63"><div class="ttname"><a href="a02186.html#af8bd418033a2157e14c2fd0c6ab47b63">tesseract::TessBaseAPI::SetInputImage</a></div><div class="ttdeci">void SetInputImage(Pix *pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00968">baseapi.cpp:968</a></div></div>
<div class="ttc" id="a02834_html_a70cb880f818d4af4a4f4036032c3e9dc"><div class="ttname"><a href="a02834.html#a70cb880f818d4af4a4f4036032c3e9dc">STRING::split</a></div><div class="ttdeci">void split(const char c, GenericVector< STRING > *splited)</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00284">strngs.cpp:284</a></div></div>
<div class="ttc" id="a02358_html_a9bb4a5c03d59d657db0506ea4f5d5cae"><div class="ttname"><a href="a02358.html#a9bb4a5c03d59d657db0506ea4f5d5cae">tesseract::Tesseract::TrainLineRecognizer</a></div><div class="ttdeci">void TrainLineRecognizer(const STRING &input_imagename, const STRING &output_basename, BLOCK_LIST *block_list)</div><div class="ttdef"><b>Definition:</b> <a href="a00098_source.html#l00043">linerec.cpp:43</a></div></div>
<div class="ttc" id="a01625_html_ga7d47d44548a1158018150e28863ba4eb"><div class="ttname"><a href="a01625.html#ga7d47d44548a1158018150e28863ba4eb">tesseract::TessBaseAPI::GetDawg</a></div><div class="ttdeci">const Dawg * GetDawg(int i) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02621">baseapi.cpp:2621</a></div></div>
<div class="ttc" id="a01625_html_ga8250efe0683da2a44fa6ec050240a8b2"><div class="ttname"><a href="a01625.html#ga8250efe0683da2a44fa6ec050240a8b2">tesseract::TessBaseAPI::NormalizeTBLOB</a></div><div class="ttdeci">static void NormalizeTBLOB(TBLOB *tblob, ROW *row, bool numeric_mode)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02720">baseapi.cpp:2720</a></div></div>
<div class="ttc" id="a02358_html_adee618f35a90de376370cb6f7930bc84"><div class="ttname"><a href="a02358.html#adee618f35a90de376370cb6f7930bc84">tesseract::Tesseract::SetupApplyBoxes</a></div><div class="ttdeci">PAGE_RES * SetupApplyBoxes(const GenericVector< TBOX > &boxes, BLOCK_LIST *block_list)</div></div>
<div class="ttc" id="a02186_html_a247f50792f581df05afe336a2aeda402"><div class="ttname"><a href="a02186.html#a247f50792f581df05afe336a2aeda402">tesseract::TessBaseAPI::tesseract_</a></div><div class="ttdeci">Tesseract * tesseract_</div><div class="ttdoc">The underlying data object. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00870">baseapi.h:870</a></div></div>
<div class="ttc" id="a02610_html_a8e9dce0d30d2213598cd4befe0028c99"><div class="ttname"><a href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">TBOX::left</a></div><div class="ttdeci">int16_t left() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00072">rect.h:72</a></div></div>
<div class="ttc" id="a02186_html_a06084d66b830a388515663761d842041"><div class="ttname"><a href="a02186.html#a06084d66b830a388515663761d842041">tesseract::TessBaseAPI::paragraph_models_</a></div><div class="ttdeci">GenericVector< ParagraphModel * > * paragraph_models_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00875">baseapi.h:875</a></div></div>
<div class="ttc" id="a02638_html_aec30b0c876cef5479c5db04aa8897358"><div class="ttname"><a href="a02638.html#aec30b0c876cef5479c5db04aa8897358">WERD::flag</a></div><div class="ttdeci">bool flag(WERD_FLAGS mask) const</div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00126">werd.h:126</a></div></div>
<div class="ttc" id="a02606_html_adaecd80cfe44e00e9c4647859b1c87e0"><div class="ttname"><a href="a02606.html#adaecd80cfe44e00e9c4647859b1c87e0">WERD_CHOICE::unichar_lengths</a></div><div class="ttdeci">const STRING & unichar_lengths() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00548">ratngs.h:548</a></div></div>
<div class="ttc" id="a03906_html"><div class="ttname"><a href="a03906.html">tesseract::TessdataManager</a></div><div class="ttdef"><b>Definition:</b> <a href="a00593_source.html#l00126">tessdatamanager.h:126</a></div></div>
<div class="ttc" id="a01625_html_gab8c2ee5d614382f0d25deb9a7adfe199"><div class="ttname"><a href="a01625.html#gab8c2ee5d614382f0d25deb9a7adfe199">tesseract::TessBaseAPI::AdaptToWordStr</a></div><div class="ttdeci">bool AdaptToWordStr(PageSegMode mode, const char *wordstr)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02119">baseapi.cpp:2119</a></div></div>
<div class="ttc" id="a04290_html_a592e165554ca0cb0839da97874314ac8"><div class="ttname"><a href="a04290.html#a592e165554ca0cb0839da97874314ac8">tesseract::Dict::GetDawg</a></div><div class="ttdeci">const Dawg * GetDawg(int index) const</div><div class="ttdoc">Return i-th dawg pointer recorded in the dawgs_ vector. </div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00417">dict.h:417</a></div></div>
<div class="ttc" id="a02794_html_a53d101144fd6a9e6d45980e832f9e054"><div class="ttname"><a href="a02794.html#a53d101144fd6a9e6d45980e832f9e054">tesseract::ParamUtils::GetParamAsString</a></div><div class="ttdeci">static bool GetParamAsString(const char *name, const ParamsVectors *member_params, STRING *value)</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00133">params.cpp:133</a></div></div>
<div class="ttc" id="a02250_html_a1c5dc6da1ffd6e8132b2fca914146f02"><div class="ttname"><a href="a02250.html#a1c5dc6da1ffd6e8132b2fca914146f02">tesseract::LTRResultIterator::WordDirection</a></div><div class="ttdeci">StrongScriptDirection WordDirection() const</div><div class="ttdef"><b>Definition:</b> <a href="a00101_source.html#l00204">ltrresultiterator.cpp:204</a></div></div>
<div class="ttc" id="a00554_html_a71a3243019391d3a438fd279c07cef87"><div class="ttname"><a href="a00554.html#a71a3243019391d3a438fd279c07cef87">GlobalParams</a></div><div class="ttdeci">tesseract::ParamsVectors * GlobalParams()</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00032">params.cpp:32</a></div></div>
<div class="ttc" id="a01625_html_gae491663681af41428a4b8b2f14c38bcc"><div class="ttname"><a href="a01625.html#gae491663681af41428a4b8b2f14c38bcc">tesseract::TessBaseAPI::GetComponentImages</a></div><div class="ttdeci">Boxa * GetComponentImages(const PageIteratorLevel level, const bool text_only, const bool raw_image, const int raw_padding, Pixa **pixa, int **blockids, int **paraids)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00720">baseapi.cpp:720</a></div></div>
<div class="ttc" id="a02610_html_a5dc64d0677b5d65385bc07a78cf49c4d"><div class="ttname"><a href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">TBOX::top</a></div><div class="ttdeci">int16_t top() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00058">rect.h:58</a></div></div>
<div class="ttc" id="a01625_html_ga551aa98cd0a9957195f83729a599a89f"><div class="ttname"><a href="a01625.html#ga551aa98cd0a9957195f83729a599a89f">tesseract::TessBaseAPI::ProcessPages</a></div><div class="ttdeci">bool ProcessPages(const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01084">baseapi.cpp:1084</a></div></div>
<div class="ttc" id="a00314_html"><div class="ttname"><a href="a00314.html">normalis.h</a></div></div>
<div class="ttc" id="a00449_html_ad6968adbf8f2cc44adf333ec96efb0bea3580884b5b0335502fb928db4a0a2024"><div class="ttname"><a href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea3580884b5b0335502fb928db4a0a2024">W_FUZZY_SP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00041">werd.h:41</a></div></div>
<div class="ttc" id="a02186_html_ae4a4e56d5c8ffd8d1c38d09daa32858a"><div class="ttname"><a href="a02186.html#ae4a4e56d5c8ffd8d1c38d09daa32858a">tesseract::TessBaseAPI::GetDoubleVariable</a></div><div class="ttdeci">bool GetDoubleVariable(const char *name, double *value) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00327">baseapi.cpp:327</a></div></div>
<div class="ttc" id="a01629_html_acac5bfbc6e9f8ca26f42ea3bad95d84e"><div class="ttname"><a href="a01629.html#acac5bfbc6e9f8ca26f42ea3bad95d84e">tesseract::WritingDirection</a></div><div class="ttdeci">WritingDirection</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00135">publictypes.h:135</a></div></div>
<div class="ttc" id="a00527_html_a31bec0ef73dd383e256fa462e9fa7e1f"><div class="ttname"><a href="a00527.html#a31bec0ef73dd383e256fa462e9fa7e1f">chomp_string</a></div><div class="ttdeci">void chomp_string(char *str)</div><div class="ttdef"><b>Definition:</b> <a href="a00527_source.html#l00083">helpers.h:83</a></div></div>
<div class="ttc" id="a02186_html_a9b25f5b2e2e3d9791e145355e91efdea"><div class="ttname"><a href="a02186.html#a9b25f5b2e2e3d9791e145355e91efdea">tesseract::TessBaseAPI::PrintVariables</a></div><div class="ttdeci">void PrintVariables(FILE *fp) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00341">baseapi.cpp:341</a></div></div>
<div class="ttc" id="a01625_html_gaec56194587e149ae38a08eccd2e0d96a"><div class="ttname"><a href="a01625.html#gaec56194587e149ae38a08eccd2e0d96a">tesseract::TessBaseAPI::RecognizeForChopTest</a></div><div class="ttdeci">int RecognizeForChopTest(ETEXT_DESC *monitor)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00935">baseapi.cpp:935</a></div></div>
<div class="ttc" id="a02182_html"><div class="ttname"><a href="a02182.html">GenericVector< STRING ></a></div></div>
<div class="ttc" id="a02542_html_a82d32a9f59bc1c08da9537303c56615b"><div class="ttname"><a href="a02542.html#a82d32a9f59bc1c08da9537303c56615b">WERD_RES::unlv_crunch_mode</a></div><div class="ttdeci">CRUNCH_MODE unlv_crunch_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00310">pageres.h:310</a></div></div>
<div class="ttc" id="a02358_html_aeed33f786b5c71bf0b47452c76bf0c8a"><div class="ttname"><a href="a02358.html#aeed33f786b5c71bf0b47452c76bf0c8a">tesseract::Tesseract::tessedit_ambigs_training</a></div><div class="ttdeci">bool tessedit_ambigs_training</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00836">tesseractclass.h:836</a></div></div>
<div class="ttc" id="a01625_html_ga5c207843b7fa3a5a3b328035af9836f0"><div class="ttname"><a href="a01625.html#ga5c207843b7fa3a5a3b328035af9836f0">tesseract::TessBaseAPI::GetThresholdedImageScaleFactor</a></div><div class="ttdeci">int GetThresholdedImageScaleFactor() const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00802">baseapi.cpp:802</a></div></div>
<div class="ttc" id="a02526_html_aced2e98c94f532c5c5809d63aef4b9de"><div class="ttname"><a href="a02526.html#aced2e98c94f532c5c5809d63aef4b9de">ROW::x_height</a></div><div class="ttdeci">float x_height() const</div><div class="ttdef"><b>Definition:</b> <a href="a00332_source.html#l00064">ocrrow.h:64</a></div></div>
<div class="ttc" id="a01625_html_ga7525d25bfca88c93ed7ffda4a6a86bef"><div class="ttname"><a href="a01625.html#ga7525d25bfca88c93ed7ffda4a6a86bef">tesseract::TessBaseAPI::ClearPersistentCache</a></div><div class="ttdeci">static void ClearPersistentCache()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02230">baseapi.cpp:2230</a></div></div>
<div class="ttc" id="a02186_html_ae7a2e532aa6b1ca5db071af78c34ed21"><div class="ttname"><a href="a02186.html#ae7a2e532aa6b1ca5db071af78c34ed21">tesseract::TessBaseAPI::CatchSignals</a></div><div class="ttdeci">static void CatchSignals()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00259">baseapi.cpp:259</a></div></div>
<div class="ttc" id="a01629_html_a3e35711780f8c0254a2dd64071ef2b6b"><div class="ttname"><a href="a01629.html#a3e35711780f8c0254a2dd64071ef2b6b">tesseract::kMaxIntSize</a></div><div class="ttdeci">const int kMaxIntSize</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00114">baseapi.cpp:114</a></div></div>
<div class="ttc" id="a02666_html_a69c5179ac5f10a24f3f97e16ca09460f"><div class="ttname"><a href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">tesseract::CCUtil::unicharset</a></div><div class="ttdeci">UNICHARSET unicharset</div><div class="ttdef"><b>Definition:</b> <a href="a00476_source.html#l00068">ccutil.h:68</a></div></div>
<div class="ttc" id="a02186_html_ac7eaed7f3fedb15212eb39b747de0102"><div class="ttname"><a href="a02186.html#ac7eaed7f3fedb15212eb39b747de0102">tesseract::TessBaseAPI::truth_cb_</a></div><div class="ttdeci">TruthCallback * truth_cb_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00884">baseapi.h:884</a></div></div>
<div class="ttc" id="a02398_html_a6aef0201c756ed33e68a94abc8ac2b8e"><div class="ttname"><a href="a02398.html#a6aef0201c756ed33e68a94abc8ac2b8e">TBLOB::Normalize</a></div><div class="ttdeci">void Normalize(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00407">blobs.cpp:407</a></div></div>
<div class="ttc" id="a02358_html_aa1c9c8ed630b708cf88c97b863c0f1f8"><div class="ttname"><a href="a02358.html#aa1c9c8ed630b708cf88c97b863c0f1f8">tesseract::Tesseract::ResetAdaptiveClassifier</a></div><div class="ttdeci">void ResetAdaptiveClassifier()</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00592">tesseractclass.cpp:592</a></div></div>
<div class="ttc" id="a02190_html_a48121964cc38c7b33bc7e555a7b41423"><div class="ttname"><a href="a02190.html#a48121964cc38c7b33bc7e555a7b41423">tesseract::TessResultRenderer::AddImage</a></div><div class="ttdeci">bool AddImage(TessBaseAPI *api)</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00083">renderer.cpp:83</a></div></div>
<div class="ttc" id="a02358_html_a95bb008c7903633f1f3cd50540c05742"><div class="ttname"><a href="a02358.html#a95bb008c7903633f1f3cd50540c05742">tesseract::Tesseract::tessedit_train_from_boxes</a></div><div class="ttdeci">bool tessedit_train_from_boxes</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00815">tesseractclass.h:815</a></div></div>
<div class="ttc" id="a03950_html_a7b52b091edd0c1f5e17539f0d6af0e88"><div class="ttname"><a href="a03950.html#a7b52b091edd0c1f5e17539f0d6af0e88">UNICHARSET::contains_unichar</a></div><div class="ttdeci">bool contains_unichar(const char *const unichar_repr) const</div><div class="ttdef"><b>Definition:</b> <a href="a00620_source.html#l00670">unicharset.cpp:670</a></div></div>
<div class="ttc" id="a02806_html"><div class="ttname"><a href="a02806.html">tesseract::BoolParam</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00166">params.h:166</a></div></div>
<div class="ttc" id="a01625_html_ga953b401286da174e609f09c5f275734e"><div class="ttname"><a href="a01625.html#ga953b401286da174e609f09c5f275734e">tesseract::TessBaseAPI::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02182">baseapi.cpp:2182</a></div></div>
<div class="ttc" id="a02606_html"><div class="ttname"><a href="a02606.html">WERD_CHOICE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00273">ratngs.h:273</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7adbd62c7f34a9ebdd6e3b813a34cd812d">tesseract::RIL_SYMBOL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00224">publictypes.h:224</a></div></div>
<div class="ttc" id="a02186_html_ad34c56e08d999ece9972f4c9a9301f93"><div class="ttname"><a href="a02186.html#ad34c56e08d999ece9972f4c9a9301f93">tesseract::TessBaseAPI::TesseractRect</a></div><div class="ttdeci">char * TesseractRect(const unsigned char *imagedata, int bytes_per_pixel, int bytes_per_line, int left, int top, int width, int height)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00556">baseapi.cpp:556</a></div></div>
<div class="ttc" id="a02666_html_ae453cbd7e4899ebfc5cc3831e5a8dd66"><div class="ttname"><a href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">tesseract::CCUtil::lang</a></div><div class="ttdeci">STRING lang</div><div class="ttdef"><b>Definition:</b> <a href="a00476_source.html#l00066">ccutil.h:66</a></div></div>
<div class="ttc" id="a02610_html_a79f654ae8a2a33cbb2a1985cb97d143c"><div class="ttname"><a href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">TBOX::major_overlap</a></div><div class="ttdeci">bool major_overlap(const TBOX &box) const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00368">rect.h:368</a></div></div>
<div class="ttc" id="a00014_html_aa93f0eb578d23995850d61f7d61c55c1"><div class="ttname"><a href="a00014.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a></div><div class="ttdeci">#define FALSE</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00052">capi.h:52</a></div></div>
<div class="ttc" id="a02358_html_ab48cff8de587e3a573a327846e57c51d"><div class="ttname"><a href="a02358.html#ab48cff8de587e3a573a327846e57c51d">tesseract::Tesseract::pgeditor_main</a></div><div class="ttdeci">void pgeditor_main(int width, int height, PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00155_source.html#l00327">pgedit.cpp:327</a></div></div>
<div class="ttc" id="a03998_html_adc3a809a1a219f741a9e45a32e0d11bc"><div class="ttname"><a href="a03998.html#adc3a809a1a219f741a9e45a32e0d11bc">tesseract::Classify::matcher_good_threshold</a></div><div class="ttdeci">double matcher_good_threshold</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00461">classify.h:461</a></div></div>
<div class="ttc" id="a02834_html_a8b89aab090bf94ed9e0b05625ec6a397"><div class="ttname"><a href="a02834.html#a8b89aab090bf94ed9e0b05625ec6a397">STRING::add_str_double</a></div><div class="ttdeci">void add_str_double(const char *str, double number)</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00389">strngs.cpp:389</a></div></div>
<div class="ttc" id="a02358_html_a211f8d8d25bf615c44e117a93c40017c"><div class="ttname"><a href="a02358.html#a211f8d8d25bf615c44e117a93c40017c">tesseract::Tesseract::ApplyBoxes</a></div><div class="ttdeci">PAGE_RES * ApplyBoxes(const STRING &fname, bool find_segmentation, BLOCK_LIST *block_list)</div></div>
<div class="ttc" id="a02358_html_af9c097177e82c5f5495a7dc1506d66ed"><div class="ttname"><a href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed">tesseract::Tesseract::recog_all_words</a></div><div class="ttdeci">bool recog_all_words(PAGE_RES *page_res, ETEXT_DESC *monitor, const TBOX *target_word_box, const char *word_config, int dopasses)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00308">control.cpp:308</a></div></div>
<div class="ttc" id="a00344_html_affc9a96d31e23e645355e534f11c40e9a1799c83261446306e1d1527f1779d6a4"><div class="ttname"><a href="a00344.html#affc9a96d31e23e645355e534f11c40e9a1799c83261446306e1d1527f1779d6a4">CR_DELETE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00164">pageres.h:164</a></div></div>
<div class="ttc" id="a02346_html_a961e7ee57edae85e855332a301cccacf"><div class="ttname"><a href="a02346.html#a961e7ee57edae85e855332a301cccacf">tesseract::ResultIterator::StartOfParagraph</a></div><div class="ttdeci">static ResultIterator * StartOfParagraph(const LTRResultIterator &resit)</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00050">resultiterator.cpp:50</a></div></div>
<div class="ttc" id="a00737_html_a4f7caedc4bed99355cae19efa51ade51"><div class="ttname"><a href="a00737.html#a4f7caedc4bed99355cae19efa51ade51">MAX_NUM_INT_FEATURES</a></div><div class="ttdeci">#define MAX_NUM_INT_FEATURES</div><div class="ttdef"><b>Definition:</b> <a href="a00737_source.html#l00129">intproto.h:129</a></div></div>
<div class="ttc" id="a02358_html_aeec853f13be0d94e02e0f9dfad90e9bf"><div class="ttname"><a href="a02358.html#aeec853f13be0d94e02e0f9dfad90e9bf">tesseract::Tesseract::textord_equation_detect</a></div><div class="ttdeci">bool textord_equation_detect</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01107">tesseractclass.h:1107</a></div></div>
<div class="ttc" id="a00605_html_abc3119a959ecd5cffc1d9b9d57479dbaaacc5ec7fd402a8806e78fba831045aae"><div class="ttname"><a href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaaacc5ec7fd402a8806e78fba831045aae">DIR_NEUTRAL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00043">unichar.h:43</a></div></div>
<div class="ttc" id="a00344_html_affc9a96d31e23e645355e534f11c40e9a1eac25752f2c55f1809d11d4ef917ff9"><div class="ttname"><a href="a00344.html#affc9a96d31e23e645355e534f11c40e9a1eac25752f2c55f1809d11d4ef917ff9">CR_NONE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00161">pageres.h:161</a></div></div>
<div class="ttc" id="a00527_html_ab60e4f82956a1f5fdb54d0d8303e95b7"><div class="ttname"><a href="a00527.html#ab60e4f82956a1f5fdb54d0d8303e95b7">IntCastRounded</a></div><div class="ttdeci">int IntCastRounded(double x)</div><div class="ttdef"><b>Definition:</b> <a href="a00527_source.html#l00168">helpers.h:168</a></div></div>
<div class="ttc" id="a01163_html"><div class="ttname"><a href="a01163.html">edgblob.h</a></div></div>
<div class="ttc" id="a02186_html_ab0cb619ceec1ca8872621399f8238d58"><div class="ttname"><a href="a02186.html#ab0cb619ceec1ca8872621399f8238d58">tesseract::TessBaseAPI::GetInputImage</a></div><div class="ttdeci">Pix * GetInputImage()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00970">baseapi.cpp:970</a></div></div>
<div class="ttc" id="a02358_html_a94e454dba7e8fb5199f8150335299b8c"><div class="ttname"><a href="a02358.html#a94e454dba7e8fb5199f8150335299b8c">tesseract::Tesseract::set_pix_thresholds</a></div><div class="ttdeci">void set_pix_thresholds(Pix *thresholds)</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00237">tesseractclass.h:237</a></div></div>
<div class="ttc" id="a01625_html_ga5ed6e495e7f1c269588a8b85e4e19ca8"><div class="ttname"><a href="a01625.html#ga5ed6e495e7f1c269588a8b85e4e19ca8">tesseract::TessBaseAPI::DetectOS</a></div><div class="ttdeci">bool DetectOS(OSResults *)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02522">baseapi.cpp:2522</a></div></div>
<div class="ttc" id="a02546_html_a6cdcdaa4b0b1250ab7e14760d4b5f113"><div class="ttname"><a href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">PAGE_RES_IT::word</a></div><div class="ttdeci">WERD_RES * word() const</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00751">pageres.h:751</a></div></div>
<div class="ttc" id="a02186_html_a3bc4277652df23eaeccd0629f2b1419d"><div class="ttname"><a href="a02186.html#a3bc4277652df23eaeccd0629f2b1419d">tesseract::TessBaseAPI::TessBaseAPI</a></div><div class="ttdeci">TessBaseAPI()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00182">baseapi.cpp:182</a></div></div>
<div class="ttc" id="a02362_html_a02256722855a56bb2ee79238df990b3b"><div class="ttname"><a href="a02362.html#a02256722855a56bb2ee79238df990b3b">tesseract::ImageThresholder::GetScaledEstimatedResolution</a></div><div class="ttdeci">int GetScaledEstimatedResolution() const</div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00106">thresholder.h:106</a></div></div>
<div class="ttc" id="a00491_html_ab54325a3cfcd9bee58697d77e1902240"><div class="ttname"><a href="a00491.html#ab54325a3cfcd9bee58697d77e1902240">ELISTIZE</a></div><div class="ttdeci">#define ELISTIZE(CLASSNAME)</div><div class="ttdef"><b>Definition:</b> <a href="a00491_source.html#l00961">elst.h:961</a></div></div>
<div class="ttc" id="a02542_html_a8d4f5c6ed2c60b756a5c63e091cd331c"><div class="ttname"><a href="a02542.html#a8d4f5c6ed2c60b756a5c63e091cd331c">WERD_RES::BestChoiceToCorrectText</a></div><div class="ttdeci">void BestChoiceToCorrectText()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00929">pageres.cpp:929</a></div></div>
<div class="ttc" id="a02278_html_a85aeba464464350c89299216bf749f34"><div class="ttname"><a href="a02278.html#a85aeba464464350c89299216bf749f34">tesseract::PageIterator::Baseline</a></div><div class="ttdeci">bool Baseline(PageIteratorLevel level, int *x1, int *y1, int *x2, int *y2) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00489">pageiterator.cpp:489</a></div></div>
<div class="ttc" id="a02638_html"><div class="ttname"><a href="a02638.html">WERD</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00059">werd.h:59</a></div></div>
<div class="ttc" id="a01629_html_a76ce0248fd3ba576ca053e9bb82e492f"><div class="ttname"><a href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492f">tesseract::Orientation</a></div><div class="ttdeci">Orientation</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00120">publictypes.h:120</a></div></div>
<div class="ttc" id="a02358_html_ae6daf71366bf37ae460f95c5d9cad11b"><div class="ttname"><a href="a02358.html#ae6daf71366bf37ae460f95c5d9cad11b">tesseract::Tesseract::pix_binary</a></div><div class="ttdeci">Pix * pix_binary() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00201">tesseractclass.h:201</a></div></div>
<div class="ttc" id="a02666_html_ac993425386ae1f73762107299ee8a114"><div class="ttname"><a href="a02666.html#ac993425386ae1f73762107299ee8a114">tesseract::CCUtil::params</a></div><div class="ttdeci">ParamsVectors * params()</div><div class="ttdef"><b>Definition:</b> <a href="a00476_source.html#l00062">ccutil.h:62</a></div></div>
<div class="ttc" id="a02186_html_a25d71dd25faea83cc91db902f2997297"><div class="ttname"><a href="a02186.html#a25d71dd25faea83cc91db902f2997297">tesseract::TessBaseAPI::GetIntVariable</a></div><div class="ttdeci">bool GetIntVariable(const char *name, int *value) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00305">baseapi.cpp:305</a></div></div>
<div class="ttc" id="a02362_html_af96fa2b6f4d1271640d5c8842f4fa9d6"><div class="ttname"><a href="a02362.html#af96fa2b6f4d1271640d5c8842f4fa9d6">tesseract::ImageThresholder::SetSourceYResolution</a></div><div class="ttdeci">void SetSourceYResolution(int ppi)</div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00086">thresholder.h:86</a></div></div>
<div class="ttc" id="a02190_html"><div class="ttname"><a href="a02190.html">tesseract::TessResultRenderer</a></div><div class="ttdef"><b>Definition:</b> <a href="a00023_source.html#l00045">renderer.h:45</a></div></div>
<div class="ttc" id="a01625_html_gac7c249f9f7e11eadc557d4b3cab123a1"><div class="ttname"><a href="a01625.html#gac7c249f9f7e11eadc557d4b3cab123a1">tesseract::TessBaseAPI::GetStrips</a></div><div class="ttdeci">Boxa * GetStrips(Pixa **pixa, int **blockids)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00689">baseapi.cpp:689</a></div></div>
<div class="ttc" id="a02526_html_aa79de9c912a3875be44fdc3131fdc687"><div class="ttname"><a href="a02526.html#aa79de9c912a3875be44fdc3131fdc687">ROW::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00332_source.html#l00088">ocrrow.h:88</a></div></div>
<div class="ttc" id="a02186_html_ad7c3d4ead7b9c8e27e45e710e5407913"><div class="ttname"><a href="a02186.html#ad7c3d4ead7b9c8e27e45e710e5407913">tesseract::TessBaseAPI::datapath_</a></div><div class="ttdeci">STRING * datapath_</div><div class="ttdoc">Current location of tessdata. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00880">baseapi.h:880</a></div></div>
<div class="ttc" id="a00530_html_a865cbe4908be24ccc32d2fbd598281d0"><div class="ttname"><a href="a00530.html#a865cbe4908be24ccc32d2fbd598281d0">BOOL8</a></div><div class="ttdeci">unsigned char BOOL8</div><div class="ttdef"><b>Definition:</b> <a href="a00530_source.html#l00034">host.h:34</a></div></div>
<div class="ttc" id="a02186_html_a83ca325b5e521416b1edcd020b169be0"><div class="ttname"><a href="a02186.html#a83ca325b5e521416b1edcd020b169be0">tesseract::TessBaseAPI::ClearResults</a></div><div class="ttdeci">void ClearResults()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02465">baseapi.cpp:2465</a></div></div>
<div class="ttc" id="a01626_html_gaf62a3be9f3b8ca4f8260ec2cc1628ecc"><div class="ttname"><a href="a01626.html#gaf62a3be9f3b8ca4f8260ec2cc1628ecc">tesseract::TessBaseAPI::AdaptToCharacter</a></div><div class="ttdeci">TESS_LOCAL void AdaptToCharacter(const char *unichar_repr, int length, float baseline, float xheight, float descender, float ascender)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02751">baseapi.cpp:2751</a></div></div>
<div class="ttc" id="a02186_html_a7d4627f300b1096d43a3e7d54d8aa5df"><div class="ttname"><a href="a02186.html#a7d4627f300b1096d43a3e7d54d8aa5df">tesseract::TessBaseAPI::recognition_done_</a></div><div class="ttdeci">bool recognition_done_</div><div class="ttdoc">page_res_ contains recognition data. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00883">baseapi.h:883</a></div></div>
<div class="ttc" id="a02526_html"><div class="ttname"><a href="a02526.html">ROW</a></div><div class="ttdef"><b>Definition:</b> <a href="a00332_source.html#l00036">ocrrow.h:36</a></div></div>
<div class="ttc" id="a01625_html_ga4ded6137507a4e8eb6ed4bea0b9648f4"><div class="ttname"><a href="a01625.html#ga4ded6137507a4e8eb6ed4bea0b9648f4">tesseract::TessBaseAPI::SetSourceResolution</a></div><div class="ttdeci">void SetSourceResolution(int ppi)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00604">baseapi.cpp:604</a></div></div>
<div class="ttc" id="a03998_html_a49c2bec2694a12cb6518001d8193d58d"><div class="ttname"><a href="a03998.html#a49c2bec2694a12cb6518001d8193d58d">tesseract::Classify::AdaptedTemplates</a></div><div class="ttdeci">ADAPT_TEMPLATES AdaptedTemplates</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00514">classify.h:514</a></div></div>
<div class="ttc" id="a02182_html_a172c4aa23ba397e24319ae095281cbcc"><div class="ttname"><a href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">GenericVector::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00090">genericvector.h:90</a></div></div>
<div class="ttc" id="a00596_html_a0c2bcd4462ec67ab0971b34a0f610f55"><div class="ttname"><a href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a></div><div class="ttdeci">DLLSYM void tprintf(const char *format,...)</div><div class="ttdef"><b>Definition:</b> <a href="a00596_source.html#l00037">tprintf.cpp:37</a></div></div>
<div class="ttc" id="a02398_html_a56599f0cc0c2eb73d9c5fd490f03fc56"><div class="ttname"><a href="a02398.html#a56599f0cc0c2eb73d9c5fd490f03fc56">TBLOB::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00478">blobs.cpp:478</a></div></div>
<div class="ttc" id="a01625_html_ga0cfc2f772980b283b98b5c4ea37db724"><div class="ttname"><a href="a01625.html#ga0cfc2f772980b283b98b5c4ea37db724">tesseract::TessBaseAPI::ProcessPage</a></div><div class="ttdeci">bool ProcessPage(Pix *pix, int page_index, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01213">baseapi.cpp:1213</a></div></div>
<div class="ttc" id="a00449_html"><div class="ttname"><a href="a00449.html">werd.h</a></div></div>
<div class="ttc" id="a00449_html_ad6968adbf8f2cc44adf333ec96efb0beaff21d7c8c8992120fff35942408a00d2"><div class="ttname"><a href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaff21d7c8c8992120fff35942408a00d2">W_BOL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00034">werd.h:34</a></div></div>
<div class="ttc" id="a02814_html"><div class="ttname"><a href="a02814.html">tesseract::DoubleParam</a></div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00219">params.h:219</a></div></div>
<div class="ttc" id="a04258_html"><div class="ttname"><a href="a04258.html">tesseract::Dawg</a></div><div class="ttdef"><b>Definition:</b> <a href="a00896_source.html#l00119">dawg.h:119</a></div></div>
<div class="ttc" id="a02178_html_ad9c35da31a6b36d0cf1dd9dce0572da4"><div class="ttname"><a href="a02178.html#ad9c35da31a6b36d0cf1dd9dce0572da4">tesseract::TESS_CHAR::TESS_CHAR</a></div><div class="ttdeci">TESS_CHAR(float _cost, const char *repr, int len=-1)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02808">baseapi.cpp:2808</a></div></div>
<div class="ttc" id="a00767_html_a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23"><div class="ttname"><a href="a00767.html#a2a4b69f9a2827dc98bc4cbc233118865a83297de004f4e58b9be2108c6cd08a23">baseline</a></div><div class="ttdef"><b>Definition:</b> <a href="a00767_source.html#l00055">mfoutline.h:55</a></div></div>
<div class="ttc" id="a01625_html_gac4a301ee35d57b0a7572d4434cae284c"><div class="ttname"><a href="a01625.html#gac4a301ee35d57b0a7572d4434cae284c">tesseract::TessBaseAPI::set_min_orientation_margin</a></div><div class="ttdeci">void set_min_orientation_margin(double margin)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02537">baseapi.cpp:2537</a></div></div>
<div class="ttc" id="a02514_html"><div class="ttname"><a href="a02514.html">BLOCK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00030">ocrblock.h:30</a></div></div>
<div class="ttc" id="a02606_html_ad00f0a3cf74d3b2d82dcefb811bd1685"><div class="ttname"><a href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">WERD_CHOICE::length</a></div><div class="ttdeci">int length() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00303">ratngs.h:303</a></div></div>
<div class="ttc" id="a02186_html_ae31284b65bc7045068c6b26eb042caaa"><div class="ttname"><a href="a02186.html#ae31284b65bc7045068c6b26eb042caaa">tesseract::TessBaseAPI::GetAvailableLanguagesAsVector</a></div><div class="ttdeci">void GetAvailableLanguagesAsVector(GenericVector< STRING > *langs) const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00470">baseapi.cpp:470</a></div></div>
<div class="ttc" id="a02358_html_acf30e84d821dad180e2e3c752bf5af28"><div class="ttname"><a href="a02358.html#acf30e84d821dad180e2e3c752bf5af28">tesseract::Tesseract::ResetDocumentDictionary</a></div><div class="ttdeci">void ResetDocumentDictionary()</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00602">tesseractclass.cpp:602</a></div></div>
<div class="ttc" id="a00005_html_ad341e2a0385debc2342a18dfa9e5b3ec"><div class="ttname"><a href="a00005.html#ad341e2a0385debc2342a18dfa9e5b3ec">stream_filelist</a></div><div class="ttdeci">bool stream_filelist</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00092">baseapi.cpp:92</a></div></div>
<div class="ttc" id="a01629_html_a689189939684bc6f10754a77a4c6c569"><div class="ttname"><a href="a01629.html#a689189939684bc6f10754a77a4c6c569">tesseract::FileReader</a></div><div class="ttdeci">bool(* FileReader)(const STRING &filename, GenericVector< char > *data)</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00360">genericvector.h:360</a></div></div>
<div class="ttc" id="a02186_html_af9d4095a569fbf8687cefc005d2f58ee"><div class="ttname"><a href="a02186.html#af9d4095a569fbf8687cefc005d2f58ee">tesseract::TessBaseAPI::last_oem_requested_</a></div><div class="ttdeci">OcrEngineMode last_oem_requested_</div><div class="ttdoc">Last ocr language mode requested. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00882">baseapi.h:882</a></div></div>
<div class="ttc" id="a04278_html_a2754644a4f3ae4937961dd5ea915637f"><div class="ttname"><a href="a04278.html#a2754644a4f3ae4937961dd5ea915637f">tesseract::DawgCache::DeleteUnusedDawgs</a></div><div class="ttdeci">void DeleteUnusedDawgs()</div><div class="ttdef"><b>Definition:</b> <a href="a00902_source.html#l00043">dawg_cache.h:43</a></div></div>
<div class="ttc" id="a02186_html_a4adb0aa43b90fad6c7c0d36b4d88ee29"><div class="ttname"><a href="a02186.html#a4adb0aa43b90fad6c7c0d36b4d88ee29">tesseract::TessBaseAPI::GetSourceYResolution</a></div><div class="ttdeci">int GetSourceYResolution()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00982">baseapi.cpp:982</a></div></div>
<div class="ttc" id="a00437_html"><div class="ttname"><a href="a00437.html">stepblob.h</a></div></div>
<div class="ttc" id="a01625_html_ga284228c7e9d18bbbd3984d44e252d625"><div class="ttname"><a href="a01625.html#ga284228c7e9d18bbbd3984d44e252d625">tesseract::TessBaseAPI::SetRectangle</a></div><div class="ttdeci">void SetRectangle(int left, int top, int width, int height)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00638">baseapi.cpp:638</a></div></div>
<div class="ttc" id="a02358_html_a4b787b26c3c009f5b2dbfdd9ef5f55d7"><div class="ttname"><a href="a02358.html#a4b787b26c3c009f5b2dbfdd9ef5f55d7">tesseract::Tesseract::init_recog_training</a></div><div class="ttdeci">FILE * init_recog_training(const STRING &fname)</div><div class="ttdef"><b>Definition:</b> <a href="a00161_source.html#l00035">recogtraining.cpp:35</a></div></div>
<div class="ttc" id="a01629_html_a04550a0ed1279562027bf2fc92c421aeae7376c1e8d55b9d13e75c639a6930159"><div class="ttname"><a href="a01629.html#a04550a0ed1279562027bf2fc92c421aeae7376c1e8d55b9d13e75c639a6930159">tesseract::OEM_DEFAULT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00274">publictypes.h:274</a></div></div>
<div class="ttc" id="a02346_html_abda8fe6cd60a9667f0c06c6fd8ff1946"><div class="ttname"><a href="a02346.html#abda8fe6cd60a9667f0c06c6fd8ff1946">tesseract::ResultIterator::IsAtFinalElement</a></div><div class="ttdeci">virtual bool IsAtFinalElement(PageIteratorLevel level, PageIteratorLevel element) const</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00534">resultiterator.cpp:534</a></div></div>
<div class="ttc" id="a01629_html"><div class="ttname"><a href="a01629.html">tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00094">baseapi.cpp:94</a></div></div>
<div class="ttc" id="a02358_html_aa9ae12f56af64186b021aea99cb6bd52"><div class="ttname"><a href="a02358.html#aa9ae12f56af64186b021aea99cb6bd52">tesseract::Tesseract::set_source_resolution</a></div><div class="ttdeci">void set_source_resolution(int ppi)</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00244">tesseractclass.h:244</a></div></div>
<div class="ttc" id="a02358_html_a420654e409a9d28fd133515b5f3ed2c3"><div class="ttname"><a href="a02358.html#a420654e409a9d28fd133515b5f3ed2c3">tesseract::Tesseract::TidyUp</a></div><div class="ttdeci">void TidyUp(PAGE_RES *page_res)</div></div>
<div class="ttc" id="a01627_html_gab7d24a78f3565c5bfb42b2592b9e8df0"><div class="ttname"><a href="a01627.html#gab7d24a78f3565c5bfb42b2592b9e8df0">tesseract::TessBaseAPI::image_height_</a></div><div class="ttdeci">int image_height_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00896">baseapi.h:896</a></div></div>
<div class="ttc" id="a00725_html"><div class="ttname"><a href="a00725.html">intfx.h</a></div></div>
<div class="ttc" id="a01625_html_ga16c4b28cadc2160bf18b84c3f897a2d2"><div class="ttname"><a href="a01625.html#ga16c4b28cadc2160bf18b84c3f897a2d2">tesseract::TessBaseAPI::GetBlockTextOrientations</a></div><div class="ttdeci">void GetBlockTextOrientations(int **block_orientation, bool **vertical_writing)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02555">baseapi.cpp:2555</a></div></div>
<div class="ttc" id="a02182_html_a0dc89fe2a365b04a61017f9d78c1a303"><div class="ttname"><a href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">GenericVector::push_back</a></div><div class="ttdeci">int push_back(T object)</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00799">genericvector.h:799</a></div></div>
<div class="ttc" id="a02850_html_a39d8dd30710ee089410c230aa79fd333"><div class="ttname"><a href="a02850.html#a39d8dd30710ee089410c230aa79fd333">TessResultCallback::Run</a></div><div class="ttdeci">virtual R Run()=0</div></div>
<div class="ttc" id="a02186_html_ab3bd61f8ccb7c4e1c41801ea708d2181"><div class="ttname"><a href="a02186.html#ab3bd61f8ccb7c4e1c41801ea708d2181">tesseract::TessBaseAPI::ReadConfigFile</a></div><div class="ttdeci">void ReadConfigFile(const char *filename)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00515">baseapi.cpp:515</a></div></div>
<div class="ttc" id="a02358_html"><div class="ttname"><a href="a02358.html">tesseract::Tesseract</a></div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00173">tesseractclass.h:173</a></div></div>
<div class="ttc" id="a02258_html"><div class="ttname"><a href="a02258.html">tesseract::MutableIterator</a></div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00044">mutableiterator.h:44</a></div></div>
<div class="ttc" id="a02362_html_a39bd6e786e42ec230090189c9deb3657"><div class="ttname"><a href="a02362.html#a39bd6e786e42ec230090189c9deb3657">tesseract::ImageThresholder::GetSourceYResolution</a></div><div class="ttdeci">int GetSourceYResolution() const</div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00090">thresholder.h:90</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7a5e87a35f16de644593c353159ede11d1">tesseract::RIL_TEXTLINE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00222">publictypes.h:222</a></div></div>
<div class="ttc" id="a01629_html_a04550a0ed1279562027bf2fc92c421ae"><div class="ttname"><a href="a01629.html#a04550a0ed1279562027bf2fc92c421ae">tesseract::OcrEngineMode</a></div><div class="ttdeci">OcrEngineMode</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00268">publictypes.h:268</a></div></div>
<div class="ttc" id="a01629_html_a7e0c7c50e2e05e503a51b8c33d35ade6"><div class="ttname"><a href="a01629.html#a7e0c7c50e2e05e503a51b8c33d35ade6">tesseract::kLatinChs</a></div><div class="ttdeci">const int kLatinChs[]</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01889">baseapi.cpp:1889</a></div></div>
<div class="ttc" id="a02834_html_a779cd637dd42d58d5500a3a657077e84"><div class="ttname"><a href="a02834.html#a779cd637dd42d58d5500a3a657077e84">STRING::add_str_int</a></div><div class="ttdeci">void add_str_int(const char *str, int number)</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00379">strngs.cpp:379</a></div></div>
<div class="ttc" id="a01627_html_gab3c90d43a3628dc7abeb93e9ca01bc97"><div class="ttname"><a href="a01627.html#gab3c90d43a3628dc7abeb93e9ca01bc97">tesseract::TessBaseAPI::rect_left_</a></div><div class="ttdeci">int rect_left_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00891">baseapi.h:891</a></div></div>
<div class="ttc" id="a02790_html_a83a1b9a0571c97380bdf3a32591cf196"><div class="ttname"><a href="a02790.html#a83a1b9a0571c97380bdf3a32591cf196">tesseract::ParamsVectors::double_params</a></div><div class="ttdeci">GenericVector< DoubleParam * > double_params</div><div class="ttdef"><b>Definition:</b> <a href="a00557_source.html#l00047">params.h:47</a></div></div>
<div class="ttc" id="a02346_html"><div class="ttname"><a href="a02346.html">tesseract::ResultIterator</a></div><div class="ttdef"><b>Definition:</b> <a href="a00173_source.html#l00041">resultiterator.h:41</a></div></div>
<div class="ttc" id="a02362_html_af2a1a0395542b9ccec4ed6da3a928416"><div class="ttname"><a href="a02362.html#af2a1a0395542b9ccec4ed6da3a928416">tesseract::ImageThresholder::IsBinary</a></div><div class="ttdeci">bool IsBinary() const</div><div class="ttdoc">Returns true if the source image is binary. </div><div class="ttdef"><b>Definition:</b> <a href="a00206_source.html#l00075">thresholder.h:75</a></div></div>
<div class="ttc" id="a02246_html"><div class="ttname"><a href="a02246.html">tesseract::EquationDetect</a></div><div class="ttdef"><b>Definition:</b> <a href="a00086_source.html#l00039">equationdetect.h:39</a></div></div>
<div class="ttc" id="a00605_html_abc3119a959ecd5cffc1d9b9d57479dbaa3c6da23f98ab8ac48598c21583d9297e"><div class="ttname"><a href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa3c6da23f98ab8ac48598c21583d9297e">DIR_RIGHT_TO_LEFT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00045">unichar.h:45</a></div></div>
<div class="ttc" id="a02362_html_ab230142a51f5ed6347f1a9221e52d264"><div class="ttname"><a href="a02362.html#ab230142a51f5ed6347f1a9221e52d264">tesseract::ImageThresholder::SetRectangle</a></div><div class="ttdeci">void SetRectangle(int left, int top, int width, int height)</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00122">thresholder.cpp:122</a></div></div>
<div class="ttc" id="a01629_html_a76ce0248fd3ba576ca053e9bb82e492fa6e5beda212ea9e59ce8aad91ac47f248"><div class="ttname"><a href="a01629.html#a76ce0248fd3ba576ca053e9bb82e492fa6e5beda212ea9e59ce8aad91ac47f248">tesseract::ORIENTATION_PAGE_UP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00121">publictypes.h:121</a></div></div>
<div class="ttc" id="a02546_html"><div class="ttname"><a href="a02546.html">PAGE_RES_IT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00675">pageres.h:675</a></div></div>
<div class="ttc" id="a01629_html_a11307fd919d7a9313500b04cfc1a8e3d"><div class="ttname"><a href="a01629.html#a11307fd919d7a9313500b04cfc1a8e3d">tesseract::kMinRectSize</a></div><div class="ttdeci">const int kMinRectSize</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00097">baseapi.cpp:97</a></div></div>
<div class="ttc" id="a01625_html_ga0306bec5d154260922c203d8022832ca"><div class="ttname"><a href="a01625.html#ga0306bec5d154260922c203d8022832ca">tesseract::TessBaseAPI::MakeTBLOB</a></div><div class="ttdeci">static TBLOB * MakeTBLOB(Pix *pix)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02690">baseapi.cpp:2690</a></div></div>
<div class="ttc" id="a02186_html_a12dda612630eba40e15f9d0b9955a04c"><div class="ttname"><a href="a02186.html#a12dda612630eba40e15f9d0b9955a04c">tesseract::TessBaseAPI::page_res_</a></div><div class="ttdeci">PAGE_RES * page_res_</div><div class="ttdoc">The page-level data. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00877">baseapi.h:877</a></div></div>
<div class="ttc" id="a02602_html_ab90b9f9f303420fee80622acd9d268f2"><div class="ttname"><a href="a02602.html#ab90b9f9f303420fee80622acd9d268f2">BLOB_CHOICE::rating</a></div><div class="ttdeci">float rating() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00080">ratngs.h:80</a></div></div>
<div class="ttc" id="a04078_html"><div class="ttname"><a href="a04078.html">INT_FX_RESULT_STRUCT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00725_source.html#l00035">intfx.h:35</a></div></div>
<div class="ttc" id="a02186_html_a0222d0f645909860d13f71c078008133"><div class="ttname"><a href="a02186.html#a0222d0f645909860d13f71c078008133">tesseract::TessBaseAPI::equ_detect_</a></div><div class="ttdeci">EquationDetect * equ_detect_</div><div class="ttdoc">The equation detector. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00872">baseapi.h:872</a></div></div>
<div class="ttc" id="a01629_html_a338d4c8b5d497b5ec3e6e4269d8ac66aa6c70374f53473ba410723e32b12f3f01"><div class="ttname"><a href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa6c70374f53473ba410723e32b12f3f01">tesseract::PSM_AUTO_ONLY</a></div><div class="ttdoc">Automatic page segmentation, but no OSD, or OCR. </div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00167">publictypes.h:167</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7">tesseract::PageIteratorLevel</a></div><div class="ttdeci">PageIteratorLevel</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00219">publictypes.h:219</a></div></div>
<div class="ttc" id="a02834_html"><div class="ttname"><a href="a02834.html">STRING</a></div><div class="ttdef"><b>Definition:</b> <a href="a00584_source.html#l00045">strngs.h:45</a></div></div>
<div class="ttc" id="a01625_html_ga8f69791ff9730a032068c87bd7b92ca1"><div class="ttname"><a href="a01625.html#ga8f69791ff9730a032068c87bd7b92ca1">tesseract::TessBaseAPI::DeleteBlockList</a></div><div class="ttdeci">static void DeleteBlockList(BLOCK_LIST *block_list)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02668">baseapi.cpp:2668</a></div></div>
<div class="ttc" id="a02634_html"><div class="ttname"><a href="a02634.html">C_BLOB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00037">stepblob.h:37</a></div></div>
<div class="ttc" id="a01627_html_ga978edc537da096ec07d4bb8e4ae5332d"><div class="ttname"><a href="a01627.html#ga978edc537da096ec07d4bb8e4ae5332d">tesseract::TessBaseAPI::rect_height_</a></div><div class="ttdeci">int rect_height_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00894">baseapi.h:894</a></div></div>
<div class="ttc" id="a00503_html_a5bc45d1c7b7602898f2c7edc72cbcd37"><div class="ttname"><a href="a00503.html#a5bc45d1c7b7602898f2c7edc72cbcd37">signal_exit</a></div><div class="ttdeci">void signal_exit(int signal_code)</div><div class="ttdef"><b>Definition:</b> <a href="a00521_source.html#l00053">globaloc.cpp:53</a></div></div>
<div class="ttc" id="a00086_html"><div class="ttname"><a href="a00086.html">equationdetect.h</a></div></div>
<div class="ttc" id="a01629_html_a28b14f9ab9d686fb45e130abc15c1781"><div class="ttname"><a href="a01629.html#a28b14f9ab9d686fb45e130abc15c1781">tesseract::TextlineOrder</a></div><div class="ttdeci">TextlineOrder</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00152">publictypes.h:152</a></div></div>
<div class="ttc" id="a02666_html_a4932d2070d3b91264958078abc991b17"><div class="ttname"><a href="a02666.html#a4932d2070d3b91264958078abc991b17">tesseract::CCUtil::datadir</a></div><div class="ttdeci">STRING datadir</div><div class="ttdef"><b>Definition:</b> <a href="a00476_source.html#l00064">ccutil.h:64</a></div></div>
<div class="ttc" id="a02186_html_a9fa206aa9e155ac8ff31b60a0ef128ca"><div class="ttname"><a href="a02186.html#a9fa206aa9e155ac8ff31b60a0ef128ca">tesseract::TessBaseAPI::getOpenCLDevice</a></div><div class="ttdeci">static size_t getOpenCLDevice(void **device)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00239">baseapi.cpp:239</a></div></div>
<div class="ttc" id="a01625_html_ga045996c07e93669ff274cfab922eb39b"><div class="ttname"><a href="a01625.html#ga045996c07e93669ff274cfab922eb39b">tesseract::TessBaseAPI::IsValidCharacter</a></div><div class="ttdeci">bool IsValidCharacter(const char *utf8_character)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02242">baseapi.cpp:2242</a></div></div>
<div class="ttc" id="a02346_html_ad3fc35a630d943424dbca9cf217a8980"><div class="ttname"><a href="a02346.html#ad3fc35a630d943424dbca9cf217a8980">tesseract::ResultIterator::IsAtBeginningOf</a></div><div class="ttdeci">virtual bool IsAtBeginningOf(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00498">resultiterator.cpp:498</a></div></div>
<div class="ttc" id="a02250_html_a6a640541c34bb3e1a395453d991267fa"><div class="ttname"><a href="a02250.html#a6a640541c34bb3e1a395453d991267fa">tesseract::LTRResultIterator::Confidence</a></div><div class="ttdeci">float Confidence(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00101_source.html#l00096">ltrresultiterator.cpp:96</a></div></div>
<div class="ttc" id="a02358_html_af0786d38a5addce72e377b9479170522"><div class="ttname"><a href="a02358.html#af0786d38a5addce72e377b9479170522">tesseract::Tesseract::get_sub_lang</a></div><div class="ttdeci">Tesseract * get_sub_lang(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00276">tesseractclass.h:276</a></div></div>
<div class="ttc" id="a01625_html_gaaac2abf8505c89afb8466dc3cff2c666"><div class="ttname"><a href="a01625.html#gaaac2abf8505c89afb8466dc3cff2c666">tesseract::TessBaseAPI::AnalyseLayout</a></div><div class="ttdeci">PageIterator * AnalyseLayout()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00824">baseapi.cpp:824</a></div></div>
<div class="ttc" id="a01629_html_a65cdf27a58055de3324687ee56b1dcba"><div class="ttname"><a href="a01629.html#a65cdf27a58055de3324687ee56b1dcba">tesseract::DetectParagraphs</a></div><div class="ttdeci">void DetectParagraphs(int debug_level, GenericVector< RowInfo > *row_infos, GenericVector< PARA *> *row_owners, PARA_LIST *paragraphs, GenericVector< ParagraphModel *> *models)</div><div class="ttdef"><b>Definition:</b> <a href="a00140_source.html#l02271">paragraphs.cpp:2271</a></div></div>
<div class="ttc" id="a00557_html"><div class="ttname"><a href="a00557.html">params.h</a></div></div>
<div class="ttc" id="a02186_html_a74a291190aa0bbf90b57f678b1fb0a5c"><div class="ttname"><a href="a02186.html#a74a291190aa0bbf90b57f678b1fb0a5c">tesseract::TessBaseAPI::language_</a></div><div class="ttdeci">STRING * language_</div><div class="ttdoc">Last initialized language. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00881">baseapi.h:881</a></div></div>
<div class="ttc" id="a00374_html"><div class="ttname"><a href="a00374.html">polyblk.h</a></div></div>
<div class="ttc" id="a02358_html_a9ea498e7c3d83469257493f8900c3922"><div class="ttname"><a href="a02358.html#a9ea498e7c3d83469257493f8900c3922">tesseract::Tesseract::tessedit_page_number</a></div><div class="ttdeci">int tessedit_page_number</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01087">tesseractclass.h:1087</a></div></div>
<div class="ttc" id="a01626_html_ga554e33b4a8fa10ccd2200698ded6753d"><div class="ttname"><a href="a01626.html#ga554e33b4a8fa10ccd2200698ded6753d">tesseract::TessBaseAPI::TesseractExtractResult</a></div><div class="ttdeci">static TESS_LOCAL int TesseractExtractResult(char **text, int **lengths, float **costs, int **x0, int **y0, int **x1, int **y1, PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02877">baseapi.cpp:2877</a></div></div>
<div class="ttc" id="a01625_html_ga97d470c76d2ff9580ac70e547eb8be99"><div class="ttname"><a href="a01625.html#ga97d470c76d2ff9580ac70e547eb8be99">tesseract::TessBaseAPI::oem</a></div><div class="ttdeci">OcrEngineMode oem() const</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00785">baseapi.h:785</a></div></div>
<div class="ttc" id="a02346_html_abd8987e2387f1945b53cf23f99b663e1"><div class="ttname"><a href="a02346.html#abd8987e2387f1945b53cf23f99b663e1">tesseract::ResultIterator::Next</a></div><div class="ttdeci">virtual bool Next(PageIteratorLevel level)</div><div class="ttdef"><b>Definition:</b> <a href="a00170_source.html#l00423">resultiterator.cpp:423</a></div></div>
<div class="ttc" id="a02358_html_a053d30f2b3df317e0d12e4a64f10d831"><div class="ttname"><a href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tesseract::Tesseract::tessedit_pageseg_mode</a></div><div class="ttdeci">int tessedit_pageseg_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00825">tesseractclass.h:825</a></div></div>
<div class="ttc" id="a00344_html_affc9a96d31e23e645355e534f11c40e9ad0198ebd5b9e3299dd94f0c5f4d3e003"><div class="ttname"><a href="a00344.html#affc9a96d31e23e645355e534f11c40e9ad0198ebd5b9e3299dd94f0c5f4d3e003">CR_KEEP_SPACE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00162">pageres.h:162</a></div></div>
<div class="ttc" id="a02634_html_ae510f3d0e7398fbb46608082429eac89"><div class="ttname"><a href="a02634.html#ae510f3d0e7398fbb46608082429eac89">C_BLOB::out_list</a></div><div class="ttdeci">C_OUTLINE_LIST * out_list()</div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00070">stepblob.h:70</a></div></div>
<div class="ttc" id="a03950_html_aa19fb595808fe4688c580334937dfa45"><div class="ttname"><a href="a03950.html#aa19fb595808fe4688c580334937dfa45">UNICHARSET::id_to_unichar</a></div><div class="ttdeci">const char * id_to_unichar(UNICHAR_ID id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00620_source.html#l00290">unicharset.cpp:290</a></div></div>
<div class="ttc" id="a02182_html_a98f62dccd75224a60437c2761bd215cd"><div class="ttname"><a href="a02182.html#a98f62dccd75224a60437c2761bd215cd">GenericVector::delete_data_pointers</a></div><div class="ttdeci">void delete_data_pointers()</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00884">genericvector.h:884</a></div></div>
<div class="ttc" id="a02278_html"><div class="ttname"><a href="a02278.html">tesseract::PageIterator</a></div><div class="ttdef"><b>Definition:</b> <a href="a00128_source.html#l00052">pageiterator.h:52</a></div></div>
<div class="ttc" id="a00008_html"><div class="ttname"><a href="a00008.html">baseapi.h</a></div></div>
<div class="ttc" id="a02178_html"><div class="ttname"><a href="a02178.html">tesseract::TESS_CHAR</a></div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02802">baseapi.cpp:2802</a></div></div>
<div class="ttc" id="a01625_html_ga027054e6176889ff49a7108e174fce0f"><div class="ttname"><a href="a01625.html#ga027054e6176889ff49a7108e174fce0f">tesseract::TessBaseAPI::MeanTextConf</a></div><div class="ttdeci">int MeanTextConf()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02072">baseapi.cpp:2072</a></div></div>
<div class="ttc" id="a02558_html_a3f06f8e34fc5962f342daff9623463e9"><div class="ttname"><a href="a02558.html#a3f06f8e34fc5962f342daff9623463e9">PDBLK::bounding_box</a></div><div class="ttdeci">void bounding_box(ICOORD &bottom_left, ICOORD &top_right) const</div><div class="ttdoc">get box </div><div class="ttdef"><b>Definition:</b> <a href="a00356_source.html#l00060">pdblock.h:60</a></div></div>
<div class="ttc" id="a02786_html_afcea4319ceed9b37f3c43eec9ec5d55a"><div class="ttname"><a href="a02786.html#afcea4319ceed9b37f3c43eec9ec5d55a">ETEXT_DESC::cancel</a></div><div class="ttdeci">CANCEL_FUNC cancel</div><div class="ttdoc">for errcode use </div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00129">ocrclass.h:129</a></div></div>
<div class="ttc" id="a00380_html_a49b7c03fb4e55b82a8fd22b7c6094082"><div class="ttname"><a href="a00380.html#a49b7c03fb4e55b82a8fd22b7c6094082">PTIsTextType</a></div><div class="ttdeci">bool PTIsTextType(PolyBlockType type)</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00082">publictypes.h:82</a></div></div>
<div class="ttc" id="a02578_html"><div class="ttname"><a href="a02578.html">FCOORD</a></div><div class="ttdef"><b>Definition:</b> <a href="a00362_source.html#l00189">points.h:189</a></div></div>
<div class="ttc" id="a01629_html_a46ecbfaef9e549b16cd97fee9d4614d2"><div class="ttname"><a href="a01629.html#a46ecbfaef9e549b16cd97fee9d4614d2">tesseract::kOldVarsFile</a></div><div class="ttdeci">const char * kOldVarsFile</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00112">baseapi.cpp:112</a></div></div>
<div class="ttc" id="a03998_html_a8373b3d764ce82b5be835abea34ebd32"><div class="ttname"><a href="a03998.html#a8373b3d764ce82b5be835abea34ebd32">tesseract::Classify::WriteTRFile</a></div><div class="ttdeci">bool WriteTRFile(const STRING &filename)</div><div class="ttdef"><b>Definition:</b> <a href="a00650_source.html#l00102">blobclass.cpp:102</a></div></div>
<div class="ttc" id="a01629_html_a3ba7b8d4b2132f72118c62fba346ffd0"><div class="ttname"><a href="a01629.html#a3ba7b8d4b2132f72118c62fba346ffd0">tesseract::kInputFile</a></div><div class="ttdeci">const char * kInputFile</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00108">baseapi.cpp:108</a></div></div>
<div class="ttc" id="a04290_html_a3ed04d9d9419ce413e9e495b5c5001ad"><div class="ttname"><a href="a04290.html#a3ed04d9d9419ce413e9e495b5c5001ad">tesseract::Dict::getUnicharset</a></div><div class="ttdeci">const UNICHARSET & getUnicharset() const</div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00098">dict.h:98</a></div></div>
<div class="ttc" id="a00014_html_a79b401fe19433464a13b416108deb755"><div class="ttname"><a href="a00014.html#a79b401fe19433464a13b416108deb755">TessResultRenderer</a></div><div class="ttdeci">struct TessResultRenderer TessResultRenderer</div><div class="ttdef"><b>Definition:</b> <a href="a00014_source.html#l00083">capi.h:83</a></div></div>
<div class="ttc" id="a02278_html_aa1840ecf7f491f0ae1132f5b47efa802"><div class="ttname"><a href="a02278.html#aa1840ecf7f491f0ae1132f5b47efa802">tesseract::PageIterator::GetBinaryImage</a></div><div class="ttdeci">Pix * GetBinaryImage(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00409">pageiterator.cpp:409</a></div></div>
<div class="ttc" id="a02606_html_adf200132afabc2ee6ec256e516011007"><div class="ttname"><a href="a02606.html#adf200132afabc2ee6ec256e516011007">WERD_CHOICE::unichar_string</a></div><div class="ttdeci">const STRING & unichar_string() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00541">ratngs.h:541</a></div></div>
<div class="ttc" id="a02266_html"><div class="ttname"><a href="a02266.html">OSResults</a></div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00049">osdetect.h:49</a></div></div>
<div class="ttc" id="a01629_html_a688dc51b653c642009af87c6d9b9dea2"><div class="ttname"><a href="a01629.html#a688dc51b653c642009af87c6d9b9dea2">tesseract::kMaxBytesPerLine</a></div><div class="ttdeci">const int kMaxBytesPerLine</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01835">baseapi.cpp:1835</a></div></div>
<div class="ttc" id="a00260_html"><div class="ttname"><a href="a00260.html">coutln.h</a></div></div>
<div class="ttc" id="a01625_html_ga64e6691378dc07208749d288d1820403"><div class="ttname"><a href="a01625.html#ga64e6691378dc07208749d288d1820403">tesseract::TessBaseAPI::GetTextlines</a></div><div class="ttdeci">Boxa * GetTextlines(const bool raw_image, const int raw_padding, Pixa **pixa, int **blockids, int **paraids)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00675">baseapi.cpp:675</a></div></div>
<div class="ttc" id="a00908_html"><div class="ttname"><a href="a00908.html">dict.h</a></div></div>
<div class="ttc" id="a01625_html_ga29906219f78adc7fd76a83bde37e09eb"><div class="ttname"><a href="a01625.html#ga29906219f78adc7fd76a83bde37e09eb">tesseract::TessBaseAPI::GetMutableIterator</a></div><div class="ttdeci">MutableIterator * GetMutableIterator()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01316">baseapi.cpp:1316</a></div></div>
<div class="ttc" id="a02186_html_a22a0c520bc88e2d80fb8b6a10b7caba1"><div class="ttname"><a href="a02186.html#a22a0c520bc88e2d80fb8b6a10b7caba1">tesseract::TessBaseAPI::output_file_</a></div><div class="ttdeci">STRING * output_file_</div><div class="ttdoc">Name used by debug code. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00879">baseapi.h:879</a></div></div>
<div class="ttc" id="a02186_html_a896312e68d246b58e704a8f5576e6917"><div class="ttname"><a href="a02186.html#a896312e68d246b58e704a8f5576e6917">tesseract::TessBaseAPI::SetInputName</a></div><div class="ttdeci">void SetInputName(const char *name)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00278">baseapi.cpp:278</a></div></div>
<div class="ttc" id="a01627_html_gac71648cd860510ca65b94d87d7d9bb1f"><div class="ttname"><a href="a01627.html#gac71648cd860510ca65b94d87d7d9bb1f">tesseract::TessBaseAPI::rect_top_</a></div><div class="ttdeci">int rect_top_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00892">baseapi.h:892</a></div></div>
<div class="ttc" id="a02358_html_a6d07030a800baa51ecde2b96e4fef648"><div class="ttname"><a href="a02358.html#a6d07030a800baa51ecde2b96e4fef648">tesseract::Tesseract::tessedit_train_line_recognizer</a></div><div class="ttdeci">bool tessedit_train_line_recognizer</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00819">tesseractclass.h:819</a></div></div>
<div class="ttc" id="a01629_html_ad7ebf88af7dcdd155deb8655ba5991ff"><div class="ttname"><a href="a01629.html#ad7ebf88af7dcdd155deb8655ba5991ff">tesseract::ProbabilityInContextFunc</a></div><div class="ttdeci">double(Dict::* ProbabilityInContextFunc)(const char *lang, const char *context, int context_bytes, const char *character, int character_bytes)</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00079">baseapi.h:79</a></div></div>
<div class="ttc" id="a02610_html_af74fa3bf628c9426cd6f1141a87dc2e0"><div class="ttname"><a href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">TBOX::right</a></div><div class="ttdeci">int16_t right() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00079">rect.h:79</a></div></div>
<div class="ttc" id="a02358_html_a35e62e060c86649e14cdf688d09a0f7a"><div class="ttname"><a href="a02358.html#a35e62e060c86649e14cdf688d09a0f7a">tesseract::Tesseract::SetBlackAndWhitelist</a></div><div class="ttdeci">void SetBlackAndWhitelist()</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00609">tesseractclass.cpp:609</a></div></div>
<div class="ttc" id="a02186_html_a02df6c7886962e347e3c5f7c1f632337"><div class="ttname"><a href="a02186.html#a02df6c7886962e347e3c5f7c1f632337">tesseract::TessBaseAPI::~TessBaseAPI</a></div><div class="ttdeci">virtual ~TessBaseAPI()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00216">baseapi.cpp:216</a></div></div>
<div class="ttc" id="a02262_html_a67e009467e4db6c40777548ffdfe464e"><div class="ttname"><a href="a02262.html#a67e009467e4db6c40777548ffdfe464e">OSBestResult::oconfidence</a></div><div class="ttdeci">float oconfidence</div><div class="ttdef"><b>Definition:</b> <a href="a00116_source.html#l00046">osdetect.h:46</a></div></div>
<div class="ttc" id="a02186_html_a3785779c909fcdd77e24b340f5913e4b"><div class="ttname"><a href="a02186.html#a3785779c909fcdd77e24b340f5913e4b">tesseract::TessBaseAPI::Version</a></div><div class="ttdeci">static const char * Version()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00223">baseapi.cpp:223</a></div></div>
<div class="ttc" id="a02278_html_a7e7e1e6e23032c1fb6c10f8025c4fcf0"><div class="ttname"><a href="a02278.html#a7e7e1e6e23032c1fb6c10f8025c4fcf0">tesseract::PageIterator::Empty</a></div><div class="ttdeci">bool Empty(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00350">pageiterator.cpp:350</a></div></div>
<div class="ttc" id="a02186_html_ae16cc5135aba401b609e49d6790281e3"><div class="ttname"><a href="a02186.html#ae16cc5135aba401b609e49d6790281e3">tesseract::TessBaseAPI::ClearAdaptiveClassifier</a></div><div class="ttdeci">void ClearAdaptiveClassifier()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00579">baseapi.cpp:579</a></div></div>
<div class="ttc" id="a01625_html_ga6188cb0fdcf944408db772131c545429"><div class="ttname"><a href="a01625.html#ga6188cb0fdcf944408db772131c545429">tesseract::TessBaseAPI::MakeTessOCRRow</a></div><div class="ttdeci">static ROW * MakeTessOCRRow(float baseline, float xheight, float descender, float ascender)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02673">baseapi.cpp:2673</a></div></div>
<div class="ttc" id="a03998_html_a7d0ccfd06421346d8cda0f1b76fd8516"><div class="ttname"><a href="a03998.html#a7d0ccfd06421346d8cda0f1b76fd8516">tesseract::Classify::EnableLearning</a></div><div class="ttdeci">bool EnableLearning</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00525">classify.h:525</a></div></div>
<div class="ttc" id="a02278_html_a415ea7c61e24868bc67e676184be0bb9"><div class="ttname"><a href="a02278.html#a415ea7c61e24868bc67e676184be0bb9">tesseract::PageIterator::Next</a></div><div class="ttdeci">virtual bool Next(PageIteratorLevel level)</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00148">pageiterator.cpp:148</a></div></div>
<div class="ttc" id="a00113_html_a2a5f7b79012274ece9289a2bb72979c7"><div class="ttname"><a href="a00113.html#a2a5f7b79012274ece9289a2bb72979c7">OrientationIdToValue</a></div><div class="ttdeci">int OrientationIdToValue(const int &id)</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00568">osdetect.cpp:568</a></div></div>
<div class="ttc" id="a02186_html_a0a1d63bf472c0c2fd3d2b82f5aba6ebb"><div class="ttname"><a href="a02186.html#a0a1d63bf472c0c2fd3d2b82f5aba6ebb">tesseract::TessBaseAPI::GetInputName</a></div><div class="ttdeci">const char * GetInputName()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00972">baseapi.cpp:972</a></div></div>
<div class="ttc" id="a01073_html_a0a1c82e812e15164718039c84cd9e97b"><div class="ttname"><a href="a01073.html#a0a1c82e812e15164718039c84cd9e97b">PERF_COUNT_END</a></div><div class="ttdeci">#define PERF_COUNT_END</div><div class="ttdef"><b>Definition:</b> <a href="a01073_source.html#l00135">openclwrapper.h:135</a></div></div>
<div class="ttc" id="a04866_html_a5f360cd76704a08b03a4738a97e8457b"><div class="ttname"><a href="a04866.html#a5f360cd76704a08b03a4738a97e8457b">tesseract::Wordrec::wordrec_run_blamer</a></div><div class="ttdeci">bool wordrec_run_blamer</div><div class="ttdef"><b>Definition:</b> <a href="a01622_source.html#l00237">wordrec.h:237</a></div></div>
<div class="ttc" id="a01629_html_a338d4c8b5d497b5ec3e6e4269d8ac66aa319d6168eaa4b2002ac84c0558ba947d"><div class="ttname"><a href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66aa319d6168eaa4b2002ac84c0558ba947d">tesseract::PSM_OSD_ONLY</a></div><div class="ttdoc">Orientation and script detection only. </div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00164">publictypes.h:164</a></div></div>
<div class="ttc" id="a01627_html_gaf3238cd7ff2c0995e647c8c7846bdba3"><div class="ttname"><a href="a01627.html#gaf3238cd7ff2c0995e647c8c7846bdba3">tesseract::TessBaseAPI::image_width_</a></div><div class="ttdeci">int image_width_</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00895">baseapi.h:895</a></div></div>
<div class="ttc" id="a02186_html_a4690919aa9d4eabda36bdefdaadf7ac9"><div class="ttname"><a href="a02186.html#a4690919aa9d4eabda36bdefdaadf7ac9">tesseract::TessBaseAPI::input_file_</a></div><div class="ttdeci">STRING * input_file_</div><div class="ttdoc">Name used by training code. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00878">baseapi.h:878</a></div></div>
<div class="ttc" id="a00527_html_af8739168d5b3235996eeb25dac3c4044"><div class="ttname"><a href="a00527.html#af8739168d5b3235996eeb25dac3c4044">ClipToRange</a></div><div class="ttdeci">T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)</div><div class="ttdef"><b>Definition:</b> <a href="a00527_source.html#l00111">helpers.h:111</a></div></div>
<div class="ttc" id="a01625_html_gafdd23f73100c54cff18ecfa14efa0379"><div class="ttname"><a href="a01625.html#gafdd23f73100c54cff18ecfa14efa0379">tesseract::TessBaseAPI::GetRegions</a></div><div class="ttdeci">Boxa * GetRegions(Pixa **pixa)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00663">baseapi.cpp:663</a></div></div>
<div class="ttc" id="a02358_html_a4784885f7626438d0f5438c60fdac672"><div class="ttname"><a href="a02358.html#a4784885f7626438d0f5438c60fdac672">tesseract::Tesseract::read_config_file</a></div><div class="ttdeci">void read_config_file(const char *filename, SetParamConstraint constraint)</div><div class="ttdef"><b>Definition:</b> <a href="a00182_source.html#l00060">tessedit.cpp:60</a></div></div>
<div class="ttc" id="a02546_html_ab29005f235cc738eebafb7d9ed6fe70b"><div class="ttname"><a href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">PAGE_RES_IT::forward</a></div><div class="ttdeci">WERD_RES * forward()</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00731">pageres.h:731</a></div></div>
<div class="ttc" id="a01625_html_ga2c06caf08c9a8aa97a08a2de2f6200df"><div class="ttname"><a href="a01625.html#ga2c06caf08c9a8aa97a08a2de2f6200df">tesseract::TessBaseAPI::IsValidWord</a></div><div class="ttdeci">int IsValidWord(const char *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02238">baseapi.cpp:2238</a></div></div>
<div class="ttc" id="a01629_html_a04550a0ed1279562027bf2fc92c421aeaea8028f61e76a0f4def7cbe7905206cf"><div class="ttname"><a href="a01629.html#a04550a0ed1279562027bf2fc92c421aeaea8028f61e76a0f4def7cbe7905206cf">tesseract::OEM_TESSERACT_ONLY</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00269">publictypes.h:269</a></div></div>
<div class="ttc" id="a03050_html_a36fb0a456ac52e8d8bdbc8f2488333ad"><div class="ttname"><a href="a03050.html#a36fb0a456ac52e8d8bdbc8f2488333ad">TessCallback4::Run</a></div><div class="ttdeci">virtual void Run(A1, A2, A3, A4)=0</div></div>
<div class="ttc" id="a02398_html"><div class="ttname"><a href="a02398.html">TBLOB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00230_source.html#l00268">blobs.h:268</a></div></div>
<div class="ttc" id="a02278_html_adc92bf8a6f06f7204579a695b744822e"><div class="ttname"><a href="a02278.html#adc92bf8a6f06f7204579a695b744822e">tesseract::PageIterator::Orientation</a></div><div class="ttdeci">void Orientation(tesseract::Orientation *orientation, tesseract::WritingDirection *writing_direction, tesseract::TextlineOrder *textline_order, float *deskew_angle) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00511">pageiterator.cpp:511</a></div></div>
<div class="ttc" id="a02358_html_aaac7729b5dc17651a6b3ee44689302d5"><div class="ttname"><a href="a02358.html#aaac7729b5dc17651a6b3ee44689302d5">tesseract::Tesseract::CorrectClassifyWords</a></div><div class="ttdeci">void CorrectClassifyWords(PAGE_RES *page_res)</div></div>
<div class="ttc" id="a02266_html_ad92dc2530b0b907d6bbdafd50bc042e8"><div class="ttname"><a href="a02266.html#ad92dc2530b0b907d6bbdafd50bc042e8">OSResults::get_best_script</a></div><div class="ttdeci">TESS_API int get_best_script(int orientation_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00113_source.html#l00112">osdetect.cpp:112</a></div></div>
<div class="ttc" id="a02278_html_ab002592f10a06b03978f556154c6cfda"><div class="ttname"><a href="a02278.html#ab002592f10a06b03978f556154c6cfda">tesseract::PageIterator::IsAtFinalElement</a></div><div class="ttdeci">virtual bool IsAtFinalElement(PageIteratorLevel level, PageIteratorLevel element) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00210">pageiterator.cpp:210</a></div></div>
<div class="ttc" id="a02278_html_a2b924b32152716f12b3b75cf470f6d09"><div class="ttname"><a href="a02278.html#a2b924b32152716f12b3b75cf470f6d09">tesseract::PageIterator::BoundingBoxInternal</a></div><div class="ttdeci">bool BoundingBoxInternal(PageIteratorLevel level, int *left, int *top, int *right, int *bottom) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00266">pageiterator.cpp:266</a></div></div>
<div class="ttc" id="a03998_html_aebf3ab5242102dae50387686363b7bce"><div class="ttname"><a href="a03998.html#aebf3ab5242102dae50387686363b7bce">tesseract::Classify::AdaptToChar</a></div><div class="ttdeci">void AdaptToChar(TBLOB *Blob, CLASS_ID ClassId, int FontinfoId, float Threshold, ADAPT_TEMPLATES adaptive_templates)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00857">adaptmatch.cpp:857</a></div></div>
<div class="ttc" id="a00605_html_abc3119a959ecd5cffc1d9b9d57479dbaa252615b6d7ebef9293183f6e94488cc1"><div class="ttname"><a href="a00605.html#abc3119a959ecd5cffc1d9b9d57479dbaa252615b6d7ebef9293183f6e94488cc1">DIR_MIX</a></div><div class="ttdef"><b>Definition:</b> <a href="a00605_source.html#l00046">unichar.h:46</a></div></div>
<div class="ttc" id="a00653_html"><div class="ttname"><a href="a00653.html">blobclass.h</a></div></div>
<div class="ttc" id="a01625_html_ga4a67a12db21b3569b2b50ad05b9e146a"><div class="ttname"><a href="a01625.html#ga4a67a12db21b3569b2b50ad05b9e146a">tesseract::TessBaseAPI::AllWordConfidences</a></div><div class="ttdeci">int * AllWordConfidences()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02084">baseapi.cpp:2084</a></div></div>
<div class="ttc" id="a02358_html_a02591ce36a6ff477040bf844b4d1d364"><div class="ttname"><a href="a02358.html#a02591ce36a6ff477040bf844b4d1d364">tesseract::Tesseract::recog_training_segmented</a></div><div class="ttdeci">void recog_training_segmented(const STRING &fname, PAGE_RES *page_res, volatile ETEXT_DESC *monitor, FILE *output_file)</div><div class="ttdef"><b>Definition:</b> <a href="a00161_source.html#l00082">recogtraining.cpp:82</a></div></div>
<div class="ttc" id="a02786_html"><div class="ttname"><a href="a02786.html">ETEXT_DESC</a></div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00119">ocrclass.h:119</a></div></div>
<div class="ttc" id="a02186_html_a96899e8e5358d96752ab1cfc3bc09f3e"><div class="ttname"><a href="a02186.html#a96899e8e5358d96752ab1cfc3bc09f3e">tesseract::TessBaseAPI::Init</a></div><div class="ttdeci">int Init(const char *datapath, const char *language, OcrEngineMode mode, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_non_debug_params)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00353">baseapi.cpp:353</a></div></div>
<div class="ttc" id="a02686_html"><div class="ttname"><a href="a02686.html">ELIST_LINK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00491_source.html#l00084">elst.h:84</a></div></div>
<div class="ttc" id="a00380_html_a50de1107a605eb91c55d5b12f72a0700"><div class="ttname"><a href="a00380.html#a50de1107a605eb91c55d5b12f72a0700">kMinCredibleResolution</a></div><div class="ttdeci">constexpr int kMinCredibleResolution</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00038">publictypes.h:38</a></div></div>
<div class="ttc" id="a00116_html"><div class="ttname"><a href="a00116.html">osdetect.h</a></div></div>
<div class="ttc" id="a01073_html_a61302b59795a7ee480de0bb07dda984a"><div class="ttname"><a href="a01073.html#a61302b59795a7ee480de0bb07dda984a">PERF_COUNT_SUB</a></div><div class="ttdeci">#define PERF_COUNT_SUB(SUB)</div><div class="ttdef"><b>Definition:</b> <a href="a01073_source.html#l00147">openclwrapper.h:147</a></div></div>
<div class="ttc" id="a00551_html"><div class="ttname"><a href="a00551.html">ocrclass.h</a></div></div>
<div class="ttc" id="a02610_html_a9fee4521e71300975cb34ebb21e3fca5"><div class="ttname"><a href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">TBOX::bottom</a></div><div class="ttdeci">int16_t bottom() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00065">rect.h:65</a></div></div>
<div class="ttc" id="a02190_html_a64def5e1f46676190e5af46f23adab88"><div class="ttname"><a href="a02190.html#a64def5e1f46676190e5af46f23adab88">tesseract::TessResultRenderer::EndDocument</a></div><div class="ttdeci">bool EndDocument()</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00093">renderer.cpp:93</a></div></div>
<div class="ttc" id="a01629_html_aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610"><div class="ttname"><a href="a01629.html#aa26c22b65cc9765a0e747120f4287fd7afd466aec253e5daa6f0c112b0f0e0610">tesseract::RIL_WORD</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00223">publictypes.h:223</a></div></div>
<div class="ttc" id="a02398_html_a3c9282cad4102157d214bcc6311cda07"><div class="ttname"><a href="a02398.html#a3c9282cad4102157d214bcc6311cda07">TBLOB::outlines</a></div><div class="ttdeci">TESSLINE * outlines</div><div class="ttdef"><b>Definition:</b> <a href="a00230_source.html#l00384">blobs.h:384</a></div></div>
<div class="ttc" id="a02358_html_ae0b47fae13d07d3af456c0ec4f990d65"><div class="ttname"><a href="a02358.html#ae0b47fae13d07d3af456c0ec4f990d65">tesseract::Tesseract::AnyLSTMLang</a></div><div class="ttdeci">bool AnyLSTMLang() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00288">tesseractclass.h:288</a></div></div>
<div class="ttc" id="a00560_html_ab99ded389af74001a6298fc9e44e74e5"><div class="ttname"><a href="a00560.html#ab99ded389af74001a6298fc9e44e74e5">MAX_PATH</a></div><div class="ttdeci">#define MAX_PATH</div><div class="ttdef"><b>Definition:</b> <a href="a00560_source.html#l00042">platform.h:42</a></div></div>
<div class="ttc" id="a02786_html_a16abfdff240ef121844b07bfa3afd4b5"><div class="ttname"><a href="a02786.html#a16abfdff240ef121844b07bfa3afd4b5">ETEXT_DESC::set_deadline_msecs</a></div><div class="ttdeci">void set_deadline_msecs(int32_t deadline_msecs)</div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00152">ocrclass.h:152</a></div></div>
<div class="ttc" id="a01160_html_a16ca13da58e65267e7e34355091ca891"><div class="ttname"><a href="a01160.html#a16ca13da58e65267e7e34355091ca891">extract_edges</a></div><div class="ttdeci">void extract_edges(Pix *pix, BLOCK *block)</div><div class="ttdef"><b>Definition:</b> <a href="a01160_source.html#l00334">edgblob.cpp:334</a></div></div>
<div class="ttc" id="a01625_html_ga4133bcbe38dca1173db2882ef0727703"><div class="ttname"><a href="a01625.html#ga4133bcbe38dca1173db2882ef0727703">tesseract::TessBaseAPI::GetWords</a></div><div class="ttdeci">Boxa * GetWords(Pixa **pixa)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00698">baseapi.cpp:698</a></div></div>
<div class="ttc" id="a01625_html_ga7a7b2870798363811c011cec2bfbf22c"><div class="ttname"><a href="a01625.html#ga7a7b2870798363811c011cec2bfbf22c">tesseract::TessBaseAPI::SetDictFunc</a></div><div class="ttdeci">void SetDictFunc(DictFunc f)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02284">baseapi.cpp:2284</a></div></div>
<div class="ttc" id="a02602_html_ad448095b666bfb864211714ec2c2375e"><div class="ttname"><a href="a02602.html#ad448095b666bfb864211714ec2c2375e">BLOB_CHOICE::unichar_id</a></div><div class="ttdeci">UNICHAR_ID unichar_id() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00077">ratngs.h:77</a></div></div>
<div class="ttc" id="a01626_html_ga0384f67e497ea3e81436d09da0ad7270"><div class="ttname"><a href="a01626.html#ga0384f67e497ea3e81436d09da0ad7270">tesseract::TessBaseAPI::RecognitionPass1</a></div><div class="ttdeci">TESS_LOCAL PAGE_RES * RecognitionPass1(BLOCK_LIST *block_list)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02786">baseapi.cpp:2786</a></div></div>
<div class="ttc" id="a02514_html_a9e4346e037f2cc01c3c51d888531da74"><div class="ttname"><a href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">BLOCK::pdblk</a></div><div class="ttdeci">PDBLK pdblk</div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00192">ocrblock.h:192</a></div></div>
<div class="ttc" id="a01629_html_aa46d9454c58be9a34a7a91737d553900"><div class="ttname"><a href="a01629.html#aa46d9454c58be9a34a7a91737d553900">tesseract::kNumbersPerBlob</a></div><div class="ttdeci">const int kNumbersPerBlob</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01815">baseapi.cpp:1815</a></div></div>
<div class="ttc" id="a02834_html_a7a1f2a841e8d01d5a8c05bc3ab8064eb"><div class="ttname"><a href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">STRING::length</a></div><div class="ttdeci">int32_t length() const</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00191">strngs.cpp:191</a></div></div>
<div class="ttc" id="a01629_html_a338d4c8b5d497b5ec3e6e4269d8ac66a"><div class="ttname"><a href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">tesseract::PageSegMode</a></div><div class="ttdeci">PageSegMode</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00163">publictypes.h:163</a></div></div>
<div class="ttc" id="a02542_html_a3d42ac7ec121263e757c9b7160dfd50d"><div class="ttname"><a href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">WERD_RES::best_choice</a></div><div class="ttdeci">WERD_CHOICE * best_choice</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00235">pageres.h:235</a></div></div>
<div class="ttc" id="a01625_html_ga9357ba1744639613b65dc803d11b8a60"><div class="ttname"><a href="a01625.html#ga9357ba1744639613b65dc803d11b8a60">tesseract::TessBaseAPI::GetOsdText</a></div><div class="ttdeci">char * GetOsdText(int page_number)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02041">baseapi.cpp:2041</a></div></div>
<div class="ttc" id="a02362_html_a4e7f450e7c88d85a3e8dd8fa2baa3776"><div class="ttname"><a href="a02362.html#a4e7f450e7c88d85a3e8dd8fa2baa3776">tesseract::ImageThresholder::GetImageSizes</a></div><div class="ttdeci">virtual void GetImageSizes(int *left, int *top, int *width, int *height, int *imagewidth, int *imageheight)</div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00133">thresholder.cpp:133</a></div></div>
<div class="ttc" id="a00380_html_ab234efeaafa7336d56a5652a1891266e"><div class="ttname"><a href="a00380.html#ab234efeaafa7336d56a5652a1891266e">kMaxCredibleResolution</a></div><div class="ttdeci">constexpr int kMaxCredibleResolution</div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00040">publictypes.h:40</a></div></div>
<div class="ttc" id="a02542_html_a3a92c8c9750d78631d75998f008f366a"><div class="ttname"><a href="a02542.html#a3a92c8c9750d78631d75998f008f366a">WERD_RES::box_word</a></div><div class="ttdeci">tesseract::BoxWord * box_word</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00266">pageres.h:266</a></div></div>
<div class="ttc" id="a01625_html_gaca4e9a0d9cf388510168d9b58864d1e5"><div class="ttname"><a href="a01625.html#gaca4e9a0d9cf388510168d9b58864d1e5">tesseract::TessBaseAPI::DetectOrientationScript</a></div><div class="ttdeci">bool DetectOrientationScript(int *orient_deg, float *orient_conf, const char **script_name, float *script_conf)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02010">baseapi.cpp:2010</a></div></div>
<div class="ttc" id="a03998_html_a2fc1971dc1e42946245c98a9312326ae"><div class="ttname"><a href="a03998.html#a2fc1971dc1e42946245c98a9312326ae">tesseract::Classify::LearnWord</a></div><div class="ttdeci">void LearnWord(const char *fontname, WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00251">adaptmatch.cpp:251</a></div></div>
<div class="ttc" id="a02358_html_a3af5306b9473bede1537854e54fa796d"><div class="ttname"><a href="a02358.html#a3af5306b9473bede1537854e54fa796d">tesseract::Tesseract::num_sub_langs</a></div><div class="ttdeci">int num_sub_langs() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00273">tesseractclass.h:273</a></div></div>
<div class="ttc" id="a01625_html_ga52eee8b9a4f147c26e4b64c16b46bc04"><div class="ttname"><a href="a01625.html#ga52eee8b9a4f147c26e4b64c16b46bc04">tesseract::TessBaseAPI::GetIterator</a></div><div class="ttdeci">ResultIterator * GetIterator()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01299">baseapi.cpp:1299</a></div></div>
<div class="ttc" id="a01625_html_ga173b4289191b6c2faf2a4a4b7c94affc"><div class="ttname"><a href="a01625.html#ga173b4289191b6c2faf2a4a4b7c94affc">tesseract::TessBaseAPI::GetUNLVText</a></div><div class="ttdeci">char * GetUNLVText()</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01898">baseapi.cpp:1898</a></div></div>
<div class="ttc" id="a00902_html"><div class="ttname"><a href="a00902.html">dawg_cache.h</a></div></div>
<div class="ttc" id="a04290_html_a30bca2131edadf5771122574c2fab30d"><div class="ttname"><a href="a04290.html#a30bca2131edadf5771122574c2fab30d">tesseract::Dict::letter_is_okay_</a></div><div class="ttdeci">int(Dict::* letter_is_okay_)(void *void_dawg_args, const UNICHARSET &unicharset, UNICHAR_ID unichar_id, bool word_end) const</div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00357">dict.h:357</a></div></div>
<div class="ttc" id="a02186_html_a2e09259c558c6d8e0f7e523cbaf5adf5"><div class="ttname"><a href="a02186.html#a2e09259c558c6d8e0f7e523cbaf5adf5">tesseract::TessBaseAPI::SetVariable</a></div><div class="ttdeci">bool SetVariable(const char *name, const char *value)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l00293">baseapi.cpp:293</a></div></div>
<div class="ttc" id="a01629_html_a0c8529ffdf3ba5c8d219e377c13b1288"><div class="ttname"><a href="a01629.html#a0c8529ffdf3ba5c8d219e377c13b1288">tesseract::FillLatticeFunc</a></div><div class="ttdeci">void(Wordrec::* FillLatticeFunc)(const MATRIX &ratings, const WERD_CHOICE_LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle)</div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00086">baseapi.h:86</a></div></div>
<div class="ttc" id="a02578_html_abb9516f874133b689b0e62ac70874385"><div class="ttname"><a href="a02578.html#abb9516f874133b689b0e62ac70874385">FCOORD::y</a></div><div class="ttdeci">float y() const</div><div class="ttdef"><b>Definition:</b> <a href="a00362_source.html#l00211">points.h:211</a></div></div>
<div class="ttc" id="a01625_html_ga28d59ef954b789bef7c6766f6e265f49"><div class="ttname"><a href="a01625.html#ga28d59ef954b789bef7c6766f6e265f49">tesseract::TessBaseAPI::NumDawgs</a></div><div class="ttdeci">int NumDawgs() const</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l02627">baseapi.cpp:2627</a></div></div>
<div class="ttc" id="a01625_html_ga091018e103238979eac0912d3f5ff126"><div class="ttname"><a href="a01625.html#ga091018e103238979eac0912d3f5ff126">tesseract::TessBaseAPI::ProcessPagesInternal</a></div><div class="ttdeci">bool ProcessPagesInternal(const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01112">baseapi.cpp:1112</a></div></div>
<div class="ttc" id="a02358_html_ac91217d377d153e34cf89961cd9b0b2f"><div class="ttname"><a href="a02358.html#ac91217d377d153e34cf89961cd9b0b2f">tesseract::Tesseract::PrepareForPageseg</a></div><div class="ttdeci">void PrepareForPageseg()</div><div class="ttdef"><b>Definition:</b> <a href="a00188_source.html#l00624">tesseractclass.cpp:624</a></div></div>
<div class="ttc" id="a00173_html"><div class="ttname"><a href="a00173.html">resultiterator.h</a></div></div>
<div class="ttc" id="a00248_html"><div class="ttname"><a href="a00248.html">boxword.h</a></div></div>
<div class="ttc" id="a02538_html_ad3a856f3e9217c47b8f2f54cd3908721"><div class="ttname"><a href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">ROW_RES::row</a></div><div class="ttdeci">ROW * row</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00143">pageres.h:143</a></div></div>
<div class="ttc" id="a02834_html_a8cfe836a7f55f4761936ea2231b6b9d2"><div class="ttname"><a href="a02834.html#a8cfe836a7f55f4761936ea2231b6b9d2">STRING::assign</a></div><div class="ttdeci">void assign(const char *cstr, int len)</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00420">strngs.cpp:420</a></div></div>
<div class="ttc" id="a00503_html_a93a603f4063a6b9403d81caa245a583b"><div class="ttname"><a href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a></div><div class="ttdeci">#define ASSERT_HOST(x)</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00084">errcode.h:84</a></div></div>
<div class="ttc" id="a02362_html_a348726ab5c2807eaad1bff0b2d951997"><div class="ttname"><a href="a02362.html#a348726ab5c2807eaad1bff0b2d951997">tesseract::ImageThresholder::ThresholdToPix</a></div><div class="ttdeci">virtual bool ThresholdToPix(PageSegMode pageseg_mode, Pix **pix)</div><div class="ttdoc">Returns false on error. </div><div class="ttdef"><b>Definition:</b> <a href="a00203_source.html#l00184">thresholder.cpp:184</a></div></div>
<div class="ttc" id="a02186_html_a83549f01f06c140e14dad3f8c025d885"><div class="ttname"><a href="a02186.html#a83549f01f06c140e14dad3f8c025d885">tesseract::TessBaseAPI::reader_</a></div><div class="ttdeci">FileReader reader_</div><div class="ttdoc">Reads files from any filesystem. </div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00873">baseapi.h:873</a></div></div>
<div class="ttc" id="a02250_html_a1438c0a14a5cfaec1306e11ac336eee1"><div class="ttname"><a href="a02250.html#a1438c0a14a5cfaec1306e11ac336eee1">tesseract::LTRResultIterator::GetUTF8Text</a></div><div class="ttdeci">char * GetUTF8Text(PageIteratorLevel level) const</div><div class="ttdef"><b>Definition:</b> <a href="a00101_source.html#l00047">ltrresultiterator.cpp:47</a></div></div>
<div class="ttc" id="a00407_html"><div class="ttname"><a href="a00407.html">rect.h</a></div></div>
<div class="ttc" id="a01629_html_a294e870871cf3fb0928cbd5686346b3d"><div class="ttname"><a href="a01629.html#a294e870871cf3fb0928cbd5686346b3d">tesseract::kBytesPerBoxFileLine</a></div><div class="ttdeci">const int kBytesPerBoxFileLine</div><div class="ttdef"><b>Definition:</b> <a href="a00005_source.html#l01826">baseapi.cpp:1826</a></div></div>
<div class="ttc" id="a02542_html_afc15fa7c1b5ad55d6772dea0d6865df1"><div class="ttname"><a href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">WERD_RES::word</a></div><div class="ttdeci">WERD * word</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00189">pageres.h:189</a></div></div>
<div class="ttc" id="a02278_html_a60494e90122337da8440e48ad4fa23fc"><div class="ttname"><a href="a02278.html#a60494e90122337da8440e48ad4fa23fc">tesseract::PageIterator::GetImage</a></div><div class="ttdeci">Pix * GetImage(PageIteratorLevel level, int padding, Pix *original_img, int *left, int *top) const</div><div class="ttdef"><b>Definition:</b> <a href="a00125_source.html#l00445">pageiterator.cpp:445</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_fce9a394c0d2c636e610a0a34fe30580.html">tesseract-ocr.master</a></li><li class="navelem"><a class="el" href="dir_fd2783e80b2d56815818e17a68fc4d98.html">src</a></li><li class="navelem"><a class="el" href="dir_316d7b7f065455dc5a9611f5cda5f609.html">api</a></li><li class="navelem"><a class="el" href="a00005.html">baseapi.cpp</a></li>
<li class="footer">Generated on Mon Oct 29 2018 11:03:42 for tesseract by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>