-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patha00071_source.html
470 lines (468 loc) · 506 KB
/
a00071_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
<!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/ccmain/control.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('a00071_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">control.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00071.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: control.cpp (Formerly control.c)</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Description: Module-independent matcher controller.</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"> * Created: Thu Apr 23 11:09:58 BST 1992</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * ReHacked: Tue Sep 22 08:42:49 BST 1992 Phil Cheatle</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * (C) Copyright 1992, Hewlett-Packard Ltd.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> ** Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> ** you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> ** You may obtain a copy of the License at</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> ** http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ** Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> ** distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> ** See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> ** limitations under the License.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> *</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> **********************************************************************/</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// Include automatically generated configuration file if running autoconf.</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifdef HAVE_CONFIG_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "config_auto.h"</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <cmath></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <cstdint></span> <span class="comment">// for int16_t, int32_t</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <cstdio></span> <span class="comment">// for fclose, fopen, FILE</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <ctime></span> <span class="comment">// for clock</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <cctype></span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="a00857.html">callcpp.h</a>"</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "<a class="code" href="a00074.html">control.h</a>"</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="a00080.html">docqual.h</a>"</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "<a class="code" href="a01544.html">drawfx.h</a>"</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "<a class="code" href="a00092.html">fixspace.h</a>"</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#include "<a class="code" href="a00875.html">globals.h</a>"</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#include "<a class="code" href="a00971.html">lstmrecognizer.h</a>"</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#include "<a class="code" href="a00551.html">ocrclass.h</a>"</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#include "<a class="code" href="a00122.html">output.h</a>"</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor">#include "<a class="code" href="a00344.html">pageres.h</a>"</span> <span class="comment">// for WERD_RES, PAGE_RES_IT, PAGE_RES, BLO...</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#include "<a class="code" href="a00158.html">pgedit.h</a>"</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#include "<a class="code" href="a00167.html">reject.h</a>"</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include "<a class="code" href="a00578.html">sorthelper.h</a>"</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#include "<a class="code" href="a00191.html">tesseractclass.h</a>"</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#include "<a class="code" href="a00197.html">tessvars.h</a>"</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#include "<a class="code" href="a00212.html">werdit.h</a>"</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a00071.html#aca24741a901aa8187e889f1ef122f701"> 50</a></span> <span class="preprocessor">#define MIN_FONT_ROW_COUNT 8</span></div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="a00071.html#aa8d754cedd7892fe25f2035441f3f6b6"> 51</a></span> <span class="preprocessor">#define MAX_XHEIGHT_DIFF 3</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="a00071.html#a4976a2b3ea53d82ffdb2767bba98aa80"> 53</a></span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> <a class="code" href="a00071.html#a4976a2b3ea53d82ffdb2767bba98aa80">kBackUpConfigFile</a> = <span class="stringliteral">"tempconfigdata.config"</span>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment">// Min believable x-height for any text when refitting as a fraction of</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment">// original x-height</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="a00071.html#a91ae9908e7c8f49bf292bbdd6678230e"> 56</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="a00071.html#a91ae9908e7c8f49bf292bbdd6678230e">kMinRefitXHeightFraction</a> = 0.5;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">namespace </span><a class="code" href="a01629.html">tesseract</a> {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a02358.html#a3093301b400c069c830fcf58f19ae4c6"> 67</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a3093301b400c069c830fcf58f19ae4c6">Tesseract::recog_pseudo_word</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res,</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="a02610.html">TBOX</a> &selection_box) {</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a>* it = <a class="code" href="a00209.html#a4033d1ec3632e2e780817fc5932f5951">make_pseudo_word</a>(page_res, selection_box);</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">if</span> (it != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="a02358.html#a0b6bb89073c94c41d635dfa715da3056">recog_interactive</a>(it);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  it-><a class="code" href="a02546.html#afb987bf467ef552c49b962bf6872ad34">DeleteCurrentWord</a>();</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">delete</span> it;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="a02358.html#a0b6bb89073c94c41d635dfa715da3056"> 82</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#a0b6bb89073c94c41d635dfa715da3056">Tesseract::recog_interactive</a>(<a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it) {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  int16_t char_qual;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  int16_t good_char_qual;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="a02354.html">WordData</a> word_data(*pr_it);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">SetupWordPassN</a>(2, &word_data);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// LSTM doesn't run on pass2, but we want to run pass2 for tesseract.</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">if</span> (lstm_recognizer_ == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">classify_word_and_language</a>(2, pr_it, &word_data);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">classify_word_and_language</a>(1, pr_it, &word_data);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a68f5ca69771b04373ed13ee1b3d8f18b">tessedit_debug_quality_metrics</a>) {</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res = pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="a02358.html#a99a1e1a4cd1134ecab8028de820ae57a">word_char_quality</a>(word_res, pr_it-><a class="code" href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">row</a>()-><a class="code" href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">row</a>, &char_qual, &good_char_qual);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"\n%d chars; word_blob_quality: %d; outline_errs: %d; "</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="stringliteral">"char_quality: %d; good_char_quality: %d\n"</span>,</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  word_res-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#adb462d55dc4b682e0a77090185a58011">length</a>(),</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <a class="code" href="a02358.html#ad0d6e09c6386cb0d6d1bc4a34beb23fa">word_blob_quality</a>(word_res, pr_it-><a class="code" href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">row</a>()-><a class="code" href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">row</a>),</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="a02358.html#a37bfb6999dc3b5d05d4eeafa38571d9f">word_outline_errs</a>(word_res), char_qual, good_char_qual);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// Helper function to check for a target word and handle it appropriately.</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// Inspired by Jetsoft's requirement to process only single words on pass2</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// and beyond.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// If word_config is not null:</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// If the word_box and target_word_box overlap, read the word_config file</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment">// else reset to previous config data.</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// return true.</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// else</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// If the word_box and target_word_box overlap or pass <= 1, return true.</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// Note that this function uses a fixed temporary file for storing the previous</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment">// configs, so it is neither thread-safe, nor process-safe, but the assumption</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment">// is that it will only be used for one debug window at a time.</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment">//</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// Since this function is used for debugging (and not to change OCR results)</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// set only debug params from the word config file.</span></div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="a02358.html#ac5790042616434be2d95f33dc62f9c04"> 125</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#ac5790042616434be2d95f33dc62f9c04">Tesseract::ProcessTargetWord</a>(<span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a>& word_box,</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a>& target_word_box,</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* word_config,</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordtype">int</span> pass) {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">if</span> (word_config != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">if</span> (word_box.<a class="code" href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">major_overlap</a>(target_word_box)) {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span> (backup_config_file_ == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  backup_config_file_ = <a class="code" href="a00071.html#a4976a2b3ea53d82ffdb2767bba98aa80">kBackUpConfigFile</a>;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  FILE* config_fp = fopen(backup_config_file_, <span class="stringliteral">"wb"</span>);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">if</span> (config_fp == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Error, failed to open file \"%s\"\n"</span>, backup_config_file_);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <a class="code" href="a02794.html#ac9884aced9c9941e8df8763960d798c4">ParamUtils::PrintParams</a>(config_fp, <a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  fclose(config_fp);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  }</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <a class="code" href="a02794.html#a0709ab180ade22613925bc317ddf34b7">ParamUtils::ReadParamsFile</a>(word_config,</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0">SET_PARAM_CONSTRAINT_DEBUG_ONLY</a>,</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</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>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span> (backup_config_file_ != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <a class="code" href="a02794.html#a0709ab180ade22613925bc317ddf34b7">ParamUtils::ReadParamsFile</a>(backup_config_file_,</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <a class="code" href="a01629.html#a0fc9989588ecf8f236da49b58f96a6c5ab006bbe489e53081990e1f41174bb9e0">SET_PARAM_CONSTRAINT_DEBUG_ONLY</a>,</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <a class="code" href="a02666.html#ac993425386ae1f73762107299ee8a114">params</a>());</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  backup_config_file_ = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pass > 1 && !word_box.<a class="code" href="a02610.html#a79f654ae8a2a33cbb2a1985cb97d143c">major_overlap</a>(target_word_box)) {</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> </div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="a02358.html#a22b976f806f8e8882aed22a525729289"> 159</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a22b976f806f8e8882aed22a525729289">Tesseract::SetupAllWordsPassN</a>(<span class="keywordtype">int</span> pass_n,</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a>* target_word_box,</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* word_config,</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <a class="code" href="a02530.html">PAGE_RES</a>* page_res,</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="a02182.html">GenericVector<WordData></a>* words) {</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="comment">// Prepare all the words.</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</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="l00167"></a><span class="lineno"> 167</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">if</span> (target_word_box == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <a class="code" href="a02358.html#ac5790042616434be2d95f33dc62f9c04">ProcessTargetWord</a>(page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><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="l00170"></a><span class="lineno"> 170</span>  *target_word_box, word_config, 1)) {</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  words-><a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(<a class="code" href="a02354.html">WordData</a>(page_res_it));</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</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>  <span class="comment">// Setup all the words for recognition with polygonal approximation.</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> w = 0; w < words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++w) {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">SetupWordPassN</a>(pass_n, &(*words)[w]);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">if</span> (w > 0) (*words)[w].prev_word = &(*words)[w - 1];</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> }</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> <span class="comment">// Sets up the single word ready for whichever engine is to be run.</span></div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a"> 182</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">Tesseract::SetupWordPassN</a>(<span class="keywordtype">int</span> pass_n, <a class="code" href="a02354.html">WordData</a>* word) {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">if</span> (pass_n == 1 || !word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a>) {</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordflow">if</span> (pass_n == 1) {</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#adac960c00c2ae389886c91af9882ae00">SetupForRecognition</a>(<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>, <span class="keyword">this</span>, <a class="code" href="a02358.html#aec5d4e081fee6da40258b0b074342205">BestPix</a>(),</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a>, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <a class="code" href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">classify_bln_numeric_mode</a>,</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="a02358.html#a5873c7054e8cba3e64fc3f20b2a93ca3">textord_use_cjk_fp_model</a>,</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">poly_allow_detailed_fx</a>,</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  word-><a class="code" href="a02354.html#a09761e92902bb23f628aad4f1921e185">row</a>, word-><a class="code" href="a02354.html#ab19dcdca65fe4c60d68bfe94cbf3a241">block</a>);</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pass_n == 2) {</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// TODO(rays) Should we do this on pass1 too?</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#aea384afb374c13829bfaab3efa5eafa0">caps_height</a> = 0.0;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> == 0.0f)</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> = word-><a class="code" href="a02354.html#a09761e92902bb23f628aad4f1921e185">row</a>-><a class="code" href="a02526.html#aced2e98c94f532c5c5809d63aef4b9de">x_height</a>();</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  }</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  word-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>.<a class="code" href="a02730.html#a6e86ffdfaba525c20e1a87c418ba980b">truncate</a>(0);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> s = 0; s <= sub_langs_.size(); ++s) {</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">// The sub_langs_.size() entry is for the master language.</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="a02358.html">Tesseract</a>* lang_t = s < sub_langs_.size() ? sub_langs_[s] : <span class="keyword">this</span>;</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res = <span class="keyword">new</span> <a class="code" href="a02542.html">WERD_RES</a>;</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  word_res-><a class="code" href="a02542.html#af63cf973974fc961f82fae0af07a635d">InitForRetryRecognition</a>(*word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>);</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  word-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(word_res);</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// LSTM doesn't get setup for pass2.</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">if</span> (pass_n == 1 || lang_t-><a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> != <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a>) {</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  word_res-><a class="code" href="a02542.html#adac960c00c2ae389886c91af9882ae00">SetupForRecognition</a>(</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  lang_t-><a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>, lang_t, <a class="code" href="a02358.html#aec5d4e081fee6da40258b0b074342205">BestPix</a>(),</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  lang_t-><a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a>, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  lang_t-><a class="code" href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">classify_bln_numeric_mode</a>,</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  lang_t-><a class="code" href="a02358.html#a5873c7054e8cba3e64fc3f20b2a93ca3">textord_use_cjk_fp_model</a>,</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  lang_t-><a class="code" href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">poly_allow_detailed_fx</a>, word-><a class="code" href="a02354.html#a09761e92902bb23f628aad4f1921e185">row</a>, word-><a class="code" href="a02354.html#ab19dcdca65fe4c60d68bfe94cbf3a241">block</a>);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  }</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</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"> 216</span> </div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> <span class="comment">// Runs word recognition on all the words.</span></div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="a02358.html#aea9ca5556015a303b77e5e8c7ad4b176"> 218</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#aea9ca5556015a303b77e5e8c7ad4b176">Tesseract::RecogAllWordsPassN</a>(<span class="keywordtype">int</span> pass_n, <a class="code" href="a02786.html">ETEXT_DESC</a>* monitor,</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it,</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <a class="code" href="a02182.html">GenericVector<WordData></a>* words) {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="comment">// TODO(rays) Before this loop can be parallelized (it would yield a massive</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="comment">// speed-up) all remaining member globals need to be converted to local/heap</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="comment">// (eg set_pass1 and set_pass2) and an intermediate adaption pass needs to be</span></div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="comment">// added. The results will be significantly different with adaption on, and</span></div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="comment">// deterioration will need investigation.</span></div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  pr_it-><a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>();</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> w = 0; w < words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++w) {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <a class="code" href="a02354.html">WordData</a>* word = &(*words)[w];</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordflow">if</span> (w > 0) word-><a class="code" href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">prev_word</a> = &(*words)[w - 1];</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span> (monitor != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  monitor-><a class="code" href="a02786.html#a3b103545a36543dd4f16c496838d99eb">ocr_alive</a> = <a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>;</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> (pass_n == 1) {</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  monitor-><a class="code" href="a02786.html#a469c1ab091847e37969871bd89cf1005">progress</a> = 70 * w / words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>();</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (monitor-><a class="code" href="a02786.html#a51ef2705184520ed0b44e218aa2b1706">progress_callback2</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <a class="code" href="a02610.html">TBOX</a> box = pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><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="l00236"></a><span class="lineno"> 236</span>  (*monitor-><a class="code" href="a02786.html#a51ef2705184520ed0b44e218aa2b1706">progress_callback2</a>)(monitor, box.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>(),</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  box.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>(), box.<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>(), box.<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>());</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  }</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  monitor-><a class="code" href="a02786.html#a469c1ab091847e37969871bd89cf1005">progress</a> = 70 + 30 * w / words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>();</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keywordflow">if</span> (monitor-><a class="code" href="a02786.html#a51ef2705184520ed0b44e218aa2b1706">progress_callback2</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  (*monitor-><a class="code" href="a02786.html#a51ef2705184520ed0b44e218aa2b1706">progress_callback2</a>)(monitor, 0, 0, 0, 0);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  }</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  }</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">if</span> (monitor-><a class="code" href="a02786.html#a84e8d7c830a6b08ad1ebdbdf872c887a">deadline_exceeded</a>() ||</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  (monitor-><a class="code" href="a02786.html#afcea4319ceed9b37f3c43eec9ec5d55a">cancel</a> != <span class="keyword">nullptr</span> && (*monitor-><a class="code" href="a02786.html#afcea4319ceed9b37f3c43eec9ec5d55a">cancel</a>)(monitor-><a class="code" href="a02786.html#a4844a3e9868a0fde7ad2fcaa37f5c5f1">cancel_this</a>,</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>()))) {</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="comment">// Timeout. Fake out the rest of the words.</span></div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">for</span> (; w < words-><a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++w) {</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  (*words)[w].word->SetupFake(<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>);</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  }</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</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="l00255"></a><span class="lineno"> 255</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a>) {</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="keywordtype">int</span> s;</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">for</span> (s = 0; s < word-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() &&</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  word-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>[s]->tess_failed; ++s) {}</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="comment">// If all are failed, skip it. Image words are skipped by this test.</span></div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordflow">if</span> (s > word-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>()) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  }</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="comment">// Sync pr_it with the wth WordData.</span></div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">while</span> (pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span> && pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>)</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  pr_it-><a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordtype">bool</span> make_next_word_fuzzy = <span class="keyword">false</span>;</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#ae0b47fae13d07d3af456c0ec4f990d65">AnyLSTMLang</a>() &&</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <a class="code" href="a02358.html#aadf7ce5c811a4c404560aee6ed5c75e2">ReassignDiacritics</a>(pass_n, pr_it, &make_next_word_fuzzy)) {</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="comment">// Needs to be setup again to see the new outlines in the chopped_word.</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">SetupWordPassN</a>(pass_n, word);</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</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>  <a class="code" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">classify_word_and_language</a>(pass_n, pr_it, word);</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a85331ba1dacadbd9d9e6246b279f8f97">tessedit_dump_choices</a> || <a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Pass%d: %s [%s]\n"</span>, pass_n,</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><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="l00277"></a><span class="lineno"> 277</span>  word-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">debug_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  }</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  pr_it-><a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">if</span> (make_next_word_fuzzy && pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  pr_it-><a class="code" href="a02546.html#a1b3d11938500869049e926daa7948ad3">MakeCurrentWordFuzzy</a>();</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</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>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> }</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div><div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed"> 308</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#af9c097177e82c5f5495a7dc1506d66ed">Tesseract::recog_all_words</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res,</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <a class="code" href="a02786.html">ETEXT_DESC</a>* monitor,</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a>* target_word_box,</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* word_config,</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keywordtype">int</span> dopasses) {</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> </div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a6c90c990768b60d5c9fb3148edaf70e9">tessedit_minimal_rej_pass1</a>) {</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <a class="code" href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tessedit_test_adaption</a>.set_value (<a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>);</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <a class="code" href="a02358.html#a6e01f7c9333f2efa42498c99a0e5be53">tessedit_minimal_rejection</a>.set_value (<a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>);</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</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>  <span class="keywordflow">if</span> (dopasses==0 || dopasses==1) {</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  page_res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>();</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <span class="comment">// ****************** Pass 1 *******************</span></div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="comment">// If the adaptive classifier is full switch to one we prepared earlier,</span></div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="comment">// ie on the previous page. If the current adaptive classifier is non-empty,</span></div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="comment">// prepare a backup starting at this page, in case it fills up. Do all this</span></div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="comment">// independently for each language.</span></div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordflow">if</span> (<a class="code" href="a03998.html#ab51ed503c5a8490efaf909d7973880ed">AdaptiveClassifierIsFull</a>()) {</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <a class="code" href="a03998.html#aa08ead4bccd3a3c602f4c28b1c91bbe6">SwitchAdaptiveClassifier</a>();</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!<a class="code" href="a03998.html#a0a2c418c138725aa9fbd2bc9559d7c84">AdaptiveClassifierIsEmpty</a>()) {</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <a class="code" href="a03998.html#a3a1062b97626a08de9736ac3a6bc513a">StartBackupAdaptiveClassifier</a>();</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>  <span class="comment">// Now check the sub-langs as well.</span></div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < sub_langs_.size(); ++i) {</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keywordflow">if</span> (sub_langs_[i]-><a class="code" href="a03998.html#ab51ed503c5a8490efaf909d7973880ed">AdaptiveClassifierIsFull</a>()) {</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  sub_langs_[i]->SwitchAdaptiveClassifier();</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!sub_langs_[i]-><a class="code" href="a03998.html#a0a2c418c138725aa9fbd2bc9559d7c84">AdaptiveClassifierIsEmpty</a>()) {</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  sub_langs_[i]->StartBackupAdaptiveClassifier();</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  }</div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  }</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span> </div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span> <span class="preprocessor"> #endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> </div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="comment">// Set up all words ready for recognition, so that if parallelism is on</span></div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="comment">// all the input and output classes are ready to run the classifier.</span></div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <a class="code" href="a02182.html">GenericVector<WordData></a> words;</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <a class="code" href="a02358.html#a22b976f806f8e8882aed22a525729289">SetupAllWordsPassN</a>(1, target_word_box, word_config, page_res, &words);</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ac6f6a4356167ad8933a615eee41eca96">tessedit_parallelize</a>) {</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  <a class="code" href="a02358.html#aed023036d84d981089ea0a0828e0e595">PrerecAllWordsPar</a>(words);</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  }</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span> <span class="preprocessor"> #endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span> </div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  stats_.<a class="code" href="a02350.html#a607c354651f1d8eb319b0dab6199592e">word_count</a> = words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>();</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span> </div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  stats_.<a class="code" href="a02350.html#a2ffb76e8ef50a240ee744901405252bc">dict_words</a> = 0;</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  stats_.<a class="code" href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">doc_blob_quality</a> = 0;</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  stats_.<a class="code" href="a02350.html#a37743585e9509a4533ae54df8f575f27">doc_outline_errs</a> = 0;</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  stats_.<a class="code" href="a02350.html#a920c51d67fd617d9bf3684693723675c">doc_char_quality</a> = 0;</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  stats_.<a class="code" href="a02350.html#aed6547bcdccb51746fec879eb70010c1">good_char_count</a> = 0;</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  stats_.<a class="code" href="a02350.html#a78080370c4ae37371b06b410878b87fd">doc_good_char_quality</a> = 0;</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  most_recently_used_ = <span class="keyword">this</span>;</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="comment">// Run pass 1 word recognition.</span></div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#aea9ca5556015a303b77e5e8c7ad4b176">RecogAllWordsPassN</a>(1, monitor, &page_res_it, &words)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="comment">// Pass 1 post-processing.</span></div><div class="line"><a name="l00368"></a><span class="lineno"> 368</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="l00369"></a><span class="lineno"> 369</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="keywordflow">if</span> (page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <a class="code" href="a02358.html#a2583789c60aec43911ef1b2cf01b9d45">fix_rep_char</a>(&page_res_it);</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  }</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span> </div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="comment">// Count dict words.</span></div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordflow">if</span> (page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a7a606dd5236e78662fccade85d23edee">permuter</a>() == <a class="code" href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca5e293e54fa687876197992131e779d54">USER_DAWG_PERM</a>)</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  ++(stats_.<a class="code" href="a02350.html#a2ffb76e8ef50a240ee744901405252bc">dict_words</a>);</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span> </div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="comment">// Update misadaption log (we only need to do it on pass 1, since</span></div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="comment">// adaption only happens on this pass).</span></div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordflow">if</span> (page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a> != <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>-><a class="code" href="a02370.html#a78d90126d9698bc65c47a712c0aeafb1">misadaption_debug</a>().<a class="code" href="a02834.html#a7a1f2a841e8d01d5a8c05bc3ab8064eb">length</a>() > 0) {</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  page_res-><a class="code" href="a02530.html#af4e6350f65d0d939058071632dc56e94">misadaption_log</a>.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>-><a class="code" href="a02370.html#a78d90126d9698bc65c47a712c0aeafb1">misadaption_debug</a>());</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>  }</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  }</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span> </div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">if</span> (dopasses == 1) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span> </div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span> </div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="comment">// ****************** Pass 2 *******************</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0bf402e18a4253490a46b6a37bf3d67d">tessedit_tess_adaption_mode</a> != 0x0 && !<a class="code" href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tessedit_test_adaption</a> &&</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <a class="code" href="a02358.html#abe5cec86d3d10ccebd9adb222803e7a5">AnyTessLang</a>()) {</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  page_res_it.<a class="code" href="a02546.html#a15febd45d0904bb3c5f7d506368177f0">restart_page</a>();</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <a class="code" href="a02182.html">GenericVector<WordData></a> words;</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <a class="code" href="a02358.html#a22b976f806f8e8882aed22a525729289">SetupAllWordsPassN</a>(2, target_word_box, word_config, page_res, &words);</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ac6f6a4356167ad8933a615eee41eca96">tessedit_parallelize</a>) {</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="a02358.html#aed023036d84d981089ea0a0828e0e595">PrerecAllWordsPar</a>(words);</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  }</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  most_recently_used_ = <span class="keyword">this</span>;</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <span class="comment">// Run pass 2 word recognition.</span></div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#aea9ca5556015a303b77e5e8c7ad4b176">RecogAllWordsPassN</a>(2, monitor, &page_res_it, &words)) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  }</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span> </div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="comment">// The next passes are only required for Tess-only.</span></div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abe5cec86d3d10ccebd9adb222803e7a5">AnyTessLang</a>() && !<a class="code" href="a02358.html#ae0b47fae13d07d3af456c0ec4f990d65">AnyLSTMLang</a>()) {</div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="comment">// ****************** Pass 3 *******************</span></div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="comment">// Fix fuzzy spaces.</span></div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <a class="code" href="a00503.html#ae281080023125653d85cd946e95f626c">set_global_loc_code</a>(<a class="code" href="a00503.html#a8f145da3d27aa025f220becb27879db7">LOC_FUZZY_SPACE</a>);</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span> </div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tessedit_test_adaption</a> && <a class="code" href="a02358.html#a06f65b0780b3a888457de0752113cfd5">tessedit_fix_fuzzy_spaces</a></div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  && !<a class="code" href="a02358.html#a69b602d95b2c2e94dae12140162b8848">tessedit_word_for_word</a> && !<a class="code" href="a02358.html#ae4177172ea8b2b5f0f4282927f0073e4">right_to_left</a>())</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <a class="code" href="a02358.html#ae08214652c8e5a05331ae2a095a57849">fix_fuzzy_spaces</a>(monitor, stats_.<a class="code" href="a02350.html#a607c354651f1d8eb319b0dab6199592e">word_count</a>, page_res);</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span> </div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="comment">// ****************** Pass 4 *******************</span></div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a2d143387187922d0ea471164dbf1f228">tessedit_enable_dict_correction</a>) <a class="code" href="a02358.html#a8eaae506cccb353fadda129e070853fe">dictionary_correction_pass</a>(page_res);</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a41e9f6171e3dddf77b16fecab0016375">tessedit_enable_bigram_correction</a>) <a class="code" href="a02358.html#a1638a97da03d2372190d29ae9b286f0d">bigram_correction_pass</a>(page_res);</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span> </div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <span class="comment">// ****************** Pass 5,6 *******************</span></div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <a class="code" href="a02358.html#a383d244125cd6c1523777278d0ed1d50">rejection_passes</a>(page_res, monitor, target_word_box, word_config);</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span> </div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="comment">// ****************** Pass 8 *******************</span></div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  <a class="code" href="a02358.html#aaccda3caf003809de9f40743d9205169">font_recognition_pass</a>(page_res);</div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span> </div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <span class="comment">// ****************** Pass 9 *******************</span></div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="comment">// Check the correctness of the final results.</span></div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <a class="code" href="a02358.html#af4932764d7877f68efcf04570a2e4123">blamer_pass</a>(page_res);</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <a class="code" href="a02358.html#ae6ced41202a774688e1c29e27fda712c">script_pos_pass</a>(page_res);</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</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> </div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="comment">// Write results pass.</span></div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <a class="code" href="a00503.html#ae281080023125653d85cd946e95f626c">set_global_loc_code</a>(<a class="code" href="a00503.html#aab54db69aaf3fd317086ea2ee52ffa5d">LOC_WRITE_RESULTS</a>);</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  <span class="comment">// This is now redundant, but retained commented so show how to obtain</span></div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <span class="comment">// bounding boxes and style information.</span></div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span> </div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="comment">// changed by jetsoft</span></div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="comment">// needed for dll to output memory structure</span></div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="keywordflow">if</span> ((dopasses == 0 || dopasses == 2) && (monitor || <a class="code" href="a02358.html#a86c6f34b0388d11a0c63cd468947a4ad">tessedit_write_unlv</a>))</div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <a class="code" href="a02358.html#a5f959a7836868be2a58cce02195b7878">output_pass</a>(page_res_it, target_word_box);</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  <span class="comment">// end jetsoft</span></div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span> <span class="preprocessor"> #endif //ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span> </div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="keyword">const</span> <a class="code" href="a01629.html#a338d4c8b5d497b5ec3e6e4269d8ac66a">PageSegMode</a> pageseg_mode = <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="l00449"></a><span class="lineno"> 449</span>  <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a02358.html#a053d30f2b3df317e0d12e4a64f10d831">tessedit_pageseg_mode</a>));</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  textord_.<a class="code" href="a04674.html#a8ad2a2ff59d9dcbd82217076d4466344">CleanupSingleRowResult</a>(pageseg_mode, page_res);</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span> </div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <span class="comment">// Remove empty words, as these mess up the result iterators.</span></div><div class="line"><a name="l00453"></a><span class="lineno"> 453</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="l00454"></a><span class="lineno"> 454</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="keyword">const</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="l00456"></a><span class="lineno"> 456</span>  <span class="keyword">const</span> <a class="code" href="a02582.html">POLY_BLOCK</a>* pb = page_res_it.<a class="code" href="a02546.html#a997c382ddd2cf2f539532a1d91780963">block</a>()-><a class="code" href="a02534.html#ae7c240d4878247ebdfe78433446751bf">block</a> != <span class="keyword">nullptr</span></div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  ? page_res_it.<a class="code" href="a02546.html#a997c382ddd2cf2f539532a1d91780963">block</a>()-><a class="code" href="a02534.html#ae7c240d4878247ebdfe78433446751bf">block</a>-><a class="code" href="a02514.html#a9e4346e037f2cc01c3c51d888531da74">pdblk</a>.<a class="code" href="a02558.html#a87856f8400f0629dc761fec0f7a17b57">poly_block</a>()</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a> == <span class="keyword">nullptr</span> || word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>() == 0 ||</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  (word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a572009e61b85e6001bb1ed1494733c22">IsAllSpaces</a>() && (pb == <span class="keyword">nullptr</span> || pb-><a class="code" href="a02582.html#a4eb55be5fc2ed33312e4410f5ee2cf88">IsText</a>()))) {</div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  page_res_it.<a class="code" href="a02546.html#afb987bf467ef552c49b962bf6872ad34">DeleteCurrentWord</a>();</div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  }</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  }</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>  <span class="keywordflow">if</span> (monitor != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  monitor-><a class="code" href="a02786.html#a469c1ab091847e37969871bd89cf1005">progress</a> = 100;</div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  }</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span> }</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span> </div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span> </div><div class="line"><a name="l00473"></a><span class="lineno"><a class="line" href="a02358.html#a1638a97da03d2372190d29ae9b286f0d"> 473</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a1638a97da03d2372190d29ae9b286f0d">Tesseract::bigram_correction_pass</a>(<a class="code" href="a02530.html">PAGE_RES</a> *page_res) {</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> word_it(page_res);</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span> </div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  <a class="code" href="a02542.html">WERD_RES</a> *w_prev = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  <a class="code" href="a02542.html">WERD_RES</a> *w = word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span>  w_prev = w;</div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <span class="keywordflow">while</span> (word_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>() != <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span>  (!word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() || word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#a4ffd6b844b62d19df43effdc3faec8e3">part_of_combo</a>)) {</div><div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  <span class="comment">// advance word_it, skipping over parts of combos</span></div><div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  }</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  <span class="keywordflow">if</span> (!word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  w = word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  <span class="keywordflow">if</span> (!w || !w_prev || w-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a> != w_prev-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>) {</div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  }</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  <span class="keywordflow">if</span> (w_prev-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>) || w-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a>) {</div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Skipping because one of the words is W_REP_CHAR\n"</span>);</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  }</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  <span class="keywordflow">continue</span>;</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="comment">// Two words sharing the same language model, excellent!</span></div><div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  <a class="code" href="a02182.html">GenericVector<WERD_CHOICE *></a> overrides_word1;</div><div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  <a class="code" href="a02182.html">GenericVector<WERD_CHOICE *></a> overrides_word2;</div><div class="line"><a name="l00498"></a><span class="lineno"> 498</span> </div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> orig_w1_str = w_prev-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>();</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> orig_w2_str = w-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>();</div><div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> prev_best(w-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>);</div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  {</div><div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  <span class="keywordtype">int</span> w1start, w1end;</div><div class="line"><a name="l00504"></a><span class="lineno"> 504</span>  w_prev-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#aea0fc2f641f1332d4079bb57bc1f14ab">GetNonSuperscriptSpan</a>(&w1start, &w1end);</div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  prev_best = w_prev-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a0e746a8089d60f66d712573b441e961b">shallow_copy</a>(w1start, w1end);</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  }</div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> this_best(w-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>);</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>  <span class="keywordtype">int</span> w2start, w2end;</div><div class="line"><a name="l00510"></a><span class="lineno"> 510</span>  w-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#aea0fc2f641f1332d4079bb57bc1f14ab">GetNonSuperscriptSpan</a>(&w2start, &w2end);</div><div class="line"><a name="l00511"></a><span class="lineno"> 511</span>  this_best = w-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a0e746a8089d60f66d712573b441e961b">shallow_copy</a>(w2start, w2end);</div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  }</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span> </div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  <span class="keywordflow">if</span> (w-><a class="code" href="a02542.html#a2e616f878c75833272f3f800827c2db6">tesseract</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a6b589339233b375b190427055e4ecf6c">valid_bigram</a>(prev_best, this_best)) {</div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a>) {</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Top choice \"%s %s\" verified by bigram model.\n"</span>,</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span>  orig_w1_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), orig_w2_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span>  }</div><div class="line"><a name="l00519"></a><span class="lineno"> 519</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  }</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a> > 2) {</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Examining alt choices for \"%s %s\".\n"</span>,</div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  orig_w1_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), orig_w2_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l00524"></a><span class="lineno"> 524</span>  }</div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a> > 1) {</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  <span class="keywordflow">if</span> (!w_prev-><a class="code" href="a02542.html#a23445f9e8dce6db8902504c0fe1d2e37">best_choices</a>.singleton()) {</div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  w_prev-><a class="code" href="a02542.html#a5d887fd12d885c0575559a66f292d128">PrintBestChoices</a>();</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  }</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  <span class="keywordflow">if</span> (!w-><a class="code" href="a02542.html#a23445f9e8dce6db8902504c0fe1d2e37">best_choices</a>.singleton()) {</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  w-><a class="code" href="a02542.html#a5d887fd12d885c0575559a66f292d128">PrintBestChoices</a>();</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  }</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  }</div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  <span class="keywordtype">float</span> best_rating = 0.0;</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  <span class="keywordtype">int</span> best_idx = 0;</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  WERD_CHOICE_IT prev_it(&w_prev-><a class="code" href="a02542.html#a23445f9e8dce6db8902504c0fe1d2e37">best_choices</a>);</div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  <span class="keywordflow">for</span> (prev_it.mark_cycle_pt(); !prev_it.cycled_list(); prev_it.forward()) {</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> *p1 = prev_it.data();</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> strip1(w-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>);</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  {</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  <span class="keywordtype">int</span> p1start, p1end;</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  p1-><a class="code" href="a02606.html#aea0fc2f641f1332d4079bb57bc1f14ab">GetNonSuperscriptSpan</a>(&p1start, &p1end);</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  strip1 = p1-><a class="code" href="a02606.html#a0e746a8089d60f66d712573b441e961b">shallow_copy</a>(p1start, p1end);</div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  }</div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span>  WERD_CHOICE_IT w_it(&w-><a class="code" href="a02542.html#a23445f9e8dce6db8902504c0fe1d2e37">best_choices</a>);</div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>  <span class="keywordflow">for</span> (w_it.mark_cycle_pt(); !w_it.cycled_list(); w_it.forward()) {</div><div class="line"><a name="l00546"></a><span class="lineno"> 546</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> *p2 = w_it.data();</div><div class="line"><a name="l00547"></a><span class="lineno"> 547</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> strip2(w-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>);</div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span>  {</div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span>  <span class="keywordtype">int</span> p2start, p2end;</div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  p2-><a class="code" href="a02606.html#aea0fc2f641f1332d4079bb57bc1f14ab">GetNonSuperscriptSpan</a>(&p2start, &p2end);</div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  strip2 = p2-><a class="code" href="a02606.html#a0e746a8089d60f66d712573b441e961b">shallow_copy</a>(p2start, p2end);</div><div class="line"><a name="l00552"></a><span class="lineno"> 552</span>  }</div><div class="line"><a name="l00553"></a><span class="lineno"> 553</span>  <span class="keywordflow">if</span> (w-><a class="code" href="a02542.html#a2e616f878c75833272f3f800827c2db6">tesseract</a>-><a class="code" href="a02358.html#a67d107ceaab00c9e98d6473d4024d409">getDict</a>().<a class="code" href="a04290.html#a6b589339233b375b190427055e4ecf6c">valid_bigram</a>(strip1, strip2)) {</div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  overrides_word1.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(p1);</div><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  overrides_word2.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(p2);</div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  <span class="keywordflow">if</span> (overrides_word1.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() == 1 ||</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  p1-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>() + p2-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>() < best_rating) {</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  best_rating = p1-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>() + p2-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>();</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  best_idx = overrides_word1.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() - 1;</div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  }</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  }</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</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="keywordflow">if</span> (!overrides_word1.<a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>()) {</div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span>  <span class="comment">// Excellent, we have some bigram matches.</span></div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  <span class="keywordflow">if</span> (<a class="code" href="a00398.html#a98992670ff5a4da6695f318643d48ca4">EqualIgnoringCaseAndTerminalPunct</a>(*w_prev-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>,</div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span>  *overrides_word1[best_idx]) &&</div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  <a class="code" href="a00398.html#a98992670ff5a4da6695f318643d48ca4">EqualIgnoringCaseAndTerminalPunct</a>(*w-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>,</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  *overrides_word2[best_idx])) {</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a> > 1) {</div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Top choice \"%s %s\" verified (sans case) by bigram "</span></div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>  <span class="stringliteral">"model.\n"</span>, orig_w1_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), orig_w2_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</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="keywordflow">continue</span>;</div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  }</div><div class="line"><a name="l00576"></a><span class="lineno"> 576</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> new_w1_str = overrides_word1[best_idx]->unichar_string();</div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span>  <span class="keyword">const</span> <a class="code" href="a02834.html">STRING</a> new_w2_str = overrides_word2[best_idx]->unichar_string();</div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  <span class="keywordflow">if</span> (new_w1_str != orig_w1_str) {</div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span>  w_prev-><a class="code" href="a02542.html#a423e27ea457c33aed9178dd064b38b6c">ReplaceBestChoice</a>(overrides_word1[best_idx]);</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  }</div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span>  <span class="keywordflow">if</span> (new_w2_str != orig_w2_str) {</div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>  w-><a class="code" href="a02542.html#a423e27ea457c33aed9178dd064b38b6c">ReplaceBestChoice</a>(overrides_word2[best_idx]);</div><div class="line"><a name="l00583"></a><span class="lineno"> 583</span>  }</div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a> > 0) {</div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span>  <a class="code" href="a02834.html">STRING</a> choices_description;</div><div class="line"><a name="l00586"></a><span class="lineno"> 586</span>  <span class="keywordtype">int</span> num_bigram_choices</div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span>  = overrides_word1.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() * overrides_word2.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>();</div><div class="line"><a name="l00588"></a><span class="lineno"> 588</span>  <span class="keywordflow">if</span> (num_bigram_choices == 1) {</div><div class="line"><a name="l00589"></a><span class="lineno"> 589</span>  choices_description = <span class="stringliteral">"This was the unique bigram choice."</span>;</div><div class="line"><a name="l00590"></a><span class="lineno"> 590</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00591"></a><span class="lineno"> 591</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a> > 1) {</div><div class="line"><a name="l00592"></a><span class="lineno"> 592</span>  <a class="code" href="a02834.html">STRING</a> bigrams_list;</div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> kMaxChoicesToPrint = 20;</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < overrides_word1.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() &&</div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>  i < kMaxChoicesToPrint; i++) {</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>  <span class="keywordflow">if</span> (i > 0) { bigrams_list += <span class="stringliteral">", "</span>; }</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> *p1 = overrides_word1[i];</div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span>  <a class="code" href="a02606.html">WERD_CHOICE</a> *p2 = overrides_word2[i];</div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  bigrams_list += p1-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>() + <span class="stringliteral">" "</span> + p2-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>();</div><div class="line"><a name="l00600"></a><span class="lineno"> 600</span>  }</div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  choices_description = <span class="stringliteral">"There were many choices: {"</span>;</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span>  choices_description += bigrams_list;</div><div class="line"><a name="l00603"></a><span class="lineno"> 603</span>  choices_description += <span class="stringliteral">"}"</span>;</div><div class="line"><a name="l00604"></a><span class="lineno"> 604</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00605"></a><span class="lineno"> 605</span>  choices_description.<a class="code" href="a02834.html#a779cd637dd42d58d5500a3a657077e84">add_str_int</a>(<span class="stringliteral">"There were "</span>, num_bigram_choices);</div><div class="line"><a name="l00606"></a><span class="lineno"> 606</span>  choices_description += <span class="stringliteral">" compatible bigrams."</span>;</div><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  }</div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  }</div><div class="line"><a name="l00609"></a><span class="lineno"> 609</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Replaced \"%s %s\" with \"%s %s\" with bigram model. %s\n"</span>,</div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span>  orig_w1_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), orig_w2_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l00611"></a><span class="lineno"> 611</span>  new_w1_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), new_w2_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l00612"></a><span class="lineno"> 612</span>  choices_description.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l00613"></a><span class="lineno"> 613</span>  }</div><div class="line"><a name="l00614"></a><span class="lineno"> 614</span>  }</div><div class="line"><a name="l00615"></a><span class="lineno"> 615</span>  }</div><div class="line"><a name="l00616"></a><span class="lineno"> 616</span> }</div><div class="line"><a name="l00617"></a><span class="lineno"> 617</span> </div><div class="line"><a name="l00618"></a><span class="lineno"><a class="line" href="a02358.html#a383d244125cd6c1523777278d0ed1d50"> 618</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a383d244125cd6c1523777278d0ed1d50">Tesseract::rejection_passes</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res,</div><div class="line"><a name="l00619"></a><span class="lineno"> 619</span>  <a class="code" href="a02786.html">ETEXT_DESC</a>* monitor,</div><div class="line"><a name="l00620"></a><span class="lineno"> 620</span>  <span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a>* target_word_box,</div><div class="line"><a name="l00621"></a><span class="lineno"> 621</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* word_config) {</div><div class="line"><a name="l00622"></a><span class="lineno"> 622</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l00623"></a><span class="lineno"> 623</span>  <span class="comment">// ****************** Pass 5 *******************</span></div><div class="line"><a name="l00624"></a><span class="lineno"> 624</span>  <span class="comment">// Gather statistics on rejects.</span></div><div class="line"><a name="l00625"></a><span class="lineno"> 625</span>  <span class="keywordtype">int</span> word_index = 0;</div><div class="line"><a name="l00626"></a><span class="lineno"> 626</span>  <span class="keywordflow">while</span> (!<a class="code" href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tessedit_test_adaption</a> && page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00627"></a><span class="lineno"> 627</span>  <a class="code" href="a00503.html#ae281080023125653d85cd946e95f626c">set_global_loc_code</a>(<a class="code" href="a00503.html#a6b2566a0d57e097555b339d08379ac0d">LOC_MM_ADAPT</a>);</div><div class="line"><a name="l00628"></a><span class="lineno"> 628</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="l00629"></a><span class="lineno"> 629</span>  word_index++;</div><div class="line"><a name="l00630"></a><span class="lineno"> 630</span>  <span class="keywordflow">if</span> (monitor != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00631"></a><span class="lineno"> 631</span>  monitor-><a class="code" href="a02786.html#a3b103545a36543dd4f16c496838d99eb">ocr_alive</a> = <a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>;</div><div class="line"><a name="l00632"></a><span class="lineno"> 632</span>  monitor-><a class="code" href="a02786.html#a469c1ab091847e37969871bd89cf1005">progress</a> = 95 + 5 * word_index / stats_.<a class="code" href="a02350.html#a607c354651f1d8eb319b0dab6199592e">word_count</a>;</div><div class="line"><a name="l00633"></a><span class="lineno"> 633</span>  }</div><div class="line"><a name="l00634"></a><span class="lineno"> 634</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a> == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00635"></a><span class="lineno"> 635</span>  <span class="comment">// Word was not processed by tesseract.</span></div><div class="line"><a name="l00636"></a><span class="lineno"> 636</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00637"></a><span class="lineno"> 637</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00638"></a><span class="lineno"> 638</span>  }</div><div class="line"><a name="l00639"></a><span class="lineno"> 639</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 70);</div><div class="line"><a name="l00640"></a><span class="lineno"> 640</span> </div><div class="line"><a name="l00641"></a><span class="lineno"> 641</span>  <span class="comment">// changed by jetsoft</span></div><div class="line"><a name="l00642"></a><span class="lineno"> 642</span>  <span class="comment">// specific to its needs to extract one word when need</span></div><div class="line"><a name="l00643"></a><span class="lineno"> 643</span>  <span class="keywordflow">if</span> (target_word_box &&</div><div class="line"><a name="l00644"></a><span class="lineno"> 644</span>  !<a class="code" href="a02358.html#ac5790042616434be2d95f33dc62f9c04">ProcessTargetWord</a>(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="l00645"></a><span class="lineno"> 645</span>  *target_word_box, word_config, 4)) {</div><div class="line"><a name="l00646"></a><span class="lineno"> 646</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00647"></a><span class="lineno"> 647</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00648"></a><span class="lineno"> 648</span>  }</div><div class="line"><a name="l00649"></a><span class="lineno"> 649</span>  <span class="comment">// end jetsoft</span></div><div class="line"><a name="l00650"></a><span class="lineno"> 650</span> </div><div class="line"><a name="l00651"></a><span class="lineno"> 651</span>  page_res_it.<a class="code" href="a02546.html#a1d1af03a63da4b7f551770e07ca86414">rej_stat_word</a>();</div><div class="line"><a name="l00652"></a><span class="lineno"> 652</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> chars_in_word = word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#adb462d55dc4b682e0a77090185a58011">length</a>();</div><div class="line"><a name="l00653"></a><span class="lineno"> 653</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> rejects_in_word = word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#a2ddec73fd1a7288568496353d75a00e8">reject_count</a>();</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="keyword">const</span> <span class="keywordtype">int</span> blob_quality = <a class="code" href="a02358.html#ad0d6e09c6386cb0d6d1bc4a34beb23fa">word_blob_quality</a>(word, page_res_it.<a class="code" href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">row</a>()-><a class="code" href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">row</a>);</div><div class="line"><a name="l00656"></a><span class="lineno"> 656</span>  stats_.<a class="code" href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">doc_blob_quality</a> += blob_quality;</div><div class="line"><a name="l00657"></a><span class="lineno"> 657</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> outline_errs = <a class="code" href="a02358.html#a37bfb6999dc3b5d05d4eeafa38571d9f">word_outline_errs</a>(word);</div><div class="line"><a name="l00658"></a><span class="lineno"> 658</span>  stats_.<a class="code" href="a02350.html#a37743585e9509a4533ae54df8f575f27">doc_outline_errs</a> += outline_errs;</div><div class="line"><a name="l00659"></a><span class="lineno"> 659</span>  int16_t all_char_quality;</div><div class="line"><a name="l00660"></a><span class="lineno"> 660</span>  int16_t accepted_all_char_quality;</div><div class="line"><a name="l00661"></a><span class="lineno"> 661</span>  <a class="code" href="a02358.html#a99a1e1a4cd1134ecab8028de820ae57a">word_char_quality</a>(word, page_res_it.<a class="code" href="a02546.html#a2038f4bd5c4c0eac4dba7f1d6bcdb5bf">row</a>()-><a class="code" href="a02538.html#ad3a856f3e9217c47b8f2f54cd3908721">row</a>,</div><div class="line"><a name="l00662"></a><span class="lineno"> 662</span>  &all_char_quality, &accepted_all_char_quality);</div><div class="line"><a name="l00663"></a><span class="lineno"> 663</span>  stats_.<a class="code" href="a02350.html#a920c51d67fd617d9bf3684693723675c">doc_char_quality</a> += all_char_quality;</div><div class="line"><a name="l00664"></a><span class="lineno"> 664</span>  <span class="keyword">const</span> uint8_t permuter_type = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a7a606dd5236e78662fccade85d23edee">permuter</a>();</div><div class="line"><a name="l00665"></a><span class="lineno"> 665</span>  <span class="keywordflow">if</span> ((permuter_type == <a class="code" href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca616bdbcaed7dd414823b303af5c8b1f1">SYSTEM_DAWG_PERM</a>) ||</div><div class="line"><a name="l00666"></a><span class="lineno"> 666</span>  (permuter_type == <a class="code" href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca4fd9d3b025ecc5ea8f2248fea29543e4">FREQ_DAWG_PERM</a>) ||</div><div class="line"><a name="l00667"></a><span class="lineno"> 667</span>  (permuter_type == <a class="code" href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca5e293e54fa687876197992131e779d54">USER_DAWG_PERM</a>)) {</div><div class="line"><a name="l00668"></a><span class="lineno"> 668</span>  stats_.<a class="code" href="a02350.html#aed6547bcdccb51746fec879eb70010c1">good_char_count</a> += chars_in_word - rejects_in_word;</div><div class="line"><a name="l00669"></a><span class="lineno"> 669</span>  stats_.<a class="code" href="a02350.html#a78080370c4ae37371b06b410878b87fd">doc_good_char_quality</a> += accepted_all_char_quality;</div><div class="line"><a name="l00670"></a><span class="lineno"> 670</span>  }</div><div class="line"><a name="l00671"></a><span class="lineno"> 671</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 80);</div><div class="line"><a name="l00672"></a><span class="lineno"> 672</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a4a426a366547fd63b58db52447f9840a">tessedit_reject_bad_qual_wds</a> &&</div><div class="line"><a name="l00673"></a><span class="lineno"> 673</span>  (blob_quality == 0) && (outline_errs >= chars_in_word))</div><div class="line"><a name="l00674"></a><span class="lineno"> 674</span>  word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#aa0e131c139fe56b044b20cc8fd2a645c">rej_word_bad_quality</a>();</div><div class="line"><a name="l00675"></a><span class="lineno"> 675</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 90);</div><div class="line"><a name="l00676"></a><span class="lineno"> 676</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00677"></a><span class="lineno"> 677</span>  }</div><div class="line"><a name="l00678"></a><span class="lineno"> 678</span> </div><div class="line"><a name="l00679"></a><span class="lineno"> 679</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a68f5ca69771b04373ed13ee1b3d8f18b">tessedit_debug_quality_metrics</a>) {</div><div class="line"><a name="l00680"></a><span class="lineno"> 680</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a></div><div class="line"><a name="l00681"></a><span class="lineno"> 681</span>  (<span class="stringliteral">"QUALITY: num_chs= %d num_rejs= %d %5.3f blob_qual= %d %5.3f"</span></div><div class="line"><a name="l00682"></a><span class="lineno"> 682</span>  <span class="stringliteral">" outline_errs= %d %5.3f char_qual= %d %5.3f good_ch_qual= %d %5.3f\n"</span>,</div><div class="line"><a name="l00683"></a><span class="lineno"> 683</span>  page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>, page_res-><a class="code" href="a02530.html#a6341c86ed5c02252716d5d902fc42862">rej_count</a>,</div><div class="line"><a name="l00684"></a><span class="lineno"> 684</span>  page_res-><a class="code" href="a02530.html#a6341c86ed5c02252716d5d902fc42862">rej_count</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>),</div><div class="line"><a name="l00685"></a><span class="lineno"> 685</span>  stats_.<a class="code" href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">doc_blob_quality</a>,</div><div class="line"><a name="l00686"></a><span class="lineno"> 686</span>  stats_.<a class="code" href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">doc_blob_quality</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>),</div><div class="line"><a name="l00687"></a><span class="lineno"> 687</span>  stats_.<a class="code" href="a02350.html#a37743585e9509a4533ae54df8f575f27">doc_outline_errs</a>,</div><div class="line"><a name="l00688"></a><span class="lineno"> 688</span>  stats_.<a class="code" href="a02350.html#a37743585e9509a4533ae54df8f575f27">doc_outline_errs</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>),</div><div class="line"><a name="l00689"></a><span class="lineno"> 689</span>  stats_.<a class="code" href="a02350.html#a920c51d67fd617d9bf3684693723675c">doc_char_quality</a>,</div><div class="line"><a name="l00690"></a><span class="lineno"> 690</span>  stats_.<a class="code" href="a02350.html#a920c51d67fd617d9bf3684693723675c">doc_char_quality</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>),</div><div class="line"><a name="l00691"></a><span class="lineno"> 691</span>  stats_.<a class="code" href="a02350.html#a78080370c4ae37371b06b410878b87fd">doc_good_char_quality</a>,</div><div class="line"><a name="l00692"></a><span class="lineno"> 692</span>  (stats_.<a class="code" href="a02350.html#aed6547bcdccb51746fec879eb70010c1">good_char_count</a> > 0) ?</div><div class="line"><a name="l00693"></a><span class="lineno"> 693</span>  (stats_.<a class="code" href="a02350.html#a78080370c4ae37371b06b410878b87fd">doc_good_char_quality</a> /</div><div class="line"><a name="l00694"></a><span class="lineno"> 694</span>  static_cast<float>(stats_.<a class="code" href="a02350.html#aed6547bcdccb51746fec879eb70010c1">good_char_count</a>)) : 0.0);</div><div class="line"><a name="l00695"></a><span class="lineno"> 695</span>  }</div><div class="line"><a name="l00696"></a><span class="lineno"> 696</span>  <span class="keywordtype">bool</span> good_quality_doc =</div><div class="line"><a name="l00697"></a><span class="lineno"> 697</span>  ((page_res-><a class="code" href="a02530.html#a6341c86ed5c02252716d5d902fc42862">rej_count</a> / <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>)) <=</div><div class="line"><a name="l00698"></a><span class="lineno"> 698</span>  <a class="code" href="a02358.html#a886bd9a9910c385d5c1a38a7c340d2b2">quality_rej_pc</a>) &&</div><div class="line"><a name="l00699"></a><span class="lineno"> 699</span>  (stats_.<a class="code" href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">doc_blob_quality</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>) >=</div><div class="line"><a name="l00700"></a><span class="lineno"> 700</span>  <a class="code" href="a02358.html#a8feb6e6d0d216514b3fa83ca2f4078e5">quality_blob_pc</a>) &&</div><div class="line"><a name="l00701"></a><span class="lineno"> 701</span>  (stats_.<a class="code" href="a02350.html#a37743585e9509a4533ae54df8f575f27">doc_outline_errs</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>) <=</div><div class="line"><a name="l00702"></a><span class="lineno"> 702</span>  <a class="code" href="a02358.html#aa8f33558afec91ea781fc11368ce209b">quality_outline_pc</a>) &&</div><div class="line"><a name="l00703"></a><span class="lineno"> 703</span>  (stats_.<a class="code" href="a02350.html#a920c51d67fd617d9bf3684693723675c">doc_char_quality</a> / static_cast<float>(page_res-><a class="code" href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">char_count</a>) >=</div><div class="line"><a name="l00704"></a><span class="lineno"> 704</span>  <a class="code" href="a02358.html#a90fbdb46a983a7da9a3625a8e5a5fe5a">quality_char_pc</a>);</div><div class="line"><a name="l00705"></a><span class="lineno"> 705</span> </div><div class="line"><a name="l00706"></a><span class="lineno"> 706</span>  <span class="comment">// ****************** Pass 6 *******************</span></div><div class="line"><a name="l00707"></a><span class="lineno"> 707</span>  <span class="comment">// Do whole document or whole block rejection pass</span></div><div class="line"><a name="l00708"></a><span class="lineno"> 708</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tessedit_test_adaption</a>) {</div><div class="line"><a name="l00709"></a><span class="lineno"> 709</span>  <a class="code" href="a00503.html#ae281080023125653d85cd946e95f626c">set_global_loc_code</a>(<a class="code" href="a00503.html#a035b82243d07c39f12fcd8bf45a47493">LOC_DOC_BLK_REJ</a>);</div><div class="line"><a name="l00710"></a><span class="lineno"> 710</span>  <a class="code" href="a02358.html#a6c2fe027fce0afe0a8b4b4e3f10266a4">quality_based_rejection</a>(page_res_it, good_quality_doc);</div><div class="line"><a name="l00711"></a><span class="lineno"> 711</span>  }</div><div class="line"><a name="l00712"></a><span class="lineno"> 712</span> }</div><div class="line"><a name="l00713"></a><span class="lineno"> 713</span> </div><div class="line"><a name="l00714"></a><span class="lineno"> 714</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00715"></a><span class="lineno"> 715</span> </div><div class="line"><a name="l00716"></a><span class="lineno"><a class="line" href="a02358.html#af4932764d7877f68efcf04570a2e4123"> 716</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#af4932764d7877f68efcf04570a2e4123">Tesseract::blamer_pass</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res) {</div><div class="line"><a name="l00717"></a><span class="lineno"> 717</span>  <span class="keywordflow">if</span> (!<a class="code" href="a04866.html#a5f360cd76704a08b03a4738a97e8457b">wordrec_run_blamer</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00718"></a><span class="lineno"> 718</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l00719"></a><span class="lineno"> 719</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="l00720"></a><span class="lineno"> 720</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l00721"></a><span class="lineno"> 721</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="l00722"></a><span class="lineno"> 722</span>  <a class="code" href="a02370.html#a58f3814814a816e89faf1444b90c36e1">BlamerBundle::LastChanceBlame</a>(<a class="code" href="a04866.html#a76e95cb7cbfe636ab00ec46150b5524d">wordrec_debug_blamer</a>, word);</div><div class="line"><a name="l00723"></a><span class="lineno"> 723</span>  page_res-><a class="code" href="a02530.html#a5aa8ac782c653b77b29590d72ba3d33a">blame_reasons</a>[word-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>-><a class="code" href="a02370.html#abc20fe96d8a4c62d877d87a3682658d6">incorrect_result_reason</a>()]++;</div><div class="line"><a name="l00724"></a><span class="lineno"> 724</span>  }</div><div class="line"><a name="l00725"></a><span class="lineno"> 725</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Blame reasons:\n"</span>);</div><div class="line"><a name="l00726"></a><span class="lineno"> 726</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> bl = 0; bl < <a class="code" href="a00218.html#a8faf52e106c04bfdc9898ffa90b821e1a5b7e21438ec02ceeba07bf96049d84d5">IRR_NUM_REASONS</a>; ++bl) {</div><div class="line"><a name="l00727"></a><span class="lineno"> 727</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%s %d\n"</span>, <a class="code" href="a02370.html#ab8943bffa947612e66873bc8b7b94b27">BlamerBundle::IncorrectReasonName</a>(</div><div class="line"><a name="l00728"></a><span class="lineno"> 728</span>  static_cast<IncorrectResultReason>(bl)),</div><div class="line"><a name="l00729"></a><span class="lineno"> 729</span>  page_res-><a class="code" href="a02530.html#a5aa8ac782c653b77b29590d72ba3d33a">blame_reasons</a>[bl]);</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="keywordflow">if</span> (page_res-><a class="code" href="a02530.html#af4e6350f65d0d939058071632dc56e94">misadaption_log</a>.<a class="code" href="a02182.html#a6af4e0a2a30dda267d19bf783ae22eb7">length</a>() > 0) {</div><div class="line"><a name="l00732"></a><span class="lineno"> 732</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Misadaption log:\n"</span>);</div><div class="line"><a name="l00733"></a><span class="lineno"> 733</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < page_res-><a class="code" href="a02530.html#af4e6350f65d0d939058071632dc56e94">misadaption_log</a>.<a class="code" href="a02182.html#a6af4e0a2a30dda267d19bf783ae22eb7">length</a>(); ++i) {</div><div class="line"><a name="l00734"></a><span class="lineno"> 734</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%s\n"</span>, page_res-><a class="code" href="a02530.html#af4e6350f65d0d939058071632dc56e94">misadaption_log</a>[i].string());</div><div class="line"><a name="l00735"></a><span class="lineno"> 735</span>  }</div><div class="line"><a name="l00736"></a><span class="lineno"> 736</span>  }</div><div class="line"><a name="l00737"></a><span class="lineno"> 737</span> }</div><div class="line"><a name="l00738"></a><span class="lineno"> 738</span> </div><div class="line"><a name="l00739"></a><span class="lineno"> 739</span> <span class="comment">// Sets script positions and detects smallcaps on all output words.</span></div><div class="line"><a name="l00740"></a><span class="lineno"><a class="line" href="a02358.html#ae6ced41202a774688e1c29e27fda712c"> 740</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#ae6ced41202a774688e1c29e27fda712c">Tesseract::script_pos_pass</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res) {</div><div class="line"><a name="l00741"></a><span class="lineno"> 741</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l00742"></a><span class="lineno"> 742</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="l00743"></a><span class="lineno"> 743</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l00744"></a><span class="lineno"> 744</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="l00745"></a><span class="lineno"> 745</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#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l00746"></a><span class="lineno"> 746</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l00747"></a><span class="lineno"> 747</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00748"></a><span class="lineno"> 748</span>  }</div><div class="line"><a name="l00749"></a><span class="lineno"> 749</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> x_height = page_res_it.<a class="code" href="a02546.html#a997c382ddd2cf2f539532a1d91780963">block</a>()-><a class="code" href="a02534.html#ae7c240d4878247ebdfe78433446751bf">block</a>-><a class="code" href="a02514.html#ab1ac3646c85d17089af85a306ef8a7e7">x_height</a>();</div><div class="line"><a name="l00750"></a><span class="lineno"> 750</span>  <span class="keywordtype">float</span> word_x_height = word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>;</div><div class="line"><a name="l00751"></a><span class="lineno"> 751</span>  <span class="keywordflow">if</span> (word_x_height < word->best_choice->min_x_height() ||</div><div class="line"><a name="l00752"></a><span class="lineno"> 752</span>  word_x_height > word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad5de9fce903ff6d884e60a639f750367">max_x_height</a>()) {</div><div class="line"><a name="l00753"></a><span class="lineno"> 753</span>  word_x_height = (word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#acb9b3195ec05dbf12160ac52a79aff36">min_x_height</a>() +</div><div class="line"><a name="l00754"></a><span class="lineno"> 754</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad5de9fce903ff6d884e60a639f750367">max_x_height</a>()) / 2.0f;</div><div class="line"><a name="l00755"></a><span class="lineno"> 755</span>  }</div><div class="line"><a name="l00756"></a><span class="lineno"> 756</span>  <span class="comment">// Test for small caps. Word capheight must be close to block xheight,</span></div><div class="line"><a name="l00757"></a><span class="lineno"> 757</span>  <span class="comment">// and word must contain no lower case letters, and at least one upper case.</span></div><div class="line"><a name="l00758"></a><span class="lineno"> 758</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> small_cap_xheight = x_height * <a class="code" href="a02414.html#a594719f667105487f0c3f78de6f85f77">kXHeightCapRatio</a>;</div><div class="line"><a name="l00759"></a><span class="lineno"> 759</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> small_cap_delta = (x_height - small_cap_xheight) / 2.0;</div><div class="line"><a name="l00760"></a><span class="lineno"> 760</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>-><a class="code" href="a03950.html#aecb5fe27d6bc4bac136abf86c12dac7d">script_has_xheight</a>() &&</div><div class="line"><a name="l00761"></a><span class="lineno"> 761</span>  small_cap_xheight - small_cap_delta <= word_x_height &&</div><div class="line"><a name="l00762"></a><span class="lineno"> 762</span>  word_x_height <= small_cap_xheight + small_cap_delta) {</div><div class="line"><a name="l00763"></a><span class="lineno"> 763</span>  <span class="comment">// Scan for upper/lower.</span></div><div class="line"><a name="l00764"></a><span class="lineno"> 764</span>  <span class="keywordtype">int</span> num_upper = 0;</div><div class="line"><a name="l00765"></a><span class="lineno"> 765</span>  <span class="keywordtype">int</span> num_lower = 0;</div><div class="line"><a name="l00766"></a><span class="lineno"> 766</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++i) {</div><div class="line"><a name="l00767"></a><span class="lineno"> 767</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>-><a class="code" href="a03950.html#a55071e756e234d8c51ca08079c1847cd">get_isupper</a>(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(i)))</div><div class="line"><a name="l00768"></a><span class="lineno"> 768</span>  ++num_upper;</div><div class="line"><a name="l00769"></a><span class="lineno"> 769</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>-><a class="code" href="a03950.html#afb472ed816e5f312692fa670f56dceb6">get_islower</a>(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(i)))</div><div class="line"><a name="l00770"></a><span class="lineno"> 770</span>  ++num_lower;</div><div class="line"><a name="l00771"></a><span class="lineno"> 771</span>  }</div><div class="line"><a name="l00772"></a><span class="lineno"> 772</span>  <span class="keywordflow">if</span> (num_upper > 0 && num_lower == 0)</div><div class="line"><a name="l00773"></a><span class="lineno"> 773</span>  word-><a class="code" href="a02542.html#ac14d59010b792d434b39e991b0c8a962">small_caps</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00774"></a><span class="lineno"> 774</span>  }</div><div class="line"><a name="l00775"></a><span class="lineno"> 775</span>  word-><a class="code" href="a02542.html#a9396676a933d148c488dcc0a723bb199">SetScriptPositions</a>();</div><div class="line"><a name="l00776"></a><span class="lineno"> 776</span>  }</div><div class="line"><a name="l00777"></a><span class="lineno"> 777</span> }</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> <span class="comment">// Helper finds the gap between the index word and the next.</span></div><div class="line"><a name="l00780"></a><span class="lineno"> 780</span> <span class="keyword">static</span> <span class="keywordtype">void</span> WordGap(<span class="keyword">const</span> <a class="code" href="a02730.html">PointerVector<WERD_RES></a>& words, <span class="keywordtype">int</span> index, <span class="keywordtype">int</span>* right,</div><div class="line"><a name="l00781"></a><span class="lineno"> 781</span>  <span class="keywordtype">int</span>* next_left) {</div><div class="line"><a name="l00782"></a><span class="lineno"> 782</span>  *right = -INT32_MAX;</div><div class="line"><a name="l00783"></a><span class="lineno"> 783</span>  *next_left = INT32_MAX;</div><div class="line"><a name="l00784"></a><span class="lineno"> 784</span>  <span class="keywordflow">if</span> (index < words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>()) {</div><div class="line"><a name="l00785"></a><span class="lineno"> 785</span>  *right = words[index]->word->bounding_box().right();</div><div class="line"><a name="l00786"></a><span class="lineno"> 786</span>  <span class="keywordflow">if</span> (index + 1 < words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>())</div><div class="line"><a name="l00787"></a><span class="lineno"> 787</span>  *next_left = words[index + 1]->word->bounding_box().left();</div><div class="line"><a name="l00788"></a><span class="lineno"> 788</span>  }</div><div class="line"><a name="l00789"></a><span class="lineno"> 789</span> }</div><div class="line"><a name="l00790"></a><span class="lineno"> 790</span> </div><div class="line"><a name="l00791"></a><span class="lineno"> 791</span> <span class="comment">// Factored helper computes the rating, certainty, badness and validity of</span></div><div class="line"><a name="l00792"></a><span class="lineno"> 792</span> <span class="comment">// the permuter of the words in [first_index, end_index).</span></div><div class="line"><a name="l00793"></a><span class="lineno"> 793</span> <span class="keyword">static</span> <span class="keywordtype">void</span> EvaluateWordSpan(<span class="keyword">const</span> PointerVector<WERD_RES>& words,</div><div class="line"><a name="l00794"></a><span class="lineno"> 794</span>  <span class="keywordtype">int</span> first_index, <span class="keywordtype">int</span> end_index, <span class="keywordtype">float</span>* rating,</div><div class="line"><a name="l00795"></a><span class="lineno"> 795</span>  <span class="keywordtype">float</span>* certainty, <span class="keywordtype">bool</span>* bad,</div><div class="line"><a name="l00796"></a><span class="lineno"> 796</span>  <span class="keywordtype">bool</span>* valid_permuter) {</div><div class="line"><a name="l00797"></a><span class="lineno"> 797</span>  <span class="keywordflow">if</span> (end_index <= first_index) {</div><div class="line"><a name="l00798"></a><span class="lineno"> 798</span>  *bad = <span class="keyword">true</span>;</div><div class="line"><a name="l00799"></a><span class="lineno"> 799</span>  *valid_permuter = <span class="keyword">false</span>;</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>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> index = first_index; index < end_index && index < words.size();</div><div class="line"><a name="l00802"></a><span class="lineno"> 802</span>  ++index) {</div><div class="line"><a name="l00803"></a><span class="lineno"> 803</span>  <a class="code" href="a02606.html">WERD_CHOICE</a>* choice = words[index]->best_choice;</div><div class="line"><a name="l00804"></a><span class="lineno"> 804</span>  <span class="keywordflow">if</span> (choice == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00805"></a><span class="lineno"> 805</span>  *bad = <span class="keyword">true</span>;</div><div class="line"><a name="l00806"></a><span class="lineno"> 806</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00807"></a><span class="lineno"> 807</span>  *rating += choice-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>();</div><div class="line"><a name="l00808"></a><span class="lineno"> 808</span>  *certainty = std::min(*certainty, choice-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>());</div><div class="line"><a name="l00809"></a><span class="lineno"> 809</span>  <span class="keywordflow">if</span> (!<a class="code" href="a04290.html#a6332398cf9ef4a202d2a6f7142d51e3d">Dict::valid_word_permuter</a>(choice-><a class="code" href="a02606.html#a7a606dd5236e78662fccade85d23edee">permuter</a>(), <span class="keyword">false</span>))</div><div class="line"><a name="l00810"></a><span class="lineno"> 810</span>  *valid_permuter = <span class="keyword">false</span>;</div><div class="line"><a name="l00811"></a><span class="lineno"> 811</span>  }</div><div class="line"><a name="l00812"></a><span class="lineno"> 812</span>  }</div><div class="line"><a name="l00813"></a><span class="lineno"> 813</span> }</div><div class="line"><a name="l00814"></a><span class="lineno"> 814</span> </div><div class="line"><a name="l00815"></a><span class="lineno"> 815</span> <span class="comment">// Helper chooses the best combination of words, transferring good ones from</span></div><div class="line"><a name="l00816"></a><span class="lineno"> 816</span> <span class="comment">// new_words to best_words. To win, a new word must have (better rating and</span></div><div class="line"><a name="l00817"></a><span class="lineno"> 817</span> <span class="comment">// certainty) or (better permuter status and rating within rating ratio and</span></div><div class="line"><a name="l00818"></a><span class="lineno"> 818</span> <span class="comment">// certainty within certainty margin) than current best.</span></div><div class="line"><a name="l00819"></a><span class="lineno"> 819</span> <span class="comment">// All the new_words are consumed (moved to best_words or deleted.)</span></div><div class="line"><a name="l00820"></a><span class="lineno"> 820</span> <span class="comment">// The return value is the number of new_words used minus the number of</span></div><div class="line"><a name="l00821"></a><span class="lineno"> 821</span> <span class="comment">// best_words that remain in the output.</span></div><div class="line"><a name="l00822"></a><span class="lineno"> 822</span> <span class="keyword">static</span> <span class="keywordtype">int</span> SelectBestWords(<span class="keywordtype">double</span> rating_ratio,</div><div class="line"><a name="l00823"></a><span class="lineno"> 823</span>  <span class="keywordtype">double</span> certainty_margin,</div><div class="line"><a name="l00824"></a><span class="lineno"> 824</span>  <span class="keywordtype">bool</span> debug,</div><div class="line"><a name="l00825"></a><span class="lineno"> 825</span>  PointerVector<WERD_RES>* new_words,</div><div class="line"><a name="l00826"></a><span class="lineno"> 826</span>  PointerVector<WERD_RES>* best_words) {</div><div class="line"><a name="l00827"></a><span class="lineno"> 827</span>  <span class="comment">// Process the smallest groups of words that have an overlapping word</span></div><div class="line"><a name="l00828"></a><span class="lineno"> 828</span>  <span class="comment">// boundary at the end.</span></div><div class="line"><a name="l00829"></a><span class="lineno"> 829</span>  <a class="code" href="a02182.html">GenericVector<WERD_RES*></a> out_words;</div><div class="line"><a name="l00830"></a><span class="lineno"> 830</span>  <span class="comment">// Index into each word vector (best, new).</span></div><div class="line"><a name="l00831"></a><span class="lineno"> 831</span>  <span class="keywordtype">int</span> b = 0, n = 0;</div><div class="line"><a name="l00832"></a><span class="lineno"> 832</span>  <span class="keywordtype">int</span> num_best = 0, num_new = 0;</div><div class="line"><a name="l00833"></a><span class="lineno"> 833</span>  <span class="keywordflow">while</span> (b < best_words->size() || n < new_words->size()) {</div><div class="line"><a name="l00834"></a><span class="lineno"> 834</span>  <span class="comment">// Start of the current run in each.</span></div><div class="line"><a name="l00835"></a><span class="lineno"> 835</span>  <span class="keywordtype">int</span> start_b = b, start_n = n;</div><div class="line"><a name="l00836"></a><span class="lineno"> 836</span>  <span class="keywordflow">while</span> (b < best_words->size() || n < new_words->size()) {</div><div class="line"><a name="l00837"></a><span class="lineno"> 837</span>  <span class="keywordtype">int</span> b_right = -INT32_MAX;</div><div class="line"><a name="l00838"></a><span class="lineno"> 838</span>  <span class="keywordtype">int</span> next_b_left = INT32_MAX;</div><div class="line"><a name="l00839"></a><span class="lineno"> 839</span>  WordGap(*best_words, b, &b_right, &next_b_left);</div><div class="line"><a name="l00840"></a><span class="lineno"> 840</span>  <span class="keywordtype">int</span> n_right = -INT32_MAX;</div><div class="line"><a name="l00841"></a><span class="lineno"> 841</span>  <span class="keywordtype">int</span> next_n_left = INT32_MAX;</div><div class="line"><a name="l00842"></a><span class="lineno"> 842</span>  WordGap(*new_words, n, &n_right, &next_n_left);</div><div class="line"><a name="l00843"></a><span class="lineno"> 843</span>  <span class="keywordflow">if</span> (std::max(b_right, n_right) < std::min(next_b_left, next_n_left)) {</div><div class="line"><a name="l00844"></a><span class="lineno"> 844</span>  <span class="comment">// The word breaks overlap. [start_b,b] and [start_n, n] match.</span></div><div class="line"><a name="l00845"></a><span class="lineno"> 845</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00846"></a><span class="lineno"> 846</span>  }</div><div class="line"><a name="l00847"></a><span class="lineno"> 847</span>  <span class="comment">// Keep searching for the matching word break.</span></div><div class="line"><a name="l00848"></a><span class="lineno"> 848</span>  <span class="keywordflow">if</span> ((b_right < n_right && b < best_words->size()) ||</div><div class="line"><a name="l00849"></a><span class="lineno"> 849</span>  n == new_words->size())</div><div class="line"><a name="l00850"></a><span class="lineno"> 850</span>  ++b;</div><div class="line"><a name="l00851"></a><span class="lineno"> 851</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00852"></a><span class="lineno"> 852</span>  ++n;</div><div class="line"><a name="l00853"></a><span class="lineno"> 853</span>  }</div><div class="line"><a name="l00854"></a><span class="lineno"> 854</span>  <span class="comment">// Rating of the current run in each.</span></div><div class="line"><a name="l00855"></a><span class="lineno"> 855</span>  <span class="keywordtype">float</span> b_rating = 0.0f, n_rating = 0.0f;</div><div class="line"><a name="l00856"></a><span class="lineno"> 856</span>  <span class="comment">// Certainty of the current run in each.</span></div><div class="line"><a name="l00857"></a><span class="lineno"> 857</span>  <span class="keywordtype">float</span> b_certainty = 0.0f, n_certainty = 0.0f;</div><div class="line"><a name="l00858"></a><span class="lineno"> 858</span>  <span class="comment">// True if any word is missing its best choice.</span></div><div class="line"><a name="l00859"></a><span class="lineno"> 859</span>  <span class="keywordtype">bool</span> b_bad = <span class="keyword">false</span>, n_bad = <span class="keyword">false</span>;</div><div class="line"><a name="l00860"></a><span class="lineno"> 860</span>  <span class="comment">// True if all words have a valid permuter.</span></div><div class="line"><a name="l00861"></a><span class="lineno"> 861</span>  <span class="keywordtype">bool</span> b_valid_permuter = <span class="keyword">true</span>, n_valid_permuter = <span class="keyword">true</span>;</div><div class="line"><a name="l00862"></a><span class="lineno"> 862</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_b = b < best_words->size() ? b + 1 : b;</div><div class="line"><a name="l00863"></a><span class="lineno"> 863</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_n = n < new_words->size() ? n + 1 : n;</div><div class="line"><a name="l00864"></a><span class="lineno"> 864</span>  EvaluateWordSpan(*best_words, start_b, end_b, &b_rating, &b_certainty,</div><div class="line"><a name="l00865"></a><span class="lineno"> 865</span>  &b_bad, &b_valid_permuter);</div><div class="line"><a name="l00866"></a><span class="lineno"> 866</span>  EvaluateWordSpan(*new_words, start_n, end_n, &n_rating, &n_certainty,</div><div class="line"><a name="l00867"></a><span class="lineno"> 867</span>  &n_bad, &n_valid_permuter);</div><div class="line"><a name="l00868"></a><span class="lineno"> 868</span>  <span class="keywordtype">bool</span> new_better = <span class="keyword">false</span>;</div><div class="line"><a name="l00869"></a><span class="lineno"> 869</span>  <span class="keywordflow">if</span> (!n_bad && (b_bad || (n_certainty > b_certainty &&</div><div class="line"><a name="l00870"></a><span class="lineno"> 870</span>  n_rating < b_rating) ||</div><div class="line"><a name="l00871"></a><span class="lineno"> 871</span>  (!b_valid_permuter && n_valid_permuter &&</div><div class="line"><a name="l00872"></a><span class="lineno"> 872</span>  n_rating < b_rating * rating_ratio &&</div><div class="line"><a name="l00873"></a><span class="lineno"> 873</span>  n_certainty > b_certainty - certainty_margin))) {</div><div class="line"><a name="l00874"></a><span class="lineno"> 874</span>  <span class="comment">// New is better.</span></div><div class="line"><a name="l00875"></a><span class="lineno"> 875</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = start_n; i < end_n; ++i) {</div><div class="line"><a name="l00876"></a><span class="lineno"> 876</span>  out_words.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>((*new_words)[i]);</div><div class="line"><a name="l00877"></a><span class="lineno"> 877</span>  (*new_words)[i] = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00878"></a><span class="lineno"> 878</span>  ++num_new;</div><div class="line"><a name="l00879"></a><span class="lineno"> 879</span>  }</div><div class="line"><a name="l00880"></a><span class="lineno"> 880</span>  new_better = <span class="keyword">true</span>;</div><div class="line"><a name="l00881"></a><span class="lineno"> 881</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!b_bad) {</div><div class="line"><a name="l00882"></a><span class="lineno"> 882</span>  <span class="comment">// Current best is better.</span></div><div class="line"><a name="l00883"></a><span class="lineno"> 883</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = start_b; i < end_b; ++i) {</div><div class="line"><a name="l00884"></a><span class="lineno"> 884</span>  out_words.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>((*best_words)[i]);</div><div class="line"><a name="l00885"></a><span class="lineno"> 885</span>  (*best_words)[i] = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00886"></a><span class="lineno"> 886</span>  ++num_best;</div><div class="line"><a name="l00887"></a><span class="lineno"> 887</span>  }</div><div class="line"><a name="l00888"></a><span class="lineno"> 888</span>  }</div><div class="line"><a name="l00889"></a><span class="lineno"> 889</span>  <span class="keywordflow">if</span> (debug) {</div><div class="line"><a name="l00890"></a><span class="lineno"> 890</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%d new words %s than %d old words: r: %g v %g c: %g v %g"</span></div><div class="line"><a name="l00891"></a><span class="lineno"> 891</span>  <span class="stringliteral">" valid dict: %d v %d\n"</span>,</div><div class="line"><a name="l00892"></a><span class="lineno"> 892</span>  end_n - start_n, new_better ? <span class="stringliteral">"better"</span> : <span class="stringliteral">"worse"</span>,</div><div class="line"><a name="l00893"></a><span class="lineno"> 893</span>  end_b - start_b, n_rating, b_rating,</div><div class="line"><a name="l00894"></a><span class="lineno"> 894</span>  n_certainty, b_certainty, n_valid_permuter, b_valid_permuter);</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>  <span class="comment">// Move on to the next group.</span></div><div class="line"><a name="l00897"></a><span class="lineno"> 897</span>  b = end_b;</div><div class="line"><a name="l00898"></a><span class="lineno"> 898</span>  n = end_n;</div><div class="line"><a name="l00899"></a><span class="lineno"> 899</span>  }</div><div class="line"><a name="l00900"></a><span class="lineno"> 900</span>  <span class="comment">// Transfer from out_words to best_words.</span></div><div class="line"><a name="l00901"></a><span class="lineno"> 901</span>  best_words->clear();</div><div class="line"><a name="l00902"></a><span class="lineno"> 902</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < out_words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i)</div><div class="line"><a name="l00903"></a><span class="lineno"> 903</span>  best_words->push_back(out_words[i]);</div><div class="line"><a name="l00904"></a><span class="lineno"> 904</span>  <span class="keywordflow">return</span> num_new - num_best;</div><div class="line"><a name="l00905"></a><span class="lineno"> 905</span> }</div><div class="line"><a name="l00906"></a><span class="lineno"> 906</span> </div><div class="line"><a name="l00907"></a><span class="lineno"> 907</span> <span class="comment">// Helper to recognize the word using the given (language-specific) tesseract.</span></div><div class="line"><a name="l00908"></a><span class="lineno"> 908</span> <span class="comment">// Returns positive if this recognizer found more new best words than the</span></div><div class="line"><a name="l00909"></a><span class="lineno"> 909</span> <span class="comment">// number kept from best_words.</span></div><div class="line"><a name="l00910"></a><span class="lineno"><a class="line" href="a02358.html#a8952ab340e0f5e61992109e85cb1619c"> 910</a></span> <span class="keywordtype">int</span> <a class="code" href="a02358.html#a8952ab340e0f5e61992109e85cb1619c">Tesseract::RetryWithLanguage</a>(<span class="keyword">const</span> <a class="code" href="a02354.html">WordData</a>& word_data,</div><div class="line"><a name="l00911"></a><span class="lineno"> 911</span>  <a class="code" href="a01629.html#ac50ad7dad904ed14e81cd29a3bfdb82d">WordRecognizer</a> recognizer, <span class="keywordtype">bool</span> debug,</div><div class="line"><a name="l00912"></a><span class="lineno"> 912</span>  <a class="code" href="a02542.html">WERD_RES</a>** in_word,</div><div class="line"><a name="l00913"></a><span class="lineno"> 913</span>  <a class="code" href="a02730.html">PointerVector<WERD_RES></a>* best_words) {</div><div class="line"><a name="l00914"></a><span class="lineno"> 914</span>  <span class="keywordflow">if</span> (debug) {</div><div class="line"><a name="l00915"></a><span class="lineno"> 915</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Trying word using lang %s, oem %d\n"</span>,</div><div class="line"><a name="l00916"></a><span class="lineno"> 916</span>  <a class="code" href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">lang</a>.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a>));</div><div class="line"><a name="l00917"></a><span class="lineno"> 917</span>  }</div><div class="line"><a name="l00918"></a><span class="lineno"> 918</span>  <span class="comment">// Run the recognizer on the word.</span></div><div class="line"><a name="l00919"></a><span class="lineno"> 919</span>  <a class="code" href="a02730.html">PointerVector<WERD_RES></a> new_words;</div><div class="line"><a name="l00920"></a><span class="lineno"> 920</span>  (this->*recognizer)(word_data, in_word, &new_words);</div><div class="line"><a name="l00921"></a><span class="lineno"> 921</span>  <span class="keywordflow">if</span> (new_words.<a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>()) {</div><div class="line"><a name="l00922"></a><span class="lineno"> 922</span>  <span class="comment">// Transfer input word to new_words, as the classifier must have put</span></div><div class="line"><a name="l00923"></a><span class="lineno"> 923</span>  <span class="comment">// the result back in the input.</span></div><div class="line"><a name="l00924"></a><span class="lineno"> 924</span>  new_words.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(*in_word);</div><div class="line"><a name="l00925"></a><span class="lineno"> 925</span>  *in_word = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00926"></a><span class="lineno"> 926</span>  }</div><div class="line"><a name="l00927"></a><span class="lineno"> 927</span>  <span class="keywordflow">if</span> (debug) {</div><div class="line"><a name="l00928"></a><span class="lineno"> 928</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < new_words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i)</div><div class="line"><a name="l00929"></a><span class="lineno"> 929</span>  new_words[i]->DebugTopChoice(<span class="stringliteral">"Lang result"</span>);</div><div class="line"><a name="l00930"></a><span class="lineno"> 930</span>  }</div><div class="line"><a name="l00931"></a><span class="lineno"> 931</span>  <span class="comment">// Initial version is a bit of a hack based on better certainty and rating</span></div><div class="line"><a name="l00932"></a><span class="lineno"> 932</span>  <span class="comment">// or a dictionary vs non-dictionary word.</span></div><div class="line"><a name="l00933"></a><span class="lineno"> 933</span>  <span class="keywordflow">return</span> SelectBestWords(<a class="code" href="a03998.html#a03c6f57fc6ce80fc38c2229836f52a37">classify_max_rating_ratio</a>,</div><div class="line"><a name="l00934"></a><span class="lineno"> 934</span>  <a class="code" href="a03998.html#a88f8ff9caac17216207149574db5b63b">classify_max_certainty_margin</a>,</div><div class="line"><a name="l00935"></a><span class="lineno"> 935</span>  debug, &new_words, best_words);</div><div class="line"><a name="l00936"></a><span class="lineno"> 936</span> }</div><div class="line"><a name="l00937"></a><span class="lineno"> 937</span> </div><div class="line"><a name="l00938"></a><span class="lineno"> 938</span> <span class="comment">// Helper returns true if all the words are acceptable.</span></div><div class="line"><a name="l00939"></a><span class="lineno"> 939</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> WordsAcceptable(<span class="keyword">const</span> <a class="code" href="a02730.html">PointerVector<WERD_RES></a>& words) {</div><div class="line"><a name="l00940"></a><span class="lineno"> 940</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> w = 0; w < words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++w) {</div><div class="line"><a name="l00941"></a><span class="lineno"> 941</span>  <span class="keywordflow">if</span> (words[w]->tess_failed || !words[w]->tess_accepted) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00942"></a><span class="lineno"> 942</span>  }</div><div class="line"><a name="l00943"></a><span class="lineno"> 943</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00944"></a><span class="lineno"> 944</span> }</div><div class="line"><a name="l00945"></a><span class="lineno"> 945</span> </div><div class="line"><a name="l00946"></a><span class="lineno"> 946</span> <span class="comment">// Moves good-looking "noise"/diacritics from the reject list to the main</span></div><div class="line"><a name="l00947"></a><span class="lineno"> 947</span> <span class="comment">// blob list on the current word. Returns true if anything was done, and</span></div><div class="line"><a name="l00948"></a><span class="lineno"> 948</span> <span class="comment">// sets make_next_word_fuzzy if blob(s) were added to the end of the word.</span></div><div class="line"><a name="l00949"></a><span class="lineno"><a class="line" href="a02358.html#aadf7ce5c811a4c404560aee6ed5c75e2"> 949</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#aadf7ce5c811a4c404560aee6ed5c75e2">Tesseract::ReassignDiacritics</a>(<span class="keywordtype">int</span> pass, <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it,</div><div class="line"><a name="l00950"></a><span class="lineno"> 950</span>  <span class="keywordtype">bool</span>* make_next_word_fuzzy) {</div><div class="line"><a name="l00951"></a><span class="lineno"> 951</span> <span class="preprocessor">#ifdef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l00952"></a><span class="lineno"> 952</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00953"></a><span class="lineno"> 953</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00954"></a><span class="lineno"> 954</span>  *make_next_word_fuzzy = <span class="keyword">false</span>;</div><div class="line"><a name="l00955"></a><span class="lineno"> 955</span>  <a class="code" href="a02638.html">WERD</a>* real_word = pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>;</div><div class="line"><a name="l00956"></a><span class="lineno"> 956</span>  <span class="keywordflow">if</span> (real_word-><a class="code" href="a02638.html#a0c26b86030e756d76e2425b1d2daf908">rej_cblob_list</a>()->empty() ||</div><div class="line"><a name="l00957"></a><span class="lineno"> 957</span>  real_word-><a class="code" href="a02638.html#a174baefaa99afbfdbf444e4199f3b529">cblob_list</a>()->empty() ||</div><div class="line"><a name="l00958"></a><span class="lineno"> 958</span>  real_word-><a class="code" href="a02638.html#a0c26b86030e756d76e2425b1d2daf908">rej_cblob_list</a>()->length() > <a class="code" href="a02358.html#a36528329a2255d819b87c7d0962a23c4">noise_maxperword</a>)</div><div class="line"><a name="l00959"></a><span class="lineno"> 959</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00960"></a><span class="lineno"> 960</span>  real_word-><a class="code" href="a02638.html#a0c26b86030e756d76e2425b1d2daf908">rej_cblob_list</a>()->sort(&<a class="code" href="a02634.html#a9b2a8bdd86c5989f6036dd6b7e5e3811">C_BLOB::SortByXMiddle</a>);</div><div class="line"><a name="l00961"></a><span class="lineno"> 961</span>  <span class="comment">// Get the noise outlines into a vector with matching bool map.</span></div><div class="line"><a name="l00962"></a><span class="lineno"> 962</span>  <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a> outlines;</div><div class="line"><a name="l00963"></a><span class="lineno"> 963</span>  real_word-><a class="code" href="a02638.html#af11dd59cfa4bd5e89818cb65c7a10b7c">GetNoiseOutlines</a>(&outlines);</div><div class="line"><a name="l00964"></a><span class="lineno"> 964</span>  <a class="code" href="a02182.html">GenericVector<bool></a> word_wanted;</div><div class="line"><a name="l00965"></a><span class="lineno"> 965</span>  <a class="code" href="a02182.html">GenericVector<bool></a> overlapped_any_blob;</div><div class="line"><a name="l00966"></a><span class="lineno"> 966</span>  <a class="code" href="a02182.html">GenericVector<C_BLOB*></a> target_blobs;</div><div class="line"><a name="l00967"></a><span class="lineno"> 967</span>  <a class="code" href="a02358.html#a08393cbe8d9fec500ddce395d3319b32">AssignDiacriticsToOverlappingBlobs</a>(outlines, pass, real_word, pr_it,</div><div class="line"><a name="l00968"></a><span class="lineno"> 968</span>  &word_wanted, &overlapped_any_blob,</div><div class="line"><a name="l00969"></a><span class="lineno"> 969</span>  &target_blobs);</div><div class="line"><a name="l00970"></a><span class="lineno"> 970</span>  <span class="comment">// Filter the outlines that overlapped any blob and put them into the word</span></div><div class="line"><a name="l00971"></a><span class="lineno"> 971</span>  <span class="comment">// now. This simplifies the remaining task and also makes it more accurate</span></div><div class="line"><a name="l00972"></a><span class="lineno"> 972</span>  <span class="comment">// as it has more completed blobs to work on.</span></div><div class="line"><a name="l00973"></a><span class="lineno"> 973</span>  <a class="code" href="a02182.html">GenericVector<bool></a> wanted;</div><div class="line"><a name="l00974"></a><span class="lineno"> 974</span>  <a class="code" href="a02182.html">GenericVector<C_BLOB*></a> wanted_blobs;</div><div class="line"><a name="l00975"></a><span class="lineno"> 975</span>  <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a> wanted_outlines;</div><div class="line"><a name="l00976"></a><span class="lineno"> 976</span>  <span class="keywordtype">int</span> num_overlapped = 0;</div><div class="line"><a name="l00977"></a><span class="lineno"> 977</span>  <span class="keywordtype">int</span> num_overlapped_used = 0;</div><div class="line"><a name="l00978"></a><span class="lineno"> 978</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < overlapped_any_blob.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l00979"></a><span class="lineno"> 979</span>  <span class="keywordflow">if</span> (overlapped_any_blob[i]) {</div><div class="line"><a name="l00980"></a><span class="lineno"> 980</span>  ++num_overlapped;</div><div class="line"><a name="l00981"></a><span class="lineno"> 981</span>  <span class="keywordflow">if</span> (word_wanted[i]) ++num_overlapped_used;</div><div class="line"><a name="l00982"></a><span class="lineno"> 982</span>  wanted.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(word_wanted[i]);</div><div class="line"><a name="l00983"></a><span class="lineno"> 983</span>  wanted_blobs.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(target_blobs[i]);</div><div class="line"><a name="l00984"></a><span class="lineno"> 984</span>  wanted_outlines.<a class="code" href="a02182.html#a0dc89fe2a365b04a61017f9d78c1a303">push_back</a>(outlines[i]);</div><div class="line"><a name="l00985"></a><span class="lineno"> 985</span>  outlines[i] = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00986"></a><span class="lineno"> 986</span>  }</div><div class="line"><a name="l00987"></a><span class="lineno"> 987</span>  }</div><div class="line"><a name="l00988"></a><span class="lineno"> 988</span>  real_word-><a class="code" href="a02638.html#a2fb1e087221cb657546cba853dcc6732">AddSelectedOutlines</a>(wanted, wanted_blobs, wanted_outlines, <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00989"></a><span class="lineno"> 989</span>  <a class="code" href="a02358.html#a64c4feb195f9c3bb487536da72436654">AssignDiacriticsToNewBlobs</a>(outlines, pass, real_word, pr_it, &word_wanted,</div><div class="line"><a name="l00990"></a><span class="lineno"> 990</span>  &target_blobs);</div><div class="line"><a name="l00991"></a><span class="lineno"> 991</span>  <span class="keywordtype">int</span> non_overlapped = 0;</div><div class="line"><a name="l00992"></a><span class="lineno"> 992</span>  <span class="keywordtype">int</span> non_overlapped_used = 0;</div><div class="line"><a name="l00993"></a><span class="lineno"> 993</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word_wanted.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l00994"></a><span class="lineno"> 994</span>  <span class="keywordflow">if</span> (word_wanted[i]) ++non_overlapped_used;</div><div class="line"><a name="l00995"></a><span class="lineno"> 995</span>  <span class="keywordflow">if</span> (outlines[i] != <span class="keyword">nullptr</span>) ++non_overlapped_used;</div><div class="line"><a name="l00996"></a><span class="lineno"> 996</span>  }</div><div class="line"><a name="l00997"></a><span class="lineno"> 997</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l00998"></a><span class="lineno"> 998</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Used %d/%d overlapped %d/%d non-overlaped diacritics on word:"</span>,</div><div class="line"><a name="l00999"></a><span class="lineno"> 999</span>  num_overlapped_used, num_overlapped, non_overlapped_used,</div><div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>  non_overlapped);</div><div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>  real_word-><a class="code" href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">bounding_box</a>().<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>  }</div><div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>  <span class="comment">// Now we have decided which outlines we want, put them into the real_word.</span></div><div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>  <span class="keywordflow">if</span> (real_word-><a class="code" href="a02638.html#a2fb1e087221cb657546cba853dcc6732">AddSelectedOutlines</a>(word_wanted, target_blobs, outlines,</div><div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>  make_next_word_fuzzy)) {</div><div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>  pr_it-><a class="code" href="a02546.html#a1b3d11938500869049e926daa7948ad3">MakeCurrentWordFuzzy</a>();</div><div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>  }</div><div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>  <span class="comment">// TODO(rays) Parts of combos have a deep copy of the real word, and need</span></div><div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>  <span class="comment">// to have their noise outlines moved/assigned in the same way!!</span></div><div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>  <span class="keywordflow">return</span> num_overlapped_used != 0 || non_overlapped_used != 0;</div><div class="line"><a name="l01011"></a><span class="lineno"> 1011</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</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> </div><div class="line"><a name="l01014"></a><span class="lineno"> 1014</span> <span class="comment">// Attempts to put noise/diacritic outlines into the blobs that they overlap.</span></div><div class="line"><a name="l01015"></a><span class="lineno"> 1015</span> <span class="comment">// Input: a set of noisy outlines that probably belong to the real_word.</span></div><div class="line"><a name="l01016"></a><span class="lineno"> 1016</span> <span class="comment">// Output: word_wanted indicates which outlines are to be assigned to a blob,</span></div><div class="line"><a name="l01017"></a><span class="lineno"> 1017</span> <span class="comment">// target_blobs indicates which to assign to, and overlapped_any_blob is</span></div><div class="line"><a name="l01018"></a><span class="lineno"> 1018</span> <span class="comment">// true for all outlines that overlapped a blob.</span></div><div class="line"><a name="l01019"></a><span class="lineno"><a class="line" href="a02358.html#a08393cbe8d9fec500ddce395d3319b32"> 1019</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a08393cbe8d9fec500ddce395d3319b32">Tesseract::AssignDiacriticsToOverlappingBlobs</a>(</div><div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a>& outlines, <span class="keywordtype">int</span> pass, <a class="code" href="a02638.html">WERD</a>* real_word,</div><div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it, <a class="code" href="a02182.html">GenericVector<bool></a>* word_wanted,</div><div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>  <a class="code" href="a02182.html">GenericVector<bool></a>* overlapped_any_blob,</div><div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>  <a class="code" href="a02182.html">GenericVector<C_BLOB*></a>* target_blobs) {</div><div class="line"><a name="l01024"></a><span class="lineno"> 1024</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>  <a class="code" href="a02182.html">GenericVector<bool></a> blob_wanted;</div><div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>  word_wanted-><a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">false</span>);</div><div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>  overlapped_any_blob-><a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">false</span>);</div><div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>  target_blobs-><a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>  <span class="comment">// For each real blob, find the outlines that seriously overlap it.</span></div><div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>  <span class="comment">// A single blob could be several merged characters, so there can be quite</span></div><div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>  <span class="comment">// a few outlines overlapping, and the full engine needs to be used to chop</span></div><div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>  <span class="comment">// and join to get a sensible result.</span></div><div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>  C_BLOB_IT blob_it(real_word-><a class="code" href="a02638.html#a174baefaa99afbfdbf444e4199f3b529">cblob_list</a>());</div><div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>  <span class="keywordflow">for</span> (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {</div><div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob = blob_it.data();</div><div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>  <span class="keyword">const</span> <a class="code" href="a02610.html">TBOX</a> blob_box = blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>();</div><div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>  blob_wanted.<a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">false</span>);</div><div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>  <span class="keywordtype">int</span> num_blob_outlines = 0;</div><div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>  <span class="keywordflow">if</span> (blob_box.<a class="code" href="a02610.html#ade947e3871fa316e3e0b0864905c2997">major_x_overlap</a>(outlines[i]->bounding_box()) &&</div><div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>  !(*word_wanted)[i]) {</div><div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>  blob_wanted[i] = <span class="keyword">true</span>;</div><div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>  (*overlapped_any_blob)[i] = <span class="keyword">true</span>;</div><div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>  ++num_blob_outlines;</div><div class="line"><a name="l01045"></a><span class="lineno"> 1045</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>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%d noise outlines overlap blob at:"</span>, num_blob_outlines);</div><div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>  blob_box.<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>  }</div><div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>  <span class="comment">// If any outlines overlap the blob, and not too many, classify the blob</span></div><div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>  <span class="comment">// (using the full engine, languages and all), and choose the maximal</span></div><div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>  <span class="comment">// combination of outlines that doesn't hurt the end-result classification</span></div><div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>  <span class="comment">// by too much. Mark them as wanted.</span></div><div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>  <span class="keywordflow">if</span> (0 < num_blob_outlines && num_blob_outlines < <a class="code" href="a02358.html#a1968245f2d1cf2f62d9b5fd437ba13a6">noise_maxperblob</a>) {</div><div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0096aa50725c746d70a7aee34ab45214">SelectGoodDiacriticOutlines</a>(pass, <a class="code" href="a02358.html#a8ac4f5ef5b69323c047c824f4ad9e548">noise_cert_basechar</a>, pr_it, blob,</div><div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>  outlines, num_blob_outlines,</div><div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>  &blob_wanted)) {</div><div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < blob_wanted.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>  <span class="keywordflow">if</span> (blob_wanted[i]) {</div><div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>  <span class="comment">// Claim the outline and record where it is going.</span></div><div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>  (*word_wanted)[i] = <span class="keyword">true</span>;</div><div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>  (*target_blobs)[i] = blob;</div><div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>  }</div><div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>  }</div><div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>  }</div><div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>  }</div><div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>  }</div><div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> }</div><div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> </div><div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> <span class="comment">// Attempts to assign non-overlapping outlines to their nearest blobs or</span></div><div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> <span class="comment">// make new blobs out of them.</span></div><div class="line"><a name="l01074"></a><span class="lineno"><a class="line" href="a02358.html#a64c4feb195f9c3bb487536da72436654"> 1074</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a64c4feb195f9c3bb487536da72436654">Tesseract::AssignDiacriticsToNewBlobs</a>(</div><div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a>& outlines, <span class="keywordtype">int</span> pass, <a class="code" href="a02638.html">WERD</a>* real_word,</div><div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it, <a class="code" href="a02182.html">GenericVector<bool></a>* word_wanted,</div><div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>  <a class="code" href="a02182.html">GenericVector<C_BLOB*></a>* target_blobs) {</div><div class="line"><a name="l01078"></a><span class="lineno"> 1078</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>  <a class="code" href="a02182.html">GenericVector<bool></a> blob_wanted;</div><div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>  word_wanted-><a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">false</span>);</div><div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>  target_blobs-><a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>  <span class="comment">// Check for outlines that need to be turned into stand-alone blobs.</span></div><div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>  <span class="keywordflow">if</span> (outlines[i] == <span class="keyword">nullptr</span>) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>  <span class="comment">// Get a set of adjacent outlines that don't overlap any existing blob.</span></div><div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>  blob_wanted.<a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(), <span class="keyword">false</span>);</div><div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>  <span class="keywordtype">int</span> num_blob_outlines = 0;</div><div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>  <a class="code" href="a02610.html">TBOX</a> total_ol_box(outlines[i]->bounding_box());</div><div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>  <span class="keywordflow">while</span> (i < outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() && outlines[i] != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>  blob_wanted[i] = <span class="keyword">true</span>;</div><div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>  total_ol_box += outlines[i]->bounding_box();</div><div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>  ++i;</div><div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>  ++num_blob_outlines;</div><div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>  }</div><div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>  <span class="comment">// Find the insertion point.</span></div><div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>  C_BLOB_IT blob_it(real_word-><a class="code" href="a02638.html#a174baefaa99afbfdbf444e4199f3b529">cblob_list</a>());</div><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>  <span class="keywordflow">while</span> (!blob_it.at_last() &&</div><div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>  blob_it.data_relative(1)->bounding_box().left() <=</div><div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>  total_ol_box.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>()) {</div><div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>  blob_it.forward();</div><div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>  }</div><div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>  <span class="comment">// Choose which combination of them we actually want and where to put</span></div><div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>  <span class="comment">// them.</span></div><div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>)</div><div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Num blobless outlines = %d\n"</span>, num_blob_outlines);</div><div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>  <a class="code" href="a02634.html">C_BLOB</a>* left_blob = blob_it.data();</div><div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>  <a class="code" href="a02610.html">TBOX</a> left_box = left_blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>();</div><div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>  <a class="code" href="a02634.html">C_BLOB</a>* right_blob = blob_it.at_last() ? nullptr : blob_it.data_relative(1);</div><div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>  <span class="keywordflow">if</span> ((left_box.<a class="code" href="a02610.html#a06d060ef7951a2702eb3a1e5a6cbac7c">x_overlap</a>(total_ol_box) || right_blob == <span class="keyword">nullptr</span> ||</div><div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>  !right_blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>().<a class="code" href="a02610.html#a06d060ef7951a2702eb3a1e5a6cbac7c">x_overlap</a>(total_ol_box)) &&</div><div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>  <a class="code" href="a02358.html#a0096aa50725c746d70a7aee34ab45214">SelectGoodDiacriticOutlines</a>(pass, <a class="code" href="a02358.html#ad84163281c1fd2885741971d1b16396c">noise_cert_disjoint</a>, pr_it, left_blob,</div><div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>  outlines, num_blob_outlines,</div><div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>  &blob_wanted)) {</div><div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Added to left blob\n"</span>);</div><div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < blob_wanted.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++j) {</div><div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>  <span class="keywordflow">if</span> (blob_wanted[j]) {</div><div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>  (*word_wanted)[j] = <span class="keyword">true</span>;</div><div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>  (*target_blobs)[j] = left_blob;</div><div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>  }</div><div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>  }</div><div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (right_blob != <span class="keyword">nullptr</span> &&</div><div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>  (!left_box.<a class="code" href="a02610.html#a06d060ef7951a2702eb3a1e5a6cbac7c">x_overlap</a>(total_ol_box) ||</div><div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>  right_blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>().<a class="code" href="a02610.html#a06d060ef7951a2702eb3a1e5a6cbac7c">x_overlap</a>(total_ol_box)) &&</div><div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>  <a class="code" href="a02358.html#a0096aa50725c746d70a7aee34ab45214">SelectGoodDiacriticOutlines</a>(pass, <a class="code" href="a02358.html#ad84163281c1fd2885741971d1b16396c">noise_cert_disjoint</a>, pr_it,</div><div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>  right_blob, outlines,</div><div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>  num_blob_outlines, &blob_wanted)) {</div><div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Added to right blob\n"</span>);</div><div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < blob_wanted.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++j) {</div><div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>  <span class="keywordflow">if</span> (blob_wanted[j]) {</div><div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>  (*word_wanted)[j] = <span class="keyword">true</span>;</div><div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>  (*target_blobs)[j] = right_blob;</div><div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>  }</div><div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>  }</div><div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0096aa50725c746d70a7aee34ab45214">SelectGoodDiacriticOutlines</a>(pass, <a class="code" href="a02358.html#a5da2276e5c64aaf048acf9e65a4f7a75">noise_cert_punc</a>, pr_it, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>  outlines, num_blob_outlines,</div><div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>  &blob_wanted)) {</div><div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Fitted between blobs\n"</span>);</div><div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < blob_wanted.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++j) {</div><div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>  <span class="keywordflow">if</span> (blob_wanted[j]) {</div><div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>  (*word_wanted)[j] = <span class="keyword">true</span>;</div><div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>  (*target_blobs)[j] = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>  }</div><div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>  }</div><div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>  }</div><div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>  }</div><div class="line"><a name="l01146"></a><span class="lineno"> 1146</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01147"></a><span class="lineno"> 1147</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> <span class="comment">// Starting with ok_outlines set to indicate which outlines overlap the blob,</span></div><div class="line"><a name="l01150"></a><span class="lineno"> 1150</span> <span class="comment">// chooses the optimal set (approximately) and returns true if any outlines</span></div><div class="line"><a name="l01151"></a><span class="lineno"> 1151</span> <span class="comment">// are desired, in which case ok_outlines indicates which ones.</span></div><div class="line"><a name="l01152"></a><span class="lineno"><a class="line" href="a02358.html#a0096aa50725c746d70a7aee34ab45214"> 1152</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#a0096aa50725c746d70a7aee34ab45214">Tesseract::SelectGoodDiacriticOutlines</a>(</div><div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>  <span class="keywordtype">int</span> pass, <span class="keywordtype">float</span> certainty_threshold, <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it, <a class="code" href="a02634.html">C_BLOB</a>* blob,</div><div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a>& outlines, <span class="keywordtype">int</span> num_outlines,</div><div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>  <a class="code" href="a02182.html">GenericVector<bool></a>* ok_outlines) {</div><div class="line"><a name="l01156"></a><span class="lineno"> 1156</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>  <a class="code" href="a02834.html">STRING</a> best_str;</div><div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>  <span class="keywordtype">float</span> target_cert = certainty_threshold;</div><div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>  <span class="keywordflow">if</span> (blob != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>  <span class="keywordtype">float</span> target_c2;</div><div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>  target_cert = <a class="code" href="a02358.html#a85a67d840287336a86e9b710865075fc">ClassifyBlobAsWord</a>(pass, pr_it, blob, &best_str, &target_c2);</div><div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"No Noise blob classified as %s=%g(%g) at:"</span>, best_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>  target_cert, target_c2);</div><div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>  blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>().<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>  }</div><div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>  target_cert -= (target_cert - certainty_threshold) * <a class="code" href="a02358.html#a06a50ff442548e63afcdc9dcddb73817">noise_cert_factor</a>;</div><div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>  }</div><div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>  <a class="code" href="a02182.html">GenericVector<bool></a> test_outlines = *ok_outlines;</div><div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>  <span class="comment">// Start with all the outlines in.</span></div><div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>  <a class="code" href="a02834.html">STRING</a> all_str;</div><div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>  <a class="code" href="a02182.html">GenericVector<bool></a> best_outlines = *ok_outlines;</div><div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>  <span class="keywordtype">float</span> best_cert = <a class="code" href="a02358.html#af06531e448f9f0d7777ec0b81622dfec">ClassifyBlobPlusOutlines</a>(test_outlines, outlines, pass,</div><div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>  pr_it, blob, &all_str);</div><div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>  <a class="code" href="a02610.html">TBOX</a> ol_box;</div><div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < test_outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>  <span class="keywordflow">if</span> (test_outlines[i]) ol_box += outlines[i]->bounding_box();</div><div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>  }</div><div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"All Noise blob classified as %s=%g, delta=%g at:"</span>,</div><div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>  all_str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), best_cert, best_cert - target_cert);</div><div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>  ol_box.<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>  }</div><div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>  <span class="comment">// Iteratively zero out the bit that improves the certainty the most, until</span></div><div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>  <span class="comment">// we get past the threshold, have zero bits, or fail to improve.</span></div><div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>  <span class="keywordtype">int</span> best_index = 0; <span class="comment">// To zero out.</span></div><div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>  <span class="keywordflow">while</span> (num_outlines > 1 && best_index >= 0 &&</div><div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>  (blob == <span class="keyword">nullptr</span> || best_cert < target_cert || blob != <span class="keyword">nullptr</span>)) {</div><div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>  <span class="comment">// Find the best bit to zero out.</span></div><div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>  best_index = -1;</div><div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>  <span class="keywordflow">if</span> (test_outlines[i]) {</div><div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>  test_outlines[i] = <span class="keyword">false</span>;</div><div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>  <a class="code" href="a02834.html">STRING</a> str;</div><div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>  <span class="keywordtype">float</span> cert = <a class="code" href="a02358.html#af06531e448f9f0d7777ec0b81622dfec">ClassifyBlobPlusOutlines</a>(test_outlines, outlines, pass,</div><div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>  pr_it, blob, &str);</div><div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>  <a class="code" href="a02610.html">TBOX</a> ol_box;</div><div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++j) {</div><div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>  <span class="keywordflow">if</span> (test_outlines[j]) ol_box += outlines[j]->bounding_box();</div><div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%d"</span>, test_outlines[j]);</div><div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>  }</div><div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" blob classified as %s=%g, delta=%g) at:"</span>, str.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>  cert, cert - target_cert);</div><div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>  ol_box.<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>  }</div><div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>  <span class="keywordflow">if</span> (cert > best_cert) {</div><div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>  best_cert = cert;</div><div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>  best_index = i;</div><div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>  best_outlines = test_outlines;</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>  test_outlines[i] = <span class="keyword">true</span>;</div><div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>  }</div><div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>  }</div><div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>  <span class="keywordflow">if</span> (best_index >= 0) {</div><div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>  test_outlines[best_index] = <span class="keyword">false</span>;</div><div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>  --num_outlines;</div><div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>  }</div><div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>  }</div><div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>  <span class="keywordflow">if</span> (best_cert >= target_cert) {</div><div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>  <span class="comment">// Save the best combination.</span></div><div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>  *ok_outlines = best_outlines;</div><div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%s noise combination "</span>, blob ? <span class="stringliteral">"Adding"</span> : <span class="stringliteral">"New"</span>);</div><div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < best_outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%d"</span>, best_outlines[i]);</div><div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>  }</div><div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" yields certainty %g, beating target of %g\n"</span>, best_cert,</div><div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>  target_cert);</div><div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>  }</div><div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>  }</div><div class="line"><a name="l01233"></a><span class="lineno"> 1233</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01235"></a><span class="lineno"> 1235</span> }</div><div class="line"><a name="l01236"></a><span class="lineno"> 1236</span> </div><div class="line"><a name="l01237"></a><span class="lineno"> 1237</span> <span class="comment">// Classifies the given blob plus the outlines flagged by ok_outlines, undoes</span></div><div class="line"><a name="l01238"></a><span class="lineno"> 1238</span> <span class="comment">// the inclusion of the outlines, and returns the certainty of the raw choice.</span></div><div class="line"><a name="l01239"></a><span class="lineno"><a class="line" href="a02358.html#af06531e448f9f0d7777ec0b81622dfec"> 1239</a></span> <span class="keywordtype">float</span> <a class="code" href="a02358.html#af06531e448f9f0d7777ec0b81622dfec">Tesseract::ClassifyBlobPlusOutlines</a>(</div><div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<bool></a>& ok_outlines,</div><div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<C_OUTLINE*></a>& outlines, <span class="keywordtype">int</span> pass_n, <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it,</div><div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob, <a class="code" href="a02834.html">STRING</a>* best_str) {</div><div class="line"><a name="l01243"></a><span class="lineno"> 1243</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>  C_OUTLINE_IT ol_it;</div><div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>  <a class="code" href="a02422.html">C_OUTLINE</a>* first_to_keep = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>  <a class="code" href="a02634.html">C_BLOB</a>* local_blob = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>  <span class="keywordflow">if</span> (blob != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>  <span class="comment">// Add the required outlines to the blob.</span></div><div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>  ol_it.set_to_list(blob-><a class="code" href="a02634.html#ae510f3d0e7398fbb46608082429eac89">out_list</a>());</div><div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>  first_to_keep = ol_it.data();</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>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < ok_outlines.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++i) {</div><div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>  <span class="keywordflow">if</span> (ok_outlines[i]) {</div><div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>  <span class="comment">// This outline is to be added.</span></div><div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>  <span class="keywordflow">if</span> (blob == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>  local_blob = <span class="keyword">new</span> <a class="code" href="a02634.html">C_BLOB</a>(outlines[i]);</div><div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>  blob = local_blob;</div><div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>  ol_it.set_to_list(blob-><a class="code" href="a02634.html#ae510f3d0e7398fbb46608082429eac89">out_list</a>());</div><div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>  ol_it.add_before_stay_put(outlines[i]);</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>  }</div><div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>  }</div><div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>  <span class="keywordtype">float</span> c2;</div><div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>  <span class="keywordtype">float</span> cert = <a class="code" href="a02358.html#a85a67d840287336a86e9b710865075fc">ClassifyBlobAsWord</a>(pass_n, pr_it, blob, best_str, &c2);</div><div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>  ol_it.move_to_first();</div><div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>  <span class="keywordflow">if</span> (first_to_keep == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>  <span class="comment">// We created blob. Empty its outlines and delete it.</span></div><div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>  <span class="keywordflow">for</span> (; !ol_it.empty(); ol_it.forward()) ol_it.extract();</div><div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>  <span class="keyword">delete</span> local_blob;</div><div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>  cert = -c2;</div><div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>  <span class="comment">// Remove the outlines that we put in.</span></div><div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>  <span class="keywordflow">for</span> (; ol_it.data() != first_to_keep; ol_it.forward()) {</div><div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>  ol_it.extract();</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="l01278"></a><span class="lineno"> 1278</span>  <span class="keywordflow">return</span> cert;</div><div class="line"><a name="l01279"></a><span class="lineno"> 1279</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>  <span class="keywordflow">return</span> 0.1;</div><div class="line"><a name="l01281"></a><span class="lineno"> 1281</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01282"></a><span class="lineno"> 1282</span> }</div><div class="line"><a name="l01283"></a><span class="lineno"> 1283</span> </div><div class="line"><a name="l01284"></a><span class="lineno"> 1284</span> <span class="comment">// Classifies the given blob (part of word_data->word->word) as an individual</span></div><div class="line"><a name="l01285"></a><span class="lineno"> 1285</span> <span class="comment">// word, using languages, chopper etc, returning only the certainty of the</span></div><div class="line"><a name="l01286"></a><span class="lineno"> 1286</span> <span class="comment">// best raw choice, and undoing all the work done to fake out the word.</span></div><div class="line"><a name="l01287"></a><span class="lineno"><a class="line" href="a02358.html#a85a67d840287336a86e9b710865075fc"> 1287</a></span> <span class="keywordtype">float</span> <a class="code" href="a02358.html#a85a67d840287336a86e9b710865075fc">Tesseract::ClassifyBlobAsWord</a>(<span class="keywordtype">int</span> pass_n, <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it,</div><div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob, <a class="code" href="a02834.html">STRING</a>* best_str, <span class="keywordtype">float</span>* c2) {</div><div class="line"><a name="l01289"></a><span class="lineno"> 1289</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>  <a class="code" href="a02638.html">WERD</a>* real_word = pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>()-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>;</div><div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>  <a class="code" href="a02638.html">WERD</a>* word = real_word-><a class="code" href="a02638.html#a31a5b8f16e1629362369ba56a23c7cee">ConstructFromSingleBlob</a>(</div><div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>  real_word-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaff21d7c8c8992120fff35942408a00d2">W_BOL</a>), real_word-><a class="code" href="a02638.html#aec30b0c876cef5479c5db04aa8897358">flag</a>(<a class="code" href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0bea62efb985a62d85e014ee5ab039dd50ce">W_EOL</a>), <a class="code" href="a02634.html#abe4a0174938ec7e4d968382e8274c237">C_BLOB::deep_copy</a>(blob));</div><div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res = pr_it-><a class="code" href="a02546.html#ae4c91c0bdc362a0cebcbc644cf6ef2bf">InsertSimpleCloneWord</a>(*pr_it-><a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>(), word);</div><div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>  <span class="comment">// Get a new iterator that points to the new word.</span></div><div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> it(pr_it-><a class="code" href="a02546.html#aab221a373111c4be685444b5633e22a5">page_res</a>);</div><div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>  <span class="keywordflow">while</span> (it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != word_res && it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() != <span class="keyword">nullptr</span>) it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>();</div><div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>() == word_res);</div><div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>  <a class="code" href="a02354.html">WordData</a> wd(it);</div><div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>  <span class="comment">// Force full initialization.</span></div><div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>  <a class="code" href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">SetupWordPassN</a>(1, &wd);</div><div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>  <a class="code" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">classify_word_and_language</a>(pass_n, &it, &wd);</div><div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">debug_noise_removal</a>) {</div><div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>  <span class="keywordflow">if</span> (wd.word->raw_choice != NULL) {</div><div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"word xheight=%g, row=%g, range=[%g,%g]\n"</span>, word_res-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>,</div><div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>  wd.row->x_height(), wd.word->raw_choice->min_x_height(),</div><div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>  wd.word->raw_choice->max_x_height());</div><div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Got word with null raw choice xheight=%g, row=%g\n"</span>, word_res-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>,</div><div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>  wd.row->x_height());</div><div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>  }</div><div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>  }</div><div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>  <span class="keywordtype">float</span> cert = 0.0f;</div><div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>  <span class="keywordflow">if</span> (wd.word->raw_choice != NULL) { <span class="comment">// This probably shouldn't happen, but...</span></div><div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>  cert = wd.word->raw_choice->certainty();</div><div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>  <span class="keywordtype">float</span> rat = wd.word->raw_choice->rating();</div><div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>  *c2 = rat > 0.0f ? cert * cert / rat : 0.0f;</div><div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>  *best_str = wd.word->raw_choice->unichar_string();</div><div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>  *c2 = 0.0f;</div><div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>  *best_str = <span class="stringliteral">""</span>;</div><div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>  }</div><div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>  it.<a class="code" href="a02546.html#afb987bf467ef552c49b962bf6872ad34">DeleteCurrentWord</a>();</div><div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>  pr_it-><a class="code" href="a02546.html#a373f92e21392e8a929bb88f17d6b63e1">ResetWordIterator</a>();</div><div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>  <span class="keywordflow">return</span> cert;</div><div class="line"><a name="l01325"></a><span class="lineno"> 1325</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>  <span class="keywordflow">return</span> 0.1;</div><div class="line"><a name="l01327"></a><span class="lineno"> 1327</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01328"></a><span class="lineno"> 1328</span> }</div><div class="line"><a name="l01329"></a><span class="lineno"> 1329</span> </div><div class="line"><a name="l01330"></a><span class="lineno"> 1330</span> <span class="comment">// Generic function for classifying a word. Can be used either for pass1 or</span></div><div class="line"><a name="l01331"></a><span class="lineno"> 1331</span> <span class="comment">// pass2 according to the function passed to recognizer.</span></div><div class="line"><a name="l01332"></a><span class="lineno"> 1332</span> <span class="comment">// word_data holds the word to be recognized, and its block and row, and</span></div><div class="line"><a name="l01333"></a><span class="lineno"> 1333</span> <span class="comment">// pr_it points to the word as well, in case we are running LSTM and it wants</span></div><div class="line"><a name="l01334"></a><span class="lineno"> 1334</span> <span class="comment">// to output multiple words.</span></div><div class="line"><a name="l01335"></a><span class="lineno"> 1335</span> <span class="comment">// Recognizes in the current language, and if successful that is all.</span></div><div class="line"><a name="l01336"></a><span class="lineno"> 1336</span> <span class="comment">// If recognition was not successful, tries all available languages until</span></div><div class="line"><a name="l01337"></a><span class="lineno"> 1337</span> <span class="comment">// it gets a successful result or runs out of languages. Keeps the best result.</span></div><div class="line"><a name="l01338"></a><span class="lineno"><a class="line" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572"> 1338</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">Tesseract::classify_word_and_language</a>(<span class="keywordtype">int</span> pass_n, <a class="code" href="a02546.html">PAGE_RES_IT</a>* pr_it,</div><div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>  <a class="code" href="a02354.html">WordData</a>* word_data) {</div><div class="line"><a name="l01340"></a><span class="lineno"> 1340</span> <span class="preprocessor">#ifdef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>  <a class="code" href="a01629.html#ac50ad7dad904ed14e81cd29a3bfdb82d">WordRecognizer</a> recognizer = &<a class="code" href="a02358.html#a72e4cdd6e0cc37efe44413a4e1f495bd">Tesseract::classify_word_pass1</a>;</div><div class="line"><a name="l01342"></a><span class="lineno"> 1342</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>  <a class="code" href="a01629.html#ac50ad7dad904ed14e81cd29a3bfdb82d">WordRecognizer</a> recognizer = pass_n == 1 ? &<a class="code" href="a02358.html#a72e4cdd6e0cc37efe44413a4e1f495bd">Tesseract::classify_word_pass1</a></div><div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>  : &<a class="code" href="a02358.html#af87fe0ff76c1035ae599f8726641118f">Tesseract::classify_word_pass2</a>;</div><div class="line"><a name="l01345"></a><span class="lineno"> 1345</span> <span class="preprocessor">#endif // def DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01346"></a><span class="lineno"> 1346</span> </div><div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>  <span class="comment">// Best result so far.</span></div><div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>  <a class="code" href="a02730.html">PointerVector<WERD_RES></a> best_words;</div><div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>  <span class="comment">// Points to the best result. May be word or in lang_words.</span></div><div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>  <span class="keyword">const</span> <a class="code" href="a02542.html">WERD_RES</a>* word = word_data-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>;</div><div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>  clock_t start_t = clock();</div><div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>  <span class="keyword">const</span> <span class="keywordtype">bool</span> debug = <a class="code" href="a03998.html#a0f934f0b39cb869d2a4973269fb696cf">classify_debug_level</a> > 0 || <a class="code" href="a02358.html#ac2050c8b5f78b667d2a1eaa33777b420">multilang_debug_level</a> > 0;</div><div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>  <span class="keywordflow">if</span> (debug) {</div><div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%s word with lang %s at:"</span>,</div><div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>  word-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a> ? <span class="stringliteral">"Already done"</span> : <span class="stringliteral">"Processing"</span>,</div><div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>  most_recently_used_-><a class="code" href="a02666.html#ae453cbd7e4899ebfc5cc3831e5a8dd66">lang</a>.<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>  word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">bounding_box</a>().<a class="code" href="a02610.html#a61af64df548c7638bf005fcd8343c435">print</a>();</div><div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>  }</div><div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a>) {</div><div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>  <span class="comment">// If done on pass1, leave it as-is.</span></div><div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a>)</div><div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>  most_recently_used_ = word-><a class="code" href="a02542.html#a2e616f878c75833272f3f800827c2db6">tesseract</a>;</div><div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>  }</div><div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>  <span class="keywordtype">int</span> sub = sub_langs_.size();</div><div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>  <span class="keywordflow">if</span> (most_recently_used_ != <span class="keyword">this</span>) {</div><div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>  <span class="comment">// Get the index of the most_recently_used_.</span></div><div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>  <span class="keywordflow">for</span> (sub = 0; sub < sub_langs_.size() &&</div><div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>  most_recently_used_ != sub_langs_[sub]; ++sub) {}</div><div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>  }</div><div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>  most_recently_used_-><a class="code" href="a02358.html#a8952ab340e0f5e61992109e85cb1619c">RetryWithLanguage</a>(</div><div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>  *word_data, recognizer, debug, &word_data-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>[sub], &best_words);</div><div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>  <a class="code" href="a02358.html">Tesseract</a>* best_lang_tess = most_recently_used_;</div><div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>  <span class="keywordflow">if</span> (!WordsAcceptable(best_words)) {</div><div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>  <span class="comment">// Try all the other languages to see if they are any better.</span></div><div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>  <span class="keywordflow">if</span> (most_recently_used_ != <span class="keyword">this</span> &&</div><div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>  this-><a class="code" href="a02358.html#a8952ab340e0f5e61992109e85cb1619c">RetryWithLanguage</a>(*word_data, recognizer, debug,</div><div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>  &word_data-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>[sub_langs_.size()],</div><div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>  &best_words) > 0) {</div><div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>  best_lang_tess = <span class="keyword">this</span>;</div><div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>  }</div><div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; !WordsAcceptable(best_words) && i < sub_langs_.size();</div><div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>  ++i) {</div><div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>  <span class="keywordflow">if</span> (most_recently_used_ != sub_langs_[i] &&</div><div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>  sub_langs_[i]-><a class="code" href="a02358.html#a8952ab340e0f5e61992109e85cb1619c">RetryWithLanguage</a>(*word_data, recognizer, debug,</div><div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>  &word_data-><a class="code" href="a02354.html#abb1834fafca588a45c64bebcfad8e795">lang_words</a>[i],</div><div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>  &best_words) > 0) {</div><div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>  best_lang_tess = sub_langs_[i];</div><div class="line"><a name="l01389"></a><span class="lineno"> 1389</span>  }</div><div class="line"><a name="l01390"></a><span class="lineno"> 1390</span>  }</div><div class="line"><a name="l01391"></a><span class="lineno"> 1391</span>  }</div><div class="line"><a name="l01392"></a><span class="lineno"> 1392</span>  most_recently_used_ = best_lang_tess;</div><div class="line"><a name="l01393"></a><span class="lineno"> 1393</span>  <span class="keywordflow">if</span> (!best_words.<a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>()) {</div><div class="line"><a name="l01394"></a><span class="lineno"> 1394</span>  <span class="keywordflow">if</span> (best_words.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>() == 1 && !best_words[0]->combination) {</div><div class="line"><a name="l01395"></a><span class="lineno"> 1395</span>  <span class="comment">// Move the best single result to the main word.</span></div><div class="line"><a name="l01396"></a><span class="lineno"> 1396</span>  word_data-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a67c3636375afdd8b132a31c3aad526de">ConsumeWordResults</a>(best_words[0]);</div><div class="line"><a name="l01397"></a><span class="lineno"> 1397</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01398"></a><span class="lineno"> 1398</span>  <span class="comment">// Words came from LSTM, and must be moved to the PAGE_RES properly.</span></div><div class="line"><a name="l01399"></a><span class="lineno"> 1399</span>  word_data-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a> = best_words.<a class="code" href="a02182.html#a48b82547ebbaa5fedecfdebe7e2f155a">back</a>();</div><div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>  pr_it-><a class="code" href="a02546.html#a2a5d8667cbd59645f8d499485045380c">ReplaceCurrentWord</a>(&best_words);</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>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(word_data-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a3a92c8c9750d78631d75998f008f366a">box_word</a> != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"no best words!!\n"</span>);</div><div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>  }</div><div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>  clock_t ocr_t = clock();</div><div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#adae1d6ea4f51b3c71902855714d8c091">tessedit_timing_debug</a>) {</div><div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"%s (ocr took %.2f sec)\n"</span>,</div><div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>  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="l01410"></a><span class="lineno"> 1410</span>  <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(ocr_t-start_t)/CLOCKS_PER_SEC);</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> }</div><div class="line"><a name="l01413"></a><span class="lineno"> 1413</span> </div><div class="line"><a name="l01420"></a><span class="lineno"><a class="line" href="a02358.html#a72e4cdd6e0cc37efe44413a4e1f495bd"> 1420</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a72e4cdd6e0cc37efe44413a4e1f495bd">Tesseract::classify_word_pass1</a>(<span class="keyword">const</span> <a class="code" href="a02354.html">WordData</a>& word_data,</div><div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>  <a class="code" href="a02542.html">WERD_RES</a>** in_word,</div><div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>  <a class="code" href="a02730.html">PointerVector<WERD_RES></a>* out_words) {</div><div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>  <a class="code" href="a02526.html">ROW</a>* row = word_data.<a class="code" href="a02354.html#a09761e92902bb23f628aad4f1921e185">row</a>;</div><div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>  <a class="code" href="a02514.html">BLOCK</a>* block = word_data.<a class="code" href="a02354.html#ab19dcdca65fe4c60d68bfe94cbf3a241">block</a>;</div><div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>  <a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a> = word_data.<a class="code" href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">prev_word</a> != <span class="keyword">nullptr</span></div><div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>  ? word_data.<a class="code" href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">prev_word</a>-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a> : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01427"></a><span class="lineno"> 1427</span> <span class="preprocessor">#ifndef ANDROID_BUILD</span></div><div class="line"><a name="l01428"></a><span class="lineno"> 1428</span> <span class="preprocessor">#ifdef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a>) {</div><div class="line"><a name="l01430"></a><span class="lineno"> 1430</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a> ||</div><div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>  <a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead2a8d49560cbb1670cb06c547760b113">OEM_TESSERACT_LSTM_COMBINED</a>) {</div><div class="line"><a name="l01433"></a><span class="lineno"> 1433</span> <span class="preprocessor">#endif // def DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>  <span class="keywordflow">if</span> (!(*in_word)->odd_size || <a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a>) {</div><div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>  <a class="code" href="a02358.html#a0478ee100b826566b0b9ea048eee636e">LSTMRecognizeWord</a>(*block, row, *in_word, out_words);</div><div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>  <span class="keywordflow">if</span> (!out_words-><a class="code" href="a02182.html#a172c4aa23ba397e24319ae095281cbcc">empty</a>())</div><div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>  <span class="keywordflow">return</span>; <span class="comment">// Successful lstm recognition.</span></div><div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>  }</div><div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a>) {</div><div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>  <span class="comment">// No fallback allowed, so use a fake.</span></div><div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>  (*in_word)->SetupFake(lstm_recognizer_-><a class="code" href="a04386.html#a6b94d49e9e4aab418bb7866b2691f30b">GetUnicharset</a>());</div><div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>  }</div><div class="line"><a name="l01444"></a><span class="lineno"> 1444</span> </div><div class="line"><a name="l01445"></a><span class="lineno"> 1445</span> <span class="preprocessor"> #ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>  <span class="comment">// Fall back to tesseract for failed words or odd words.</span></div><div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>  (*in_word)->SetupForRecognition(<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>, <span class="keyword">this</span>, <a class="code" href="a02358.html#aec5d4e081fee6da40258b0b074342205">BestPix</a>(),</div><div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>  <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aeaea8028f61e76a0f4def7cbe7905206cf">OEM_TESSERACT_ONLY</a>, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>  <a class="code" href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">classify_bln_numeric_mode</a>,</div><div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>  <a class="code" href="a02358.html#a5873c7054e8cba3e64fc3f20b2a93ca3">textord_use_cjk_fp_model</a>,</div><div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>  <a class="code" href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">poly_allow_detailed_fx</a>, row, block);</div><div class="line"><a name="l01452"></a><span class="lineno"> 1452</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>  }</div><div class="line"><a name="l01454"></a><span class="lineno"> 1454</span> <span class="preprocessor">#endif // ndef ANDROID_BUILD</span></div><div class="line"><a name="l01455"></a><span class="lineno"> 1455</span> </div><div class="line"><a name="l01456"></a><span class="lineno"> 1456</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>  <a class="code" href="a02542.html">WERD_RES</a>* word = *in_word;</div><div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>  <a class="code" href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578">match_word_pass_n</a>(1, word, row, block);</div><div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a> && !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#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>  word-><a class="code" href="a02542.html#a157b8504ddf7ff46910697a59c219bde">tess_would_adapt</a> = <a class="code" href="a03998.html#a0d252009d9ff3f6997c27b533ea52550">AdaptableWord</a>(word);</div><div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>  <span class="keywordtype">bool</span> adapt_ok = <a class="code" href="a02358.html#ad60055acf007ba8d471935ee5ec50543">word_adaptable</a>(word, <a class="code" href="a02358.html#a0bf402e18a4253490a46b6a37bf3d67d">tessedit_tess_adaption_mode</a>);</div><div class="line"><a name="l01462"></a><span class="lineno"> 1462</span> </div><div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>  <span class="keywordflow">if</span> (adapt_ok) {</div><div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>  <span class="comment">// Send word to adaptive classifier for training.</span></div><div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>  word-><a class="code" href="a02542.html#a8d4f5c6ed2c60b756a5c63e091cd331c">BestChoiceToCorrectText</a>();</div><div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>  <a class="code" href="a03998.html#a2fc1971dc1e42946245c98a9312326ae">LearnWord</a>(<span class="keyword">nullptr</span>, word);</div><div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>  <span class="comment">// Mark misadaptions if running blamer.</span></div><div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>  word-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>-><a class="code" href="a02370.html#a8cd8f387ec0049639db990b4ceae5c89">SetMisAdaptionDebug</a>(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>,</div><div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>  <a class="code" href="a04866.html#a76e95cb7cbfe636ab00ec46150b5524d">wordrec_debug_blamer</a>);</div><div class="line"><a name="l01471"></a><span class="lineno"> 1471</span>  }</div><div class="line"><a name="l01472"></a><span class="lineno"> 1472</span>  }</div><div class="line"><a name="l01473"></a><span class="lineno"> 1473</span> </div><div class="line"><a name="l01474"></a><span class="lineno"> 1474</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a8c1e482784c433ed2d49d2da708a3d29">tessedit_enable_doc_dict</a> && !word-><a class="code" href="a02542.html#a5fba3dcf00c81b9032ef9a0cad32b3ec">IsAmbiguous</a>())</div><div class="line"><a name="l01475"></a><span class="lineno"> 1475</span>  <a class="code" href="a02358.html#aa045a47d72bff5e7b987046483a3165f">tess_add_doc_word</a>(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>);</div><div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>  }</div><div class="line"><a name="l01477"></a><span class="lineno"> 1477</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01478"></a><span class="lineno"> 1478</span> }</div><div class="line"><a name="l01479"></a><span class="lineno"> 1479</span> </div><div class="line"><a name="l01480"></a><span class="lineno"> 1480</span> <span class="comment">// Helper to report the result of the xheight fix.</span></div><div class="line"><a name="l01481"></a><span class="lineno"><a class="line" href="a02358.html#afefbce16d3525d8790755bb9070ecf0b"> 1481</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#afefbce16d3525d8790755bb9070ecf0b">Tesseract::ReportXhtFixResult</a>(<span class="keywordtype">bool</span> accept_new_word, <span class="keywordtype">float</span> new_x_ht,</div><div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>  <a class="code" href="a02542.html">WERD_RES</a>* word, <a class="code" href="a02542.html">WERD_RES</a>* new_word) {</div><div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"New XHT Match:%s = %s "</span>,</div><div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>  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="l01485"></a><span class="lineno"> 1485</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">debug_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>  word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#a124889539460b8c200b3186da4a692e0">print</a>(<a class="code" href="a00194.html#adff672a9cdb59d57a0d142954a6a3899">debug_fp</a>);</div><div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" -> %s = %s "</span>,</div><div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>  new_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="l01489"></a><span class="lineno"> 1489</span>  new_word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">debug_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>  new_word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#a124889539460b8c200b3186da4a692e0">print</a>(<a class="code" href="a00194.html#adff672a9cdb59d57a0d142954a6a3899">debug_fp</a>);</div><div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" %s->%s %s %s\n"</span>,</div><div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>  word-><a class="code" href="a02542.html#a2353b9e482531332773c28b996f8b1b7">guessed_x_ht</a> ? <span class="stringliteral">"GUESS"</span> : <span class="stringliteral">"CERT"</span>,</div><div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>  new_word-><a class="code" href="a02542.html#a2353b9e482531332773c28b996f8b1b7">guessed_x_ht</a> ? <span class="stringliteral">"GUESS"</span> : <span class="stringliteral">"CERT"</span>,</div><div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>  new_x_ht > 0.1 ? <span class="stringliteral">"STILL DOUBT"</span> : <span class="stringliteral">"OK"</span>,</div><div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>  accept_new_word ? <span class="stringliteral">"ACCEPTED"</span> : <span class="stringliteral">""</span>);</div><div class="line"><a name="l01496"></a><span class="lineno"> 1496</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="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01499"></a><span class="lineno"> 1499</span> </div><div class="line"><a name="l01500"></a><span class="lineno"> 1500</span> <span class="comment">// Run the x-height fix-up, based on min/max top/bottom information in</span></div><div class="line"><a name="l01501"></a><span class="lineno"> 1501</span> <span class="comment">// unicharset.</span></div><div class="line"><a name="l01502"></a><span class="lineno"> 1502</span> <span class="comment">// Returns true if the word was changed.</span></div><div class="line"><a name="l01503"></a><span class="lineno"> 1503</span> <span class="comment">// See the comment in fixxht.cpp for a description of the overall process.</span></div><div class="line"><a name="l01504"></a><span class="lineno"><a class="line" href="a02358.html#ad14592439397161692776a9068dffe43"> 1504</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#ad14592439397161692776a9068dffe43">Tesseract::TrainedXheightFix</a>(<a class="code" href="a02542.html">WERD_RES</a> *word, <a class="code" href="a02514.html">BLOCK</a>* block, <a class="code" href="a02526.html">ROW</a> *row) {</div><div class="line"><a name="l01505"></a><span class="lineno"> 1505</span>  <span class="keywordtype">int</span> original_misfits = <a class="code" href="a02358.html#acf64fde8187041f90359fb507242bbb0">CountMisfitTops</a>(word);</div><div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>  <span class="keywordflow">if</span> (original_misfits == 0)</div><div class="line"><a name="l01507"></a><span class="lineno"> 1507</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>  <span class="keywordtype">float</span> baseline_shift = 0.0f;</div><div class="line"><a name="l01509"></a><span class="lineno"> 1509</span>  <span class="keywordtype">float</span> new_x_ht = <a class="code" href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc">ComputeCompatibleXheight</a>(word, &baseline_shift);</div><div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>  <span class="keywordflow">if</span> (baseline_shift != 0.0f) {</div><div class="line"><a name="l01511"></a><span class="lineno"> 1511</span>  <span class="comment">// Try the shift on its own first.</span></div><div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#a691620dfdff9adbe43d2631589c91eaf">TestNewNormalization</a>(original_misfits, baseline_shift, word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>,</div><div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>  word, block, row))</div><div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>  original_misfits = <a class="code" href="a02358.html#acf64fde8187041f90359fb507242bbb0">CountMisfitTops</a>(word);</div><div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>  <span class="keywordflow">if</span> (original_misfits > 0) {</div><div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>  <span class="keywordtype">float</span> new_baseline_shift;</div><div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>  <span class="comment">// Now recompute the new x_height.</span></div><div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>  new_x_ht = <a class="code" href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc">ComputeCompatibleXheight</a>(word, &new_baseline_shift);</div><div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>  <span class="keywordflow">if</span> (new_x_ht >= <a class="code" href="a00071.html#a91ae9908e7c8f49bf292bbdd6678230e">kMinRefitXHeightFraction</a> * word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>) {</div><div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>  <span class="comment">// No test of return value here, as we are definitely making a change</span></div><div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>  <span class="comment">// to the word by shifting the baseline.</span></div><div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>  <a class="code" href="a02358.html#a691620dfdff9adbe43d2631589c91eaf">TestNewNormalization</a>(original_misfits, baseline_shift, new_x_ht,</div><div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>  word, block, row);</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>  }</div><div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (new_x_ht >= <a class="code" href="a00071.html#a91ae9908e7c8f49bf292bbdd6678230e">kMinRefitXHeightFraction</a> * word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>) {</div><div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>  <span class="keywordflow">return</span> <a class="code" href="a02358.html#a691620dfdff9adbe43d2631589c91eaf">TestNewNormalization</a>(original_misfits, 0.0f, new_x_ht,</div><div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>  word, block, row);</div><div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>  }</div><div class="line"><a name="l01534"></a><span class="lineno"> 1534</span> }</div><div class="line"><a name="l01535"></a><span class="lineno"> 1535</span> </div><div class="line"><a name="l01536"></a><span class="lineno"> 1536</span> <span class="comment">// Runs recognition with the test baseline shift and x-height and returns true</span></div><div class="line"><a name="l01537"></a><span class="lineno"> 1537</span> <span class="comment">// if there was an improvement in recognition result.</span></div><div class="line"><a name="l01538"></a><span class="lineno"><a class="line" href="a02358.html#a691620dfdff9adbe43d2631589c91eaf"> 1538</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#a691620dfdff9adbe43d2631589c91eaf">Tesseract::TestNewNormalization</a>(<span class="keywordtype">int</span> original_misfits,</div><div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>  <span class="keywordtype">float</span> baseline_shift, <span class="keywordtype">float</span> new_x_ht,</div><div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>  <a class="code" href="a02542.html">WERD_RES</a> *word, <a class="code" href="a02514.html">BLOCK</a>* block, <a class="code" href="a02526.html">ROW</a> *row) {</div><div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>  <span class="keywordtype">bool</span> accept_new_x_ht = <span class="keyword">false</span>;</div><div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>  <a class="code" href="a02542.html">WERD_RES</a> new_x_ht_word(word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>);</div><div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>  new_x_ht_word.<a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a> = <span class="keyword">new</span> <a class="code" href="a02370.html">BlamerBundle</a>();</div><div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>  new_x_ht_word.<a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>-><a class="code" href="a02370.html#aa9c239d91fa6c86b5f597addbed06ce1">CopyTruth</a>(*(word-><a class="code" href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">blamer_bundle</a>));</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>  new_x_ht_word.<a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> = new_x_ht;</div><div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>  new_x_ht_word.<a class="code" href="a02542.html#afd3a82dce3b9d8af86fe10a2eb117ce1">baseline_shift</a> = baseline_shift;</div><div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>  new_x_ht_word.<a class="code" href="a02542.html#aea384afb374c13829bfaab3efa5eafa0">caps_height</a> = 0.0;</div><div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>  new_x_ht_word.<a class="code" href="a02542.html#adac960c00c2ae389886c91af9882ae00">SetupForRecognition</a>(</div><div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>  <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>, <span class="keyword">this</span>, <a class="code" href="a02358.html#aec5d4e081fee6da40258b0b074342205">BestPix</a>(), <a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a>, <span class="keyword">nullptr</span>,</div><div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>  <a class="code" href="a03998.html#a57e449d38b255fe82e61d88ded8b0020">classify_bln_numeric_mode</a>, <a class="code" href="a02358.html#a5873c7054e8cba3e64fc3f20b2a93ca3">textord_use_cjk_fp_model</a>,</div><div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>  <a class="code" href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">poly_allow_detailed_fx</a>, row, block);</div><div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>  <a class="code" href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578">match_word_pass_n</a>(2, &new_x_ht_word, row, block);</div><div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>  <span class="keywordflow">if</span> (!new_x_ht_word.<a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a>) {</div><div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>  <span class="keywordtype">int</span> new_misfits = <a class="code" href="a02358.html#acf64fde8187041f90359fb507242bbb0">CountMisfitTops</a>(&new_x_ht_word);</div><div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 1) {</div><div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Old misfits=%d with x-height %f, new=%d with x-height %f\n"</span>,</div><div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>  original_misfits, word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a>,</div><div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>  new_misfits, new_x_ht);</div><div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Old rating= %f, certainty=%f, new=%f, %f\n"</span>,</div><div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#afa672748d2585eea64ab79592dd02eb3">rating</a>(), word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>(),</div><div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>  new_x_ht_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="l01564"></a><span class="lineno"> 1564</span>  new_x_ht_word.<a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>());</div><div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>  }</div><div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>  <span class="comment">// The misfits must improve and either the rating or certainty.</span></div><div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>  accept_new_x_ht = new_misfits < original_misfits &&</div><div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>  (new_x_ht_word.<a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>() ></div><div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#acea3ee4af3377da8f4c10627e4ba42cf">certainty</a>() ||</div><div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>  new_x_ht_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="l01571"></a><span class="lineno"> 1571</span>  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="l01572"></a><span class="lineno"> 1572</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a> >= 1) {</div><div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>  <a class="code" href="a02358.html#afefbce16d3525d8790755bb9070ecf0b">ReportXhtFixResult</a>(accept_new_x_ht, new_x_ht, word, &new_x_ht_word);</div><div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>  }</div><div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>  }</div><div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>  <span class="keywordflow">if</span> (accept_new_x_ht) {</div><div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>  word-><a class="code" href="a02542.html#a67c3636375afdd8b132a31c3aad526de">ConsumeWordResults</a>(&new_x_ht_word);</div><div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>  }</div><div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01581"></a><span class="lineno"> 1581</span> }</div><div class="line"><a name="l01582"></a><span class="lineno"> 1582</span> </div><div class="line"><a name="l01583"></a><span class="lineno"> 1583</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01584"></a><span class="lineno"> 1584</span> </div><div class="line"><a name="l01591"></a><span class="lineno"><a class="line" href="a02358.html#af87fe0ff76c1035ae599f8726641118f"> 1591</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#af87fe0ff76c1035ae599f8726641118f">Tesseract::classify_word_pass2</a>(<span class="keyword">const</span> <a class="code" href="a02354.html">WordData</a>& word_data,</div><div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>  <a class="code" href="a02542.html">WERD_RES</a>** in_word,</div><div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>  <a class="code" href="a02730.html">PointerVector<WERD_RES></a>* out_words) {</div><div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>  <span class="comment">// Return if we do not want to run Tesseract.</span></div><div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tessedit_ocr_engine_mode</a> == <a class="code" href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">OEM_LSTM_ONLY</a>) {</div><div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>  }</div><div class="line"><a name="l01598"></a><span class="lineno"> 1598</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>  <a class="code" href="a02526.html">ROW</a>* row = word_data.<a class="code" href="a02354.html#a09761e92902bb23f628aad4f1921e185">row</a>;</div><div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>  <a class="code" href="a02514.html">BLOCK</a>* block = word_data.<a class="code" href="a02354.html#ab19dcdca65fe4c60d68bfe94cbf3a241">block</a>;</div><div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>  <a class="code" href="a02542.html">WERD_RES</a>* word = *in_word;</div><div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>  <a class="code" href="a04866.html#a143608f482c6c0c4f312740e6a5f5fd9">prev_word_best_choice_</a> = word_data.<a class="code" href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">prev_word</a> != <span class="keyword">nullptr</span></div><div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>  ? word_data.<a class="code" href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">prev_word</a>-><a class="code" href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">word</a>-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a> : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01604"></a><span class="lineno"> 1604</span> </div><div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>  <a class="code" href="a00503.html#a87d586caeb936d763514af2bbba8cab6">set_global_subloc_code</a>(<a class="code" href="a00503.html#a2547c1ff4f32e0726fd745c388e50aa0">SUBLOC_NORM</a>);</div><div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 30);</div><div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a>) {</div><div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>  word-><a class="code" href="a02542.html#aea384afb374c13829bfaab3efa5eafa0">caps_height</a> = 0.0;</div><div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> == 0.0f)</div><div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>  word-><a class="code" href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">x_height</a> = row-><a class="code" href="a02526.html#aced2e98c94f532c5c5809d63aef4b9de">x_height</a>();</div><div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>  <a class="code" href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578">match_word_pass_n</a>(2, word, row, block);</div><div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 40);</div><div class="line"><a name="l01613"></a><span class="lineno"> 1613</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>  <a class="code" href="a02358.html#a823125104b6a53995352959ba68eda74">SubAndSuperscriptFix</a>(word);</div><div class="line"><a name="l01616"></a><span class="lineno"> 1616</span> </div><div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a> && !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#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>  <span class="keywordflow">if</span> (<a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#a543cc7f8a76417b75d52fbba623be5fc">top_bottom_useful</a>() && <a class="code" href="a02666.html#a69c5179ac5f10a24f3f97e16ca09460f">unicharset</a>.<a class="code" href="a03950.html#aecb5fe27d6bc4bac136abf86c12dac7d">script_has_xheight</a>() &&</div><div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>  block-><a class="code" href="a02514.html#aa41ae9661d53570dd6365d3ac8ac4c15">classify_rotation</a>().<a class="code" href="a02578.html#abb9516f874133b689b0e62ac70874385">y</a>() == 0.0f) {</div><div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>  <span class="comment">// Use the tops and bottoms since they are available.</span></div><div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>  <a class="code" href="a02358.html#ad14592439397161692776a9068dffe43">TrainedXheightFix</a>(word, block, row);</div><div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>  }</div><div class="line"><a name="l01623"></a><span class="lineno"> 1623</span> </div><div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>  <a class="code" href="a00503.html#a87d586caeb936d763514af2bbba8cab6">set_global_subloc_code</a>(<a class="code" href="a00503.html#a2547c1ff4f32e0726fd745c388e50aa0">SUBLOC_NORM</a>);</div><div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>  }</div><div class="line"><a name="l01626"></a><span class="lineno"> 1626</span> <span class="preprocessor">#ifndef GRAPHICS_DISABLED</span></div><div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a25ed767b346d06161940bd2288d137b9">tessedit_display_outwords</a>) {</div><div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>  <span class="keywordflow">if</span> (<a class="code" href="a01541.html#af3d3389751226a339de88b46cfc58f66">fx_win</a> == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>  <a class="code" href="a01541.html#ae31e31904810bc4e3407c2f324cf7edb">create_fx_win</a>();</div><div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>  <a class="code" href="a01541.html#aa3294a99fe8ad4b74a1e8577b89e3eff">clear_fx_win</a>();</div><div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>  word-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#afe89f2f31b48fa578028f2527b55e144">plot</a>(<a class="code" href="a01541.html#af3d3389751226a339de88b46cfc58f66">fx_win</a>);</div><div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>  <a class="code" href="a02610.html">TBOX</a> wbox = word-><a class="code" href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">rebuild_word</a>-><a class="code" href="a02402.html#abce755a2629864688cb259a780b01d24">bounding_box</a>();</div><div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>  <a class="code" href="a01541.html#af3d3389751226a339de88b46cfc58f66">fx_win</a>-><a class="code" href="a04778.html#a5a6c86ea0a618cf7642a8228fd7faab9">ZoomToRectangle</a>(wbox.<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>(), wbox.<a class="code" href="a02610.html#a5dc64d0677b5d65385bc07a78cf49c4d">top</a>(),</div><div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>  wbox.<a class="code" href="a02610.html#af74fa3bf628c9426cd6f1141a87dc2e0">right</a>(), wbox.<a class="code" href="a02610.html#a9fee4521e71300975cb34ebb21e3fca5">bottom</a>());</div><div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>  <a class="code" href="a04778.html#a0830a51981a20c8700b5ec49137e46e9">ScrollView::Update</a>();</div><div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>  }</div><div class="line"><a name="l01637"></a><span class="lineno"> 1637</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>  <a class="code" href="a00503.html#a87d586caeb936d763514af2bbba8cab6">set_global_subloc_code</a>(<a class="code" href="a00503.html#a2547c1ff4f32e0726fd745c388e50aa0">SUBLOC_NORM</a>);</div><div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>  <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">check_debug_pt</a>(word, 50);</div><div class="line"><a name="l01640"></a><span class="lineno"> 1640</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01641"></a><span class="lineno"> 1641</span> }</div><div class="line"><a name="l01642"></a><span class="lineno"> 1642</span> </div><div class="line"><a name="l01643"></a><span class="lineno"> 1643</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01644"></a><span class="lineno"> 1644</span> </div><div class="line"><a name="l01649"></a><span class="lineno"><a class="line" href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578"> 1649</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578">Tesseract::match_word_pass_n</a>(<span class="keywordtype">int</span> pass_n, <a class="code" href="a02542.html">WERD_RES</a> *word,</div><div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>  <a class="code" href="a02526.html">ROW</a> *row, <a class="code" href="a02514.html">BLOCK</a>* block) {</div><div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>  <a class="code" href="a02358.html#a3b191f48cb43dc1796b039650f7de09a">tess_segment_pass_n</a>(pass_n, word);</div><div class="line"><a name="l01653"></a><span class="lineno"> 1653</span> </div><div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>  <span class="keywordflow">if</span> (!word-><a class="code" href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">tess_failed</a>) {</div><div class="line"><a name="l01655"></a><span class="lineno"> 1655</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#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a>)) {</div><div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>  word-><a class="code" href="a02542.html#ad6811048a1a3a210905ec907233defd1">fix_quotes</a>();</div><div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ae48c51204ebe816f206908a0cae64924">tessedit_fix_hyphens</a>)</div><div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>  word-><a class="code" href="a02542.html#abb8291b971b0fbb6b51c8d7de7074a6f">fix_hyphens</a>();</div><div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>  <span class="comment">/* Don't trust fix_quotes! - though I think I've fixed the bug */</span></div><div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>() != word-><a class="code" href="a02542.html#a3a92c8c9750d78631d75998f008f366a">box_word</a>-><a class="code" href="a02410.html#a2505cb916ecbd87e4ba1a44654b1e078">length</a>()) {</div><div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"POST FIX_QUOTES FAIL String:\"%s\"; Strlen=%d;"</span></div><div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>  <span class="stringliteral">" #Blobs=%d\n"</span>,</div><div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">debug_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(),</div><div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(),</div><div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>  word-><a class="code" href="a02542.html#a3a92c8c9750d78631d75998f008f366a">box_word</a>-><a class="code" href="a02410.html#a2505cb916ecbd87e4ba1a44654b1e078">length</a>());</div><div class="line"><a name="l01666"></a><span class="lineno"> 1666</span> </div><div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>  }</div><div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>  word-><a class="code" href="a02542.html#aa7f56655eb0e5164f2d2e85906475cb1">tess_accepted</a> = <a class="code" href="a02358.html#ae333d858e257bbd5ac32eeb4aff2b19e">tess_acceptable_word</a>(word);</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>  <span class="comment">// Also sets word->done flag</span></div><div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>  <a class="code" href="a02358.html#af9405001d9b64c8716e6cdc01eb448f0">make_reject_map</a>(word, row, pass_n);</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>  <a class="code" href="a02358.html#ad78f0499b8efaaa828b181fe318c72fb">set_word_fonts</a>(word);</div><div class="line"><a name="l01675"></a><span class="lineno"> 1675</span> </div><div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(word-><a class="code" href="a02542.html#ab4d02a7548dab0a4522f02ed90e48100">raw_choice</a> != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01677"></a><span class="lineno"> 1677</span> }</div><div class="line"><a name="l01678"></a><span class="lineno"> 1678</span> <span class="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01679"></a><span class="lineno"> 1679</span> </div><div class="line"><a name="l01680"></a><span class="lineno"> 1680</span> <span class="comment">// Helper to return the best rated BLOB_CHOICE in the whole word that matches</span></div><div class="line"><a name="l01681"></a><span class="lineno"> 1681</span> <span class="comment">// the given char_id, or nullptr if none can be found.</span></div><div class="line"><a name="l01682"></a><span class="lineno"> 1682</span> <span class="keyword">static</span> <a class="code" href="a02602.html">BLOB_CHOICE</a>* FindBestMatchingChoice(<a class="code" href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a> char_id,</div><div class="line"><a name="l01683"></a><span class="lineno"> 1683</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res) {</div><div class="line"><a name="l01684"></a><span class="lineno"> 1684</span>  <span class="comment">// Find the corresponding best BLOB_CHOICE from any position in the word_res.</span></div><div class="line"><a name="l01685"></a><span class="lineno"> 1685</span>  <a class="code" href="a02602.html">BLOB_CHOICE</a>* best_choice = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l01686"></a><span class="lineno"> 1686</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++i) {</div><div class="line"><a name="l01687"></a><span class="lineno"> 1687</span>  <a class="code" href="a02602.html">BLOB_CHOICE</a>* choice = <a class="code" href="a00398.html#ae7d10d7f2ebc33a80d4c2ec84996e121">FindMatchingChoice</a>(char_id,</div><div class="line"><a name="l01688"></a><span class="lineno"> 1688</span>  word_res-><a class="code" href="a02542.html#aaf98a52c29b1e11319d28b9698ac13fb">GetBlobChoices</a>(i));</div><div class="line"><a name="l01689"></a><span class="lineno"> 1689</span>  <span class="keywordflow">if</span> (choice != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01690"></a><span class="lineno"> 1690</span>  <span class="keywordflow">if</span> (best_choice == <span class="keyword">nullptr</span> || choice-><a class="code" href="a02602.html#ab90b9f9f303420fee80622acd9d268f2">rating</a>() < best_choice-><a class="code" href="a02602.html#ab90b9f9f303420fee80622acd9d268f2">rating</a>())</div><div class="line"><a name="l01691"></a><span class="lineno"> 1691</span>  best_choice = choice;</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>  <span class="keywordflow">return</span> best_choice;</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> </div><div class="line"><a name="l01697"></a><span class="lineno"> 1697</span> <span class="comment">// Helper to insert blob_choice in each location in the leader word if there is</span></div><div class="line"><a name="l01698"></a><span class="lineno"> 1698</span> <span class="comment">// no matching BLOB_CHOICE there already, and correct any incorrect results</span></div><div class="line"><a name="l01699"></a><span class="lineno"> 1699</span> <span class="comment">// in the best_choice.</span></div><div class="line"><a name="l01700"></a><span class="lineno"> 1700</span> <span class="keyword">static</span> <span class="keywordtype">void</span> CorrectRepcharChoices(<a class="code" href="a02602.html">BLOB_CHOICE</a>* blob_choice,</div><div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>  <a class="code" href="a02542.html">WERD_RES</a>* word_res) {</div><div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>  <a class="code" href="a02606.html">WERD_CHOICE</a>* word = word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>;</div><div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++i) {</div><div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>  <a class="code" href="a02602.html">BLOB_CHOICE</a>* choice = <a class="code" href="a00398.html#ae7d10d7f2ebc33a80d4c2ec84996e121">FindMatchingChoice</a>(blob_choice-><a class="code" href="a02602.html#ad448095b666bfb864211714ec2c2375e">unichar_id</a>(),</div><div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>  word_res-><a class="code" href="a02542.html#aaf98a52c29b1e11319d28b9698ac13fb">GetBlobChoices</a>(i));</div><div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>  <span class="keywordflow">if</span> (choice == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>  BLOB_CHOICE_IT choice_it(word_res-><a class="code" href="a02542.html#aaf98a52c29b1e11319d28b9698ac13fb">GetBlobChoices</a>(i));</div><div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>  choice_it.add_before_stay_put(<span class="keyword">new</span> <a class="code" href="a02602.html">BLOB_CHOICE</a>(*blob_choice));</div><div class="line"><a name="l01709"></a><span class="lineno"> 1709</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="comment">// Correct any incorrect results in word.</span></div><div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++i) {</div><div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(i) != blob_choice-><a class="code" href="a02602.html#ad448095b666bfb864211714ec2c2375e">unichar_id</a>())</div><div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>  word-><a class="code" href="a02606.html#a8238d436806c40b2e01b9659dfab5eb3">set_unichar_id</a>(blob_choice-><a class="code" href="a02602.html#ad448095b666bfb864211714ec2c2375e">unichar_id</a>(), i);</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> }</div><div class="line"><a name="l01717"></a><span class="lineno"> 1717</span> </div><div class="line"><a name="l01725"></a><span class="lineno"><a class="line" href="a02358.html#a2583789c60aec43911ef1b2cf01b9d45"> 1725</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a2583789c60aec43911ef1b2cf01b9d45">Tesseract::fix_rep_char</a>(<a class="code" href="a02546.html">PAGE_RES_IT</a>* page_res_it) {</div><div class="line"><a name="l01726"></a><span class="lineno"> 1726</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="l01727"></a><span class="lineno"> 1727</span>  <span class="keyword">const</span> <a class="code" href="a02606.html">WERD_CHOICE</a> &word = *(word_res-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>);</div><div class="line"><a name="l01728"></a><span class="lineno"> 1728</span> </div><div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>  <span class="comment">// Find the frequency of each unique character in the word.</span></div><div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>  <a class="code" href="a02826.html">SortHelper<UNICHAR_ID></a> rep_ch(word.<a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>());</div><div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < word.<a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++i) {</div><div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>  rep_ch.<a class="code" href="a02826.html#a2844aee5a8b3f6f90835033fd2a049d0">Add</a>(word.<a class="code" href="a02606.html#a76b18095a88a05db299aa84451a5f52c">unichar_id</a>(i), 1);</div><div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>  }</div><div class="line"><a name="l01734"></a><span class="lineno"> 1734</span> </div><div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>  <span class="comment">// Find the most frequent result.</span></div><div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>  <a class="code" href="a00605.html#afedceee7ea132dae3d224db2cf8b5618">UNICHAR_ID</a> maxch_id = INVALID_UNICHAR_ID; <span class="comment">// most common char</span></div><div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>  <span class="keywordtype">int</span> max_count = rep_ch.MaxCount(&maxch_id);</div><div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>  <span class="comment">// Find the best exemplar of a classifier result for maxch_id.</span></div><div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>  <a class="code" href="a02602.html">BLOB_CHOICE</a>* best_choice = FindBestMatchingChoice(maxch_id, word_res);</div><div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>  <span class="keywordflow">if</span> (best_choice == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Failed to find a choice for %s, occurring %d times\n"</span>,</div><div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>  word_res-><a class="code" href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">uch_set</a>-><a class="code" href="a03950.html#ac1148cef18a324b1c1eeffaf354ab80f">debug_str</a>(maxch_id).<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>(), max_count);</div><div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>  }</div><div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>  word_res-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a> = <a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>;</div><div class="line"><a name="l01746"></a><span class="lineno"> 1746</span> </div><div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>  <span class="comment">// Measure the mean space.</span></div><div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>  <span class="keywordtype">int</span> gap_count = 0;</div><div class="line"><a name="l01749"></a><span class="lineno"> 1749</span>  <a class="code" href="a02638.html">WERD</a>* werd = word_res-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>;</div><div class="line"><a name="l01750"></a><span class="lineno"> 1750</span>  C_BLOB_IT blob_it(werd-><a class="code" href="a02638.html#a174baefaa99afbfdbf444e4199f3b529">cblob_list</a>());</div><div class="line"><a name="l01751"></a><span class="lineno"> 1751</span>  <a class="code" href="a02634.html">C_BLOB</a>* prev_blob = blob_it.data();</div><div class="line"><a name="l01752"></a><span class="lineno"> 1752</span>  <span class="keywordflow">for</span> (blob_it.forward(); !blob_it.at_first(); blob_it.forward()) {</div><div class="line"><a name="l01753"></a><span class="lineno"> 1753</span>  <a class="code" href="a02634.html">C_BLOB</a>* blob = blob_it.data();</div><div class="line"><a name="l01754"></a><span class="lineno"> 1754</span>  <span class="keywordtype">int</span> gap = blob-><a class="code" href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">bounding_box</a>().<a class="code" href="a02610.html#a8e9dce0d30d2213598cd4befe0028c99">left</a>();</div><div class="line"><a name="l01755"></a><span class="lineno"> 1755</span>  gap -= prev_blob->bounding_box().right();</div><div class="line"><a name="l01756"></a><span class="lineno"> 1756</span>  ++gap_count;</div><div class="line"><a name="l01757"></a><span class="lineno"> 1757</span>  prev_blob = blob;</div><div class="line"><a name="l01758"></a><span class="lineno"> 1758</span>  }</div><div class="line"><a name="l01759"></a><span class="lineno"> 1759</span>  <span class="comment">// Just correct existing classification.</span></div><div class="line"><a name="l01760"></a><span class="lineno"> 1760</span>  CorrectRepcharChoices(best_choice, word_res);</div><div class="line"><a name="l01761"></a><span class="lineno"> 1761</span>  word_res-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#a798c11e002b9421b26a748f5186bdae9">initialise</a>(word.<a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>());</div><div class="line"><a name="l01762"></a><span class="lineno"> 1762</span> }</div><div class="line"><a name="l01763"></a><span class="lineno"> 1763</span> </div><div class="line"><a name="l01764"></a><span class="lineno"><a class="line" href="a02358.html#a51f2ad8b2d849d90bbcfbfca3067c0f1"> 1764</a></span> <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eee">ACCEPTABLE_WERD_TYPE</a> <a class="code" href="a02358.html#a51f2ad8b2d849d90bbcfbfca3067c0f1">Tesseract::acceptable_word_string</a>(</div><div class="line"><a name="l01765"></a><span class="lineno"> 1765</span>  <span class="keyword">const</span> <a class="code" href="a03950.html">UNICHARSET</a>& char_set, <span class="keyword">const</span> <span class="keywordtype">char</span> *s, <span class="keyword">const</span> <span class="keywordtype">char</span> *lengths) {</div><div class="line"><a name="l01766"></a><span class="lineno"> 1766</span>  <span class="keywordtype">int</span> i = 0;</div><div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>  <span class="keywordtype">int</span> offset = 0;</div><div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>  <span class="keywordtype">int</span> leading_punct_count;</div><div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>  <span class="keywordtype">int</span> upper_count = 0;</div><div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>  <span class="keywordtype">int</span> hyphen_pos = -1;</div><div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>  <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eee">ACCEPTABLE_WERD_TYPE</a> word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0">AC_UNACCEPTABLE</a>;</div><div class="line"><a name="l01772"></a><span class="lineno"> 1772</span> </div><div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>  <span class="keywordflow">if</span> (strlen (lengths) > 20)</div><div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>  <span class="keywordflow">return</span> word_type;</div><div class="line"><a name="l01775"></a><span class="lineno"> 1775</span> </div><div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>  <span class="comment">/* Single Leading punctuation char*/</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="keywordflow">if</span> (s[offset] != <span class="charliteral">'\0'</span> && <a class="code" href="a02834.html">STRING</a>(<a class="code" href="a02358.html#a8ecdf25c9fe0f5c122081a3956a96720">chs_leading_punct</a>).contains(s[offset]))</div><div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>  offset += lengths[i++];</div><div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>  leading_punct_count = i;</div><div class="line"><a name="l01781"></a><span class="lineno"> 1781</span> </div><div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>  <span class="comment">/* Initial cap */</span></div><div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>  <span class="keywordflow">while</span> (s[offset] != <span class="charliteral">'\0'</span> && char_set.<a class="code" href="a03950.html#a55071e756e234d8c51ca08079c1847cd">get_isupper</a>(s + offset, lengths[i])) {</div><div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>  offset += lengths[i++];</div><div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>  upper_count++;</div><div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>  }</div><div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>  <span class="keywordflow">if</span> (upper_count > 1) {</div><div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeead58aa8857ae2a3ec6a90b29a849700d7">AC_UPPER_CASE</a>;</div><div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>  <span class="comment">/* Lower case word, possibly with an initial cap */</span></div><div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>  <span class="keywordflow">while</span> (s[offset] != <span class="charliteral">'\0'</span> && char_set.<a class="code" href="a03950.html#afb472ed816e5f312692fa670f56dceb6">get_islower</a>(s + offset, lengths[i])) {</div><div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>  offset += lengths[i++];</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="keywordflow">if</span> (i - leading_punct_count < <a class="code" href="a02358.html#a991cd3e6b917b850d7cccb7df1fabfa5">quality_min_initial_alphas_reqd</a>)</div><div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>  <span class="keywordflow">goto</span> not_a_word;</div><div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>  <span class="comment">/*</span></div><div class="line"><a name="l01797"></a><span class="lineno"> 1797</span> <span class="comment"> Allow a single hyphen in a lower case word</span></div><div class="line"><a name="l01798"></a><span class="lineno"> 1798</span> <span class="comment"> - don't trust upper case - I've seen several cases of "H" -> "I-I"</span></div><div class="line"><a name="l01799"></a><span class="lineno"> 1799</span> <span class="comment"> */</span></div><div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>  <span class="keywordflow">if</span> (lengths[i] == 1 && s[offset] == <span class="charliteral">'-'</span>) {</div><div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>  hyphen_pos = i;</div><div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>  offset += lengths[i++];</div><div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>  <span class="keywordflow">if</span> (s[offset] != <span class="charliteral">'\0'</span>) {</div><div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>  <span class="keywordflow">while</span> ((s[offset] != <span class="charliteral">'\0'</span>) &&</div><div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>  char_set.<a class="code" href="a03950.html#afb472ed816e5f312692fa670f56dceb6">get_islower</a>(s + offset, lengths[i])) {</div><div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>  offset += lengths[i++];</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="keywordflow">if</span> (i < hyphen_pos + 3)</div><div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>  <span class="keywordflow">goto</span> not_a_word;</div><div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>  }</div><div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>  <span class="comment">/* Allow "'s" in NON hyphenated lower case words */</span></div><div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>  <span class="keywordflow">if</span> (lengths[i] == 1 && (s[offset] == <span class="charliteral">'\''</span>) &&</div><div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>  lengths[i + 1] == 1 && (s[offset + lengths[i]] == <span class="charliteral">'s'</span>)) {</div><div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>  offset += lengths[i++];</div><div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>  offset += lengths[i++];</div><div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>  }</div><div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>  }</div><div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>  <span class="keywordflow">if</span> (upper_count > 0)</div><div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea71786bea8ae4bacc2670610dde24e707">AC_INITIAL_CAP</a>;</div><div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaf8e947b78fa9ddbd1172c0157a3516ff">AC_LOWER_CASE</a>;</div><div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>  }</div><div class="line"><a name="l01824"></a><span class="lineno"> 1824</span> </div><div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>  <span class="comment">/* Up to two different, constrained trailing punctuation chars */</span></div><div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>  <span class="keywordflow">if</span> (lengths[i] == 1 && s[offset] != <span class="charliteral">'\0'</span> &&</div><div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>  <a class="code" href="a02834.html">STRING</a>(<a class="code" href="a02358.html#a25b9d2e69623b7abd26993cce6b3a6fc">chs_trailing_punct1</a>).<a class="code" href="a02834.html#ac8c4ceca1e688adcdf188aef108dc18b">contains</a>(s[offset]))</div><div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>  offset += lengths[i++];</div><div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>  <span class="keywordflow">if</span> (lengths[i] == 1 && s[offset] != <span class="charliteral">'\0'</span> && i > 0 &&</div><div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>  s[offset - lengths[i - 1]] != s[offset] &&</div><div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>  <a class="code" href="a02834.html">STRING</a>(<a class="code" href="a02358.html#ab9f43297023769eb21510a8f4a98f69f">chs_trailing_punct2</a>).<a class="code" href="a02834.html#ac8c4ceca1e688adcdf188aef108dc18b">contains</a> (s[offset]))</div><div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>  offset += lengths[i++];</div><div class="line"><a name="l01833"></a><span class="lineno"> 1833</span> </div><div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>  <span class="keywordflow">if</span> (s[offset] != <span class="charliteral">'\0'</span>)</div><div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0">AC_UNACCEPTABLE</a>;</div><div class="line"><a name="l01836"></a><span class="lineno"> 1836</span> </div><div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>  not_a_word:</div><div class="line"><a name="l01838"></a><span class="lineno"> 1838</span> </div><div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>  <span class="keywordflow">if</span> (word_type == <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0">AC_UNACCEPTABLE</a>) {</div><div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>  <span class="comment">/* Look for abbreviation string */</span></div><div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>  i = 0;</div><div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>  offset = 0;</div><div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>  <span class="keywordflow">if</span> (s[0] != <span class="charliteral">'\0'</span> && char_set.<a class="code" href="a03950.html#a55071e756e234d8c51ca08079c1847cd">get_isupper</a>(s, lengths[0])) {</div><div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea6d37e3775faa628c72b7953f89caeb22">AC_UC_ABBREV</a>;</div><div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>  <span class="keywordflow">while</span> (s[offset] != <span class="charliteral">'\0'</span> &&</div><div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>  char_set.<a class="code" href="a03950.html#a55071e756e234d8c51ca08079c1847cd">get_isupper</a>(s + offset, lengths[i]) &&</div><div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>  lengths[i + 1] == 1 && s[offset + lengths[i]] == <span class="charliteral">'.'</span>) {</div><div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>  offset += lengths[i++];</div><div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>  offset += lengths[i++];</div><div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>  }</div><div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>  }</div><div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (s[0] != <span class="charliteral">'\0'</span> && char_set.<a class="code" href="a03950.html#afb472ed816e5f312692fa670f56dceb6">get_islower</a>(s, lengths[0])) {</div><div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea7bae128b501c1b34213e7ce6b17f7988">AC_LC_ABBREV</a>;</div><div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>  <span class="keywordflow">while</span> (s[offset] != <span class="charliteral">'\0'</span> &&</div><div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>  char_set.<a class="code" href="a03950.html#afb472ed816e5f312692fa670f56dceb6">get_islower</a>(s + offset, lengths[i]) &&</div><div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>  lengths[i + 1] == 1 && s[offset + lengths[i]] == <span class="charliteral">'.'</span>) {</div><div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>  offset += lengths[i++];</div><div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>  offset += lengths[i++];</div><div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>  }</div><div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>  }</div><div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>  <span class="keywordflow">if</span> (s[offset] != <span class="charliteral">'\0'</span>)</div><div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>  word_type = <a class="code" href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0">AC_UNACCEPTABLE</a>;</div><div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>  }</div><div class="line"><a name="l01864"></a><span class="lineno"> 1864</span> </div><div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>  <span class="keywordflow">return</span> word_type;</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> </div><div class="line"><a name="l01868"></a><span class="lineno"><a class="line" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff"> 1868</a></span> <span class="keywordtype">bool</span> <a class="code" href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">Tesseract::check_debug_pt</a>(<a class="code" href="a02542.html">WERD_RES</a>* word, <span class="keywordtype">int</span> location) {</div><div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>  <span class="keywordtype">bool</span> show_map_detail = <span class="keyword">false</span>;</div><div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>  int16_t i;</div><div class="line"><a name="l01871"></a><span class="lineno"> 1871</span> </div><div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>  <span class="keywordflow">if</span> (!<a class="code" href="a02358.html#a5439cd8199c72bfc34530cc41c252a64">test_pt</a>)</div><div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>  <span class="keywordflow">return</span> <span class="keyword">false</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>  <a class="code" href="a02358.html#ab92cd0aa3a10873a0ce6f28666063a2a">tessedit_rejection_debug</a>.set_value (<a class="code" href="a00014.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a>);</div><div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>  <a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a>.set_value(0);</div><div class="line"><a name="l01877"></a><span class="lineno"> 1877</span> </div><div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#ad35a2fd78555195a3dedcdd01094d0d4">bounding_box</a>().<a class="code" href="a02610.html#acfa252ec4b65cbf808349f70fcf62019">contains</a>(<a class="code" href="a02578.html">FCOORD</a> (<a class="code" href="a02358.html#ae013672e42ba7e300514ddb98c064a8f">test_pt_x</a>, <a class="code" href="a02358.html#a05f11182c05c592d3e17d836686f022f">test_pt_y</a>))) {</div><div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>  <span class="keywordflow">if</span> (location < 0)</div><div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>; <span class="comment">// For breakpoint use</span></div><div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>  <a class="code" href="a02358.html#ab92cd0aa3a10873a0ce6f28666063a2a">tessedit_rejection_debug</a>.set_value(<a class="code" href="a00014.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>);</div><div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>  <a class="code" href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">debug_x_ht_level</a>.set_value(2);</div><div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"\n\nTESTWD::"</span>);</div><div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>  <span class="keywordflow">switch</span> (location) {</div><div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>  <span class="keywordflow">case</span> 0:</div><div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"classify_word_pass1 start\n"</span>);</div><div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>  word-><a class="code" href="a02542.html#afc15fa7c1b5ad55d6772dea0d6865df1">word</a>-><a class="code" href="a02638.html#a5a2d228e15200b7535fac2144109b677">print</a>();</div><div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>  <span class="keywordflow">case</span> 10:</div><div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"make_reject_map: initial map"</span>);</div><div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>  <span class="keywordflow">case</span> 20:</div><div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"make_reject_map: after NN"</span>);</div><div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>  <span class="keywordflow">case</span> 30:</div><div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"classify_word_pass2 - START"</span>);</div><div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>  <span class="keywordflow">case</span> 40:</div><div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"classify_word_pass2 - Pre Xht"</span>);</div><div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>  <span class="keywordflow">case</span> 50:</div><div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"classify_word_pass2 - END"</span>);</div><div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>  show_map_detail = <span class="keyword">true</span>;</div><div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>  <span class="keywordflow">case</span> 60:</div><div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"fixspace"</span>);</div><div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>  <span class="keywordflow">case</span> 70:</div><div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"MM pass START"</span>);</div><div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>  <span class="keywordflow">case</span> 80:</div><div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"MM pass END"</span>);</div><div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>  <span class="keywordflow">case</span> 90:</div><div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"After Poor quality rejection"</span>);</div><div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>  <span class="keywordflow">case</span> 100:</div><div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"unrej_good_quality_words - START"</span>);</div><div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>  <span class="keywordflow">case</span> 110:</div><div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"unrej_good_quality_words - END"</span>);</div><div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>  <span class="keywordflow">case</span> 120:</div><div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"Write results pass"</span>);</div><div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>  show_map_detail = <span class="keyword">true</span>;</div><div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>  }</div><div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">" \"%s\" "</span>, 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="l01930"></a><span class="lineno"> 1930</span>  word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>.<a class="code" href="a02618.html#a124889539460b8c200b3186da4a692e0">print</a>(<a class="code" href="a00194.html#adff672a9cdb59d57a0d142954a6a3899">debug_fp</a>);</div><div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"\n"</span>);</div><div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>  <span class="keywordflow">if</span> (show_map_detail) {</div><div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"\"%s\"\n"</span>, 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="l01934"></a><span class="lineno"> 1934</span>  <span class="keywordflow">for</span> (i = 0; word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>()[i] != <span class="charliteral">'\0'</span>; i++) {</div><div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"**** \"%c\" ****\n"</span>, word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#adf200132afabc2ee6ec256e516011007">unichar_string</a>()[i]);</div><div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>  word-><a class="code" href="a02542.html#ae24eb58be06cf275aee411d947fd31ef">reject_map</a>[i].<a class="code" href="a02618.html#a476689acf6a0c07a0f09452ef5ff79e8">full_print</a>(<a class="code" href="a00194.html#adff672a9cdb59d57a0d142954a6a3899">debug_fp</a>);</div><div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>  }</div><div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>  }</div><div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"null best choice\n"</span>);</div><div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>  }</div><div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"Tess Accepted: %s\n"</span>, word-><a class="code" href="a02542.html#aa7f56655eb0e5164f2d2e85906475cb1">tess_accepted</a> ? <span class="stringliteral">"TRUE"</span> : <span class="stringliteral">"FALSE"</span>);</div><div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a> (<span class="stringliteral">"Done flag: %s\n\n"</span>, word-><a class="code" href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">done</a> ? <span class="stringliteral">"TRUE"</span> : <span class="stringliteral">"FALSE"</span>);</div><div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>  }</div><div class="line"><a name="l01948"></a><span class="lineno"> 1948</span> }</div><div class="line"><a name="l01949"></a><span class="lineno"> 1949</span> </div><div class="line"><a name="l01955"></a><span class="lineno"> 1955</span> <span class="keyword">static</span> <span class="keywordtype">void</span> find_modal_font( <span class="comment">// good chars in word</span></div><div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>  <a class="code" href="a02630.html">STATS</a>* fonts, <span class="comment">// font stats</span></div><div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>  int16_t* font_out, <span class="comment">// output font</span></div><div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>  int8_t* font_count <span class="comment">// output count</span></div><div class="line"><a name="l01959"></a><span class="lineno"> 1959</span> ) {</div><div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>  int16_t font; <span class="comment">//font index</span></div><div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>  int32_t <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a>; <span class="comment">//pile count</span></div><div class="line"><a name="l01962"></a><span class="lineno"> 1962</span> </div><div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>  <span class="keywordflow">if</span> (fonts-><a class="code" href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">get_total</a> () > 0) {</div><div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>  font = (int16_t) fonts-><a class="code" href="a02630.html#aec56187613797fe011b1f3b12021e0e1">mode</a> ();</div><div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>  *font_out = font;</div><div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>  <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> = fonts-><a class="code" href="a02630.html#a3c8bc9b57b27780a349d55449366c97f">pile_count</a> (font);</div><div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>  *font_count = <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> < INT8_MAX ? <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> : INT8_MAX;</div><div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>  fonts-><a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a> (font, -*font_count);</div><div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>  }</div><div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>  *font_out = -1;</div><div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>  *font_count = 0;</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> </div><div class="line"><a name="l01981"></a><span class="lineno"><a class="line" href="a02358.html#ad78f0499b8efaaa828b181fe318c72fb"> 1981</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#ad78f0499b8efaaa828b181fe318c72fb">Tesseract::set_word_fonts</a>(<a class="code" href="a02542.html">WERD_RES</a> *word) {</div><div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>  <span class="comment">// Don't try to set the word fonts for an lstm word, as the configs</span></div><div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>  <span class="comment">// will be meaningless.</span></div><div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#ad1d449f93bb0150bc7ef0d9b59ed27ba">chopped_word</a> == <span class="keyword">nullptr</span>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a> != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l01986"></a><span class="lineno"> 1986</span> </div><div class="line"><a name="l01987"></a><span class="lineno"> 1987</span> <span class="preprocessor">#ifndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> fontinfo_size = <a class="code" href="a03998.html#a62597f182a5e23c3b8a030c06e699e99">get_fontinfo_table</a>().size();</div><div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>  <span class="keywordflow">if</span> (fontinfo_size == 0) <span class="keywordflow">return</span>;</div><div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>  <a class="code" href="a02182.html">GenericVector<int></a> font_total_score;</div><div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>  font_total_score.<a class="code" href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">init_to_size</a>(fontinfo_size, 0);</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>  word-><a class="code" href="a02542.html#a15073b13b0b1fc7f06a5fe827f814fcc">italic</a> = 0;</div><div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>  word-><a class="code" href="a02542.html#aab88c163b4ef9e6a147222f2ec981a9c">bold</a> = 0;</div><div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>  <span class="comment">// Compute the font scores for the word</span></div><div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0f66184981a2875773aad0b4c0dc210c">tessedit_debug_fonts</a>) {</div><div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Examining fonts in %s\n"</span>,</div><div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>  word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">debug_string</a>().<a class="code" href="a02834.html#abf0a7b3c6ae39a46e5441f28f61de5de">string</a>());</div><div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>  }</div><div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> b = 0; b < word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>(); ++b) {</div><div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>  <span class="keyword">const</span> <a class="code" href="a02602.html">BLOB_CHOICE</a>* choice = word-><a class="code" href="a02542.html#afd5df4b31d6cfc9fc05d79e5fd774212">GetBlobChoice</a>(b);</div><div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>  <span class="keywordflow">if</span> (choice == <span class="keyword">nullptr</span>) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>  <span class="keyword">const</span> <a class="code" href="a02182.html">GenericVector<ScoredFont></a>& fonts = choice-><a class="code" href="a02602.html#ab8179e5026a2b8f06f68b8efd5efc883">fonts</a>();</div><div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> f = 0; f < fonts.<a class="code" href="a02182.html#a20cfad5c58c50cb85a9529d8ddbd96af">size</a>(); ++f) {</div><div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> fontinfo_id = fonts[f].fontinfo_id;</div><div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>  <span class="keywordflow">if</span> (0 <= fontinfo_id && fontinfo_id < fontinfo_size) {</div><div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>  font_total_score[fontinfo_id] += fonts[f].score;</div><div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>  }</div><div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>  }</div><div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>  }</div><div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>  <span class="comment">// Find the top and 2nd choice for the word.</span></div><div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>  <span class="keywordtype">int</span> score1 = 0, score2 = 0;</div><div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>  int16_t font_id1 = -1, font_id2 = -1;</div><div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> f = 0; f < fontinfo_size; ++f) {</div><div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0f66184981a2875773aad0b4c0dc210c">tessedit_debug_fonts</a> && font_total_score[f] > 0) {</div><div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Font %s, total score = %d\n"</span>,</div><div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>  <a class="code" href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">fontinfo_table_</a>.get(f).name, font_total_score[f]);</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>  <span class="keywordflow">if</span> (font_total_score[f] > score1) {</div><div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>  score2 = score1;</div><div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>  font_id2 = font_id1;</div><div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>  score1 = font_total_score[f];</div><div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>  font_id1 = f;</div><div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (font_total_score[f] > score2) {</div><div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>  score2 = font_total_score[f];</div><div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>  font_id2 = f;</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>  }</div><div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>  word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a> = font_id1 >= 0 ? &<a class="code" href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">fontinfo_table_</a>.get(font_id1) : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>  word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a> = font_id2 >= 0 ? &<a class="code" href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">fontinfo_table_</a>.get(font_id2) : <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>  <span class="comment">// Each score has a limit of UINT16_MAX, so divide by that to get the number</span></div><div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>  <span class="comment">// of "votes" for that font, ie number of perfect scores.</span></div><div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>  word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a> = ClipToRange<int>(score1 / UINT16_MAX, 1, INT8_MAX);</div><div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>  word-><a class="code" href="a02542.html#a3583f31731a0399b098394abd6f1dcdc">fontinfo_id2_count</a> = ClipToRange<int>(score2 / UINT16_MAX, 0, INT8_MAX);</div><div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>  <span class="keywordflow">if</span> (score1 > 0) {</div><div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>  <span class="keyword">const</span> <a class="code" href="a02458.html">FontInfo</a> fi = <a class="code" href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">fontinfo_table_</a>.get(font_id1);</div><div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#a0f66184981a2875773aad0b4c0dc210c">tessedit_debug_fonts</a>) {</div><div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a3583f31731a0399b098394abd6f1dcdc">fontinfo_id2_count</a> > 0 && font_id2 >= 0) {</div><div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Word modal font=%s, score=%d, 2nd choice %s/%d\n"</span>,</div><div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>  fi.<a class="code" href="a02458.html#a948c9f88952c8c48ca5fa37fb33085d8">name</a>, word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>,</div><div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>  <a class="code" href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">fontinfo_table_</a>.get(font_id2).name,</div><div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>  word-><a class="code" href="a02542.html#a3583f31731a0399b098394abd6f1dcdc">fontinfo_id2_count</a>);</div><div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Word modal font=%s, score=%d. No 2nd choice\n"</span>,</div><div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>  fi.<a class="code" href="a02458.html#a948c9f88952c8c48ca5fa37fb33085d8">name</a>, word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>);</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>  }</div><div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>  word-><a class="code" href="a02542.html#a15073b13b0b1fc7f06a5fe827f814fcc">italic</a> = (fi.<a class="code" href="a02458.html#a32425f25da06fd353479d9406c0b969a">is_italic</a>() ? 1 : -1) * word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>;</div><div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>  word-><a class="code" href="a02542.html#aab88c163b4ef9e6a147222f2ec981a9c">bold</a> = (fi.<a class="code" href="a02458.html#ac0ed297774ba680aa307bf0866b0d6c4">is_bold</a>() ? 1 : -1) * word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>;</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="preprocessor">#endif // ndef DISABLED_LEGACY_ENGINE</span></div><div class="line"><a name="l02052"></a><span class="lineno"> 2052</span> }</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> </div><div class="line"><a name="l02060"></a><span class="lineno"><a class="line" href="a02358.html#aaccda3caf003809de9f40743d9205169"> 2060</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#aaccda3caf003809de9f40743d9205169">Tesseract::font_recognition_pass</a>(<a class="code" href="a02530.html">PAGE_RES</a>* page_res) {</div><div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> page_res_it(page_res);</div><div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>  <a class="code" href="a02542.html">WERD_RES</a> *word; <span class="comment">// current word</span></div><div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>  <a class="code" href="a02630.html">STATS</a> doc_fonts(0, font_table_size_); <span class="comment">// font counters</span></div><div class="line"><a name="l02064"></a><span class="lineno"> 2064</span> </div><div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>  <span class="comment">// Gather font id statistics.</span></div><div class="line"><a name="l02066"></a><span class="lineno"> 2066</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="l02067"></a><span class="lineno"> 2067</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>  word = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>  doc_fonts.<a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a>(word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a>-><a class="code" href="a02458.html#a1100e3d0a24568ffaf0b7cbf570b25c8">universal_id</a>, word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>);</div><div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>  }</div><div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a> != <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>  doc_fonts.<a class="code" href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">add</a>(word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a>-><a class="code" href="a02458.html#a1100e3d0a24568ffaf0b7cbf570b25c8">universal_id</a>, word-><a class="code" href="a02542.html#a3583f31731a0399b098394abd6f1dcdc">fontinfo_id2_count</a>);</div><div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>  }</div><div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>  }</div><div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>  int16_t doc_font; <span class="comment">// modal font</span></div><div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>  int8_t doc_font_count; <span class="comment">// modal font</span></div><div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>  find_modal_font(&doc_fonts, &doc_font, &doc_font_count);</div><div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>  <span class="keywordflow">if</span> (doc_font_count == 0)</div><div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>  <span class="comment">// Get the modal font pointer.</span></div><div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>  <span class="keyword">const</span> <a class="code" href="a02458.html">FontInfo</a>* modal_font = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02083"></a><span class="lineno"> 2083</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="l02084"></a><span class="lineno"> 2084</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>  word = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a> != <span class="keyword">nullptr</span> && word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a>-><a class="code" href="a02458.html#a1100e3d0a24568ffaf0b7cbf570b25c8">universal_id</a> == doc_font) {</div><div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>  modal_font = word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a>;</div><div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>  }</div><div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>  <span class="keywordflow">if</span> (word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a> != <span class="keyword">nullptr</span> && word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a>-><a class="code" href="a02458.html#a1100e3d0a24568ffaf0b7cbf570b25c8">universal_id</a> == doc_font) {</div><div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>  modal_font = word-><a class="code" href="a02542.html#a42a1961e381f0b4df731321552fe771c">fontinfo2</a>;</div><div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>  }</div><div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>  }</div><div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>  <a class="code" href="a00503.html#a93a603f4063a6b9403d81caa245a583b">ASSERT_HOST</a>(modal_font != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l02096"></a><span class="lineno"> 2096</span> </div><div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>  <span class="comment">// Assign modal font to weak words.</span></div><div class="line"><a name="l02098"></a><span class="lineno"> 2098</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="l02099"></a><span class="lineno"> 2099</span>  page_res_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>  word = page_res_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>();</div><div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> length = word-><a class="code" href="a02542.html#a3d42ac7ec121263e757c9b7160dfd50d">best_choice</a>-><a class="code" href="a02606.html#ad00f0a3cf74d3b2d82dcefb811bd1685">length</a>();</div><div class="line"><a name="l02102"></a><span class="lineno"> 2102</span> </div><div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> = word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a>;</div><div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>  <span class="keywordflow">if</span> (!(<a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> == length || (length > 3 && <a class="code" href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a> >= length * 3 / 4))) {</div><div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>  word-><a class="code" href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">fontinfo</a> = modal_font;</div><div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>  <span class="comment">// Counts only get 1 as it came from the doc.</span></div><div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>  word-><a class="code" href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">fontinfo_id_count</a> = 1;</div><div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>  word-><a class="code" href="a02542.html#a15073b13b0b1fc7f06a5fe827f814fcc">italic</a> = modal_font-><a class="code" href="a02458.html#a32425f25da06fd353479d9406c0b969a">is_italic</a>() ? 1 : -1;</div><div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>  word-><a class="code" href="a02542.html#aab88c163b4ef9e6a147222f2ec981a9c">bold</a> = modal_font-><a class="code" href="a02458.html#ac0ed297774ba680aa307bf0866b0d6c4">is_bold</a>() ? 1 : -1;</div><div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>  }</div><div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>  }</div><div class="line"><a name="l02112"></a><span class="lineno"> 2112</span> }</div><div class="line"><a name="l02113"></a><span class="lineno"> 2113</span> </div><div class="line"><a name="l02114"></a><span class="lineno"> 2114</span> <span class="comment">// If a word has multiple alternates check if the best choice is in the</span></div><div class="line"><a name="l02115"></a><span class="lineno"> 2115</span> <span class="comment">// dictionary. If not, replace it with an alternate that exists in the</span></div><div class="line"><a name="l02116"></a><span class="lineno"> 2116</span> <span class="comment">// dictionary.</span></div><div class="line"><a name="l02117"></a><span class="lineno"><a class="line" href="a02358.html#a8eaae506cccb353fadda129e070853fe"> 2117</a></span> <span class="keywordtype">void</span> <a class="code" href="a02358.html#a8eaae506cccb353fadda129e070853fe">Tesseract::dictionary_correction_pass</a>(<a class="code" href="a02530.html">PAGE_RES</a> *page_res) {</div><div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>  <a class="code" href="a02546.html">PAGE_RES_IT</a> word_it(page_res);</div><div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>  <span class="keywordflow">for</span> (<a class="code" href="a02542.html">WERD_RES</a>* word = word_it.<a class="code" href="a02546.html#a6cdcdaa4b0b1250ab7e14760d4b5f113">word</a>(); word != <span class="keyword">nullptr</span>;</div><div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>  word = word_it.<a class="code" href="a02546.html#ab29005f235cc738eebafb7d9ed6fe70b">forward</a>()) {</div><div class="line"><a name="l02121"></a><span class="lineno"> 2121</span>  <span class="keywordflow">if</span> (word->best_choices.singleton())</div><div class="line"><a name="l02122"></a><span class="lineno"> 2122</span>  <span class="keywordflow">continue</span>; <span class="comment">// There are no alternates.</span></div><div class="line"><a name="l02123"></a><span class="lineno"> 2123</span> </div><div class="line"><a name="l02124"></a><span class="lineno"> 2124</span>  <span class="keyword">const</span> <a class="code" href="a02606.html">WERD_CHOICE</a>* best = word->best_choice;</div><div class="line"><a name="l02125"></a><span class="lineno"> 2125</span>  <span class="keywordflow">if</span> (word->tesseract->getDict().valid_word(*best) != 0)</div><div class="line"><a name="l02126"></a><span class="lineno"> 2126</span>  <span class="keywordflow">continue</span>; <span class="comment">// The best choice is in the dictionary.</span></div><div class="line"><a name="l02127"></a><span class="lineno"> 2127</span> </div><div class="line"><a name="l02128"></a><span class="lineno"> 2128</span>  WERD_CHOICE_IT choice_it(&word->best_choices);</div><div class="line"><a name="l02129"></a><span class="lineno"> 2129</span>  <span class="keywordflow">for</span> (choice_it.mark_cycle_pt(); !choice_it.cycled_list();</div><div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>  choice_it.forward()) {</div><div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>  <a class="code" href="a02606.html">WERD_CHOICE</a>* alternate = choice_it.data();</div><div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>  <span class="keywordflow">if</span> (word->tesseract->getDict().valid_word(*alternate)) {</div><div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>  <span class="comment">// The alternate choice is in the dictionary.</span></div><div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>  <span class="keywordflow">if</span> (<a class="code" href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tessedit_bigram_debug</a>) {</div><div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>  <a class="code" href="a00596.html#a0c2bcd4462ec67ab0971b34a0f610f55">tprintf</a>(<span class="stringliteral">"Dictionary correction replaces best choice '%s' with '%s'\n"</span>,</div><div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>  best-><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="l02137"></a><span class="lineno"> 2137</span>  alternate-><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="l02138"></a><span class="lineno"> 2138</span>  }</div><div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>  <span class="comment">// Replace the 'best' choice with a better choice.</span></div><div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>  word->ReplaceBestChoice(alternate);</div><div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>  }</div><div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>  }</div><div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>  }</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> </div><div class="line"><a name="l02147"></a><span class="lineno"> 2147</span> } <span class="comment">// namespace tesseract</span></div><div class="ttc" id="a00971_html"><div class="ttname"><a href="a00971.html">lstmrecognizer.h</a></div></div>
<div class="ttc" id="a02358_html_a22b976f806f8e8882aed22a525729289"><div class="ttname"><a href="a02358.html#a22b976f806f8e8882aed22a525729289">tesseract::Tesseract::SetupAllWordsPassN</a></div><div class="ttdeci">void SetupAllWordsPassN(int pass_n, const TBOX *target_word_box, const char *word_config, PAGE_RES *page_res, GenericVector< WordData > *words)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00159">control.cpp:159</a></div></div>
<div class="ttc" id="a04386_html_a6b94d49e9e4aab418bb7866b2691f30b"><div class="ttname"><a href="a04386.html#a6b94d49e9e4aab418bb7866b2691f30b">tesseract::LSTMRecognizer::GetUnicharset</a></div><div class="ttdeci">const UNICHARSET & GetUnicharset() const</div><div class="ttdef"><b>Definition:</b> <a href="a00971_source.html#l00139">lstmrecognizer.h:139</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="a02606_html_a8238d436806c40b2e01b9659dfab5eb3"><div class="ttname"><a href="a02606.html#a8238d436806c40b2e01b9659dfab5eb3">WERD_CHOICE::set_unichar_id</a></div><div class="ttdeci">void set_unichar_id(UNICHAR_ID unichar_id, int index)</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00359">ratngs.h:359</a></div></div>
<div class="ttc" id="a02546_html_a2a5d8667cbd59645f8d499485045380c"><div class="ttname"><a href="a02546.html#a2a5d8667cbd59645f8d499485045380c">PAGE_RES_IT::ReplaceCurrentWord</a></div><div class="ttdeci">void ReplaceCurrentWord(tesseract::PointerVector< WERD_RES > *words)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01322">pageres.cpp:1322</a></div></div>
<div class="ttc" id="a02358_html_a32db7a74bbdc6322a0650a6cd9fb4e50"><div class="ttname"><a href="a02358.html#a32db7a74bbdc6322a0650a6cd9fb4e50">tesseract::Tesseract::debug_noise_removal</a></div><div class="ttdeci">int debug_noise_removal</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00885">tesseractclass.h:885</a></div></div>
<div class="ttc" id="a02542_html_a23445f9e8dce6db8902504c0fe1d2e37"><div class="ttname"><a href="a02542.html#a23445f9e8dce6db8902504c0fe1d2e37">WERD_RES::best_choices</a></div><div class="ttdeci">WERD_CHOICE_LIST best_choices</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00243">pageres.h:243</a></div></div>
<div class="ttc" id="a02358_html_a85a67d840287336a86e9b710865075fc"><div class="ttname"><a href="a02358.html#a85a67d840287336a86e9b710865075fc">tesseract::Tesseract::ClassifyBlobAsWord</a></div><div class="ttdeci">float ClassifyBlobAsWord(int pass_n, PAGE_RES_IT *pr_it, C_BLOB *blob, STRING *best_str, float *c2)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01287">control.cpp:1287</a></div></div>
<div class="ttc" id="a02542_html_a67c3636375afdd8b132a31c3aad526de"><div class="ttname"><a href="a02542.html#a67c3636375afdd8b132a31c3aad526de">WERD_RES::ConsumeWordResults</a></div><div class="ttdeci">void ConsumeWordResults(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00771">pageres.cpp:771</a></div></div>
<div class="ttc" id="a03998_html_a88f8ff9caac17216207149574db5b63b"><div class="ttname"><a href="a03998.html#a88f8ff9caac17216207149574db5b63b">tesseract::Classify::classify_max_certainty_margin</a></div><div class="ttdeci">double classify_max_certainty_margin</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00445">classify.h:445</a></div></div>
<div class="ttc" id="a00122_html"><div class="ttname"><a href="a00122.html">output.h</a></div></div>
<div class="ttc" id="a02358_html_aaccda3caf003809de9f40743d9205169"><div class="ttname"><a href="a02358.html#aaccda3caf003809de9f40743d9205169">tesseract::Tesseract::font_recognition_pass</a></div><div class="ttdeci">void font_recognition_pass(PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l02060">control.cpp:2060</a></div></div>
<div class="ttc" id="a03950_html_afb472ed816e5f312692fa670f56dceb6"><div class="ttname"><a href="a03950.html#afb472ed816e5f312692fa670f56dceb6">UNICHARSET::get_islower</a></div><div class="ttdeci">bool get_islower(UNICHAR_ID unichar_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00493">unicharset.h:493</a></div></div>
<div class="ttc" id="a02542_html_a91228b4814b63ea8efdf17a2e8a9a0f3"><div class="ttname"><a href="a02542.html#a91228b4814b63ea8efdf17a2e8a9a0f3">WERD_RES::tess_failed</a></div><div class="ttdeci">bool tess_failed</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00288">pageres.h:288</a></div></div>
<div class="ttc" id="a02542_html_a211ab5c5a13123ee7bdc7459d3363f9d"><div class="ttname"><a href="a02542.html#a211ab5c5a13123ee7bdc7459d3363f9d">WERD_RES::rebuild_word</a></div><div class="ttdeci">TWERD * rebuild_word</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00260">pageres.h:260</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_ac6f6a4356167ad8933a615eee41eca96"><div class="ttname"><a href="a02358.html#ac6f6a4356167ad8933a615eee41eca96">tesseract::Tesseract::tessedit_parallelize</a></div><div class="ttdeci">int tessedit_parallelize</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01116">tesseractclass.h:1116</a></div></div>
<div class="ttc" id="a02630_html_a3c8bc9b57b27780a349d55449366c97f"><div class="ttname"><a href="a02630.html#a3c8bc9b57b27780a349d55449366c97f">STATS::pile_count</a></div><div class="ttdeci">int32_t pile_count(int32_t value) const</div><div class="ttdef"><b>Definition:</b> <a href="a00431_source.html#l00078">statistc.h:78</a></div></div>
<div class="ttc" id="a02358_html_a212233fdf73096abefa2fa48b8ada3fc"><div class="ttname"><a href="a02358.html#a212233fdf73096abefa2fa48b8ada3fc">tesseract::Tesseract::ComputeCompatibleXheight</a></div><div class="ttdeci">float ComputeCompatibleXheight(WERD_RES *word_res, float *baseline_shift)</div><div class="ttdef"><b>Definition:</b> <a href="a00095_source.html#l00102">fixxht.cpp:102</a></div></div>
<div class="ttc" id="a02542_html_a2353b9e482531332773c28b996f8b1b7"><div class="ttname"><a href="a02542.html#a2353b9e482531332773c28b996f8b1b7">WERD_RES::guessed_x_ht</a></div><div class="ttdeci">bool guessed_x_ht</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00308">pageres.h:308</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="a02358_html_a6e01f7c9333f2efa42498c99a0e5be53"><div class="ttname"><a href="a02358.html#a6e01f7c9333f2efa42498c99a0e5be53">tesseract::Tesseract::tessedit_minimal_rejection</a></div><div class="ttdeci">bool tessedit_minimal_rejection</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01057">tesseractclass.h:1057</a></div></div>
<div class="ttc" id="a02358_html_af87fe0ff76c1035ae599f8726641118f"><div class="ttname"><a href="a02358.html#af87fe0ff76c1035ae599f8726641118f">tesseract::Tesseract::classify_word_pass2</a></div><div class="ttdeci">void classify_word_pass2(const WordData &word_data, WERD_RES **in_word, PointerVector< WERD_RES > *out_words)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01591">control.cpp:1591</a></div></div>
<div class="ttc" id="a02358_html_a64c4feb195f9c3bb487536da72436654"><div class="ttname"><a href="a02358.html#a64c4feb195f9c3bb487536da72436654">tesseract::Tesseract::AssignDiacriticsToNewBlobs</a></div><div class="ttdeci">void AssignDiacriticsToNewBlobs(const GenericVector< C_OUTLINE *> &outlines, int pass, WERD *real_word, PAGE_RES_IT *pr_it, GenericVector< bool > *word_wanted, GenericVector< C_BLOB *> *target_blobs)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01074">control.cpp:1074</a></div></div>
<div class="ttc" id="a00401_html_a18e2c75cefe9e5b78e8ce41aa5fa25bca616bdbcaed7dd414823b303af5c8b1f1"><div class="ttname"><a href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca616bdbcaed7dd414823b303af5c8b1f1">SYSTEM_DAWG_PERM</a></div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00251">ratngs.h:251</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="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="a02530_html_a6341c86ed5c02252716d5d902fc42862"><div class="ttname"><a href="a02530.html#a6341c86ed5c02252716d5d902fc42862">PAGE_RES::rej_count</a></div><div class="ttdeci">int32_t rej_count</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00080">pageres.h:80</a></div></div>
<div class="ttc" id="a02530_html_af4e6350f65d0d939058071632dc56e94"><div class="ttname"><a href="a02530.html#af4e6350f65d0d939058071632dc56e94">PAGE_RES::misadaption_log</a></div><div class="ttdeci">GenericVector< STRING > misadaption_log</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00092">pageres.h:92</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="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="a02358_html_ae013672e42ba7e300514ddb98c064a8f"><div class="ttname"><a href="a02358.html#ae013672e42ba7e300514ddb98c064a8f">tesseract::Tesseract::test_pt_x</a></div><div class="ttdeci">double test_pt_x</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00920">tesseractclass.h:920</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="a00344_html"><div class="ttname"><a href="a00344.html">pageres.h</a></div></div>
<div class="ttc" id="a00503_html_a87d586caeb936d763514af2bbba8cab6"><div class="ttname"><a href="a00503.html#a87d586caeb936d763514af2bbba8cab6">set_global_subloc_code</a></div><div class="ttdeci">void set_global_subloc_code(int loc_code)</div><div class="ttdef"><b>Definition:</b> <a href="a00521_source.html#l00085">globaloc.cpp:85</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="a02358_html_af06531e448f9f0d7777ec0b81622dfec"><div class="ttname"><a href="a02358.html#af06531e448f9f0d7777ec0b81622dfec">tesseract::Tesseract::ClassifyBlobPlusOutlines</a></div><div class="ttdeci">float ClassifyBlobPlusOutlines(const GenericVector< bool > &ok_outlines, const GenericVector< C_OUTLINE *> &outlines, int pass_n, PAGE_RES_IT *pr_it, C_BLOB *blob, STRING *best_str)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01239">control.cpp:1239</a></div></div>
<div class="ttc" id="a00503_html_a8f145da3d27aa025f220becb27879db7"><div class="ttname"><a href="a00503.html#a8f145da3d27aa025f220becb27879db7">LOC_FUZZY_SPACE</a></div><div class="ttdeci">#define LOC_FUZZY_SPACE</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00050">errcode.h:50</a></div></div>
<div class="ttc" id="a02358_html_ae48c51204ebe816f206908a0cae64924"><div class="ttname"><a href="a02358.html#ae48c51204ebe816f206908a0cae64924">tesseract::Tesseract::tessedit_fix_hyphens</a></div><div class="ttdeci">bool tessedit_fix_hyphens</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00870">tesseractclass.h:870</a></div></div>
<div class="ttc" id="a00194_html_adff672a9cdb59d57a0d142954a6a3899"><div class="ttname"><a href="a00194.html#adff672a9cdb59d57a0d142954a6a3899">debug_fp</a></div><div class="ttdeci">FILE * debug_fp</div><div class="ttdef"><b>Definition:</b> <a href="a00194_source.html#l00024">tessvars.cpp:24</a></div></div>
<div class="ttc" id="a02358_html_a0478ee100b826566b0b9ea048eee636e"><div class="ttname"><a href="a02358.html#a0478ee100b826566b0b9ea048eee636e">tesseract::Tesseract::LSTMRecognizeWord</a></div><div class="ttdeci">void LSTMRecognizeWord(const BLOCK &block, ROW *row, WERD_RES *word, PointerVector< WERD_RES > *words)</div><div class="ttdef"><b>Definition:</b> <a href="a00098_source.html#l00222">linerec.cpp:222</a></div></div>
<div class="ttc" id="a02358_html_ab92cd0aa3a10873a0ce6f28666063a2a"><div class="ttname"><a href="a02358.html#ab92cd0aa3a10873a0ce6f28666063a2a">tesseract::Tesseract::tessedit_rejection_debug</a></div><div class="ttdeci">bool tessedit_rejection_debug</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01065">tesseractclass.h:1065</a></div></div>
<div class="ttc" id="a02354_html_ab19dcdca65fe4c60d68bfe94cbf3a241"><div class="ttname"><a href="a02354.html#ab19dcdca65fe4c60d68bfe94cbf3a241">tesseract::WordData::block</a></div><div class="ttdeci">BLOCK * block</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00157">tesseractclass.h:157</a></div></div>
<div class="ttc" id="a02358_html_a8feb6e6d0d216514b3fa83ca2f4078e5"><div class="ttname"><a href="a02358.html#a8feb6e6d0d216514b3fa83ca2f4078e5">tesseract::Tesseract::quality_blob_pc</a></div><div class="ttdeci">double quality_blob_pc</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00906">tesseractclass.h:906</a></div></div>
<div class="ttc" id="a02610_html_a61af64df548c7638bf005fcd8343c435"><div class="ttname"><a href="a02610.html#a61af64df548c7638bf005fcd8343c435">TBOX::print</a></div><div class="ttdeci">void print() const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00278">rect.h:278</a></div></div>
<div class="ttc" id="a02826_html_a2844aee5a8b3f6f90835033fd2a049d0"><div class="ttname"><a href="a02826.html#a2844aee5a8b3f6f90835033fd2a049d0">SortHelper::Add</a></div><div class="ttdeci">void Add(T value, int count)</div><div class="ttdef"><b>Definition:</b> <a href="a00578_source.html#l00065">sorthelper.h:65</a></div></div>
<div class="ttc" id="a03998_html_a62597f182a5e23c3b8a030c06e699e99"><div class="ttname"><a href="a03998.html#a62597f182a5e23c3b8a030c06e699e99">tesseract::Classify::get_fontinfo_table</a></div><div class="ttdeci">UnicityTable< FontInfo > & get_fontinfo_table()</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00386">classify.h:386</a></div></div>
<div class="ttc" id="a02542_html_a15073b13b0b1fc7f06a5fe827f814fcc"><div class="ttname"><a href="a02542.html#a15073b13b0b1fc7f06a5fe827f814fcc">WERD_RES::italic</a></div><div class="ttdeci">int8_t italic</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00301">pageres.h:301</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="a02350_html_a67c192391f49973b1957ed2ad1dea79c"><div class="ttname"><a href="a02350.html#a67c192391f49973b1957ed2ad1dea79c">tesseract::TesseractStats::doc_blob_quality</a></div><div class="ttdeci">int16_t doc_blob_quality</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00131">tesseractclass.h:131</a></div></div>
<div class="ttc" id="a02350_html_a2ffb76e8ef50a240ee744901405252bc"><div class="ttname"><a href="a02350.html#a2ffb76e8ef50a240ee744901405252bc">tesseract::TesseractStats::dict_words</a></div><div class="ttdeci">int32_t dict_words</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00137">tesseractclass.h:137</a></div></div>
<div class="ttc" id="a02358_html_aa045a47d72bff5e7b987046483a3165f"><div class="ttname"><a href="a02358.html#aa045a47d72bff5e7b987046483a3165f">tesseract::Tesseract::tess_add_doc_word</a></div><div class="ttdeci">void tess_add_doc_word(WERD_CHOICE *word_choice)</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00072">tessbox.cpp:72</a></div></div>
<div class="ttc" id="a04778_html_a5a6c86ea0a618cf7642a8228fd7faab9"><div class="ttname"><a href="a04778.html#a5a6c86ea0a618cf7642a8228fd7faab9">ScrollView::ZoomToRectangle</a></div><div class="ttdeci">void ZoomToRectangle(int x1, int y1, int x2, int y2)</div><div class="ttdef"><b>Definition:</b> <a href="a01493_source.html#l00760">scrollview.cpp:760</a></div></div>
<div class="ttc" id="a02358_html_a889d9ac1b8ff48124d41e0d2254fad32"><div class="ttname"><a href="a02358.html#a889d9ac1b8ff48124d41e0d2254fad32">tesseract::Tesseract::tessedit_ocr_engine_mode</a></div><div class="ttdeci">int tessedit_ocr_engine_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00828">tesseractclass.h:828</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="a02638_html_a31a5b8f16e1629362369ba56a23c7cee"><div class="ttname"><a href="a02638.html#a31a5b8f16e1629362369ba56a23c7cee">WERD::ConstructFromSingleBlob</a></div><div class="ttdeci">WERD * ConstructFromSingleBlob(bool bol, bool eol, C_BLOB *blob)</div><div class="ttdef"><b>Definition:</b> <a href="a00446_source.html#l00136">werd.cpp:136</a></div></div>
<div class="ttc" id="a00878_html_acd4ea858d7133e40518e0832ff9d94b2"><div class="ttname"><a href="a00878.html#acd4ea858d7133e40518e0832ff9d94b2">count</a></div><div class="ttdeci">int count(LIST var_list)</div><div class="ttdef"><b>Definition:</b> <a href="a00878_source.html#l00098">oldlist.cpp:98</a></div></div>
<div class="ttc" id="a01541_html_aa3294a99fe8ad4b74a1e8577b89e3eff"><div class="ttname"><a href="a01541.html#aa3294a99fe8ad4b74a1e8577b89e3eff">clear_fx_win</a></div><div class="ttdeci">void clear_fx_win()</div><div class="ttdef"><b>Definition:</b> <a href="a01541_source.html#l00072">drawfx.cpp:72</a></div></div>
<div class="ttc" id="a02358_html_ad84163281c1fd2885741971d1b16396c"><div class="ttname"><a href="a02358.html#ad84163281c1fd2885741971d1b16396c">tesseract::Tesseract::noise_cert_disjoint</a></div><div class="ttdeci">double noise_cert_disjoint</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00891">tesseractclass.h:891</a></div></div>
<div class="ttc" id="a02618_html_a476689acf6a0c07a0f09452ef5ff79e8"><div class="ttname"><a href="a02618.html#a476689acf6a0c07a0f09452ef5ff79e8">REJMAP::full_print</a></div><div class="ttdeci">void full_print(FILE *fp)</div><div class="ttdef"><b>Definition:</b> <a href="a00410_source.html#l00335">rejctmap.cpp:335</a></div></div>
<div class="ttc" id="a02422_html"><div class="ttname"><a href="a02422.html">C_OUTLINE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00260_source.html#l00072">coutln.h:72</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="a02542_html_aaf98a52c29b1e11319d28b9698ac13fb"><div class="ttname"><a href="a02542.html#aaf98a52c29b1e11319d28b9698ac13fb">WERD_RES::GetBlobChoices</a></div><div class="ttdeci">BLOB_CHOICE_LIST * GetBlobChoices(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00765">pageres.cpp:765</a></div></div>
<div class="ttc" id="a02606_html_a7a606dd5236e78662fccade85d23edee"><div class="ttname"><a href="a02606.html#a7a606dd5236e78662fccade85d23edee">WERD_CHOICE::permuter</a></div><div class="ttdeci">uint8_t permuter() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00346">ratngs.h:346</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="a02638_html_af11dd59cfa4bd5e89818cb65c7a10b7c"><div class="ttname"><a href="a02638.html#af11dd59cfa4bd5e89818cb65c7a10b7c">WERD::GetNoiseOutlines</a></div><div class="ttdeci">void GetNoiseOutlines(GenericVector< C_OUTLINE *> *outlines)</div><div class="ttdef"><b>Definition:</b> <a href="a00446_source.html#l00529">werd.cpp:529</a></div></div>
<div class="ttc" id="a02358_html_a72e4cdd6e0cc37efe44413a4e1f495bd"><div class="ttname"><a href="a02358.html#a72e4cdd6e0cc37efe44413a4e1f495bd">tesseract::Tesseract::classify_word_pass1</a></div><div class="ttdeci">void classify_word_pass1(const WordData &word_data, WERD_RES **in_word, PointerVector< WERD_RES > *out_words)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01420">control.cpp:1420</a></div></div>
<div class="ttc" id="a02542_html_abb8291b971b0fbb6b51c8d7de7074a6f"><div class="ttname"><a href="a02542.html#abb8291b971b0fbb6b51c8d7de7074a6f">WERD_RES::fix_hyphens</a></div><div class="ttdeci">void fix_hyphens()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01053">pageres.cpp:1053</a></div></div>
<div class="ttc" id="a02350_html_aed6547bcdccb51746fec879eb70010c1"><div class="ttname"><a href="a02350.html#aed6547bcdccb51746fec879eb70010c1">tesseract::TesseractStats::good_char_count</a></div><div class="ttdeci">int16_t good_char_count</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00134">tesseractclass.h:134</a></div></div>
<div class="ttc" id="a02610_html_a06d060ef7951a2702eb3a1e5a6cbac7c"><div class="ttname"><a href="a02610.html#a06d060ef7951a2702eb3a1e5a6cbac7c">TBOX::x_overlap</a></div><div class="ttdeci">bool x_overlap(const TBOX &box) const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00401">rect.h:401</a></div></div>
<div class="ttc" id="a02402_html_abce755a2629864688cb259a780b01d24"><div class="ttname"><a href="a02402.html#abce755a2629864688cb259a780b01d24">TWERD::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00871">blobs.cpp:871</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_a69b602d95b2c2e94dae12140162b8848"><div class="ttname"><a href="a02358.html#a69b602d95b2c2e94dae12140162b8848">tesseract::Tesseract::tessedit_word_for_word</a></div><div class="ttdeci">bool tessedit_word_for_word</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01060">tesseractclass.h:1060</a></div></div>
<div class="ttc" id="a02358_html_a68f5ca69771b04373ed13ee1b3d8f18b"><div class="ttname"><a href="a02358.html#a68f5ca69771b04373ed13ee1b3d8f18b">tesseract::Tesseract::tessedit_debug_quality_metrics</a></div><div class="ttdeci">bool tessedit_debug_quality_metrics</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00962">tesseractclass.h:962</a></div></div>
<div class="ttc" id="a02358_html_a8952ab340e0f5e61992109e85cb1619c"><div class="ttname"><a href="a02358.html#a8952ab340e0f5e61992109e85cb1619c">tesseract::Tesseract::RetryWithLanguage</a></div><div class="ttdeci">int RetryWithLanguage(const WordData &word_data, WordRecognizer recognizer, bool debug, WERD_RES **in_word, PointerVector< WERD_RES > *best_words)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00910">control.cpp:910</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="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="a02358_html_adae1d6ea4f51b3c71902855714d8c091"><div class="ttname"><a href="a02358.html#adae1d6ea4f51b3c71902855714d8c091">tesseract::Tesseract::tessedit_timing_debug</a></div><div class="ttdeci">bool tessedit_timing_debug</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00865">tesseractclass.h:865</a></div></div>
<div class="ttc" id="a02358_html_a85331ba1dacadbd9d9e6246b279f8f97"><div class="ttname"><a href="a02358.html#a85331ba1dacadbd9d9e6246b279f8f97">tesseract::Tesseract::tessedit_dump_choices</a></div><div class="ttdeci">bool tessedit_dump_choices</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00864">tesseractclass.h:864</a></div></div>
<div class="ttc" id="a03998_html_a0d252009d9ff3f6997c27b533ea52550"><div class="ttname"><a href="a03998.html#a0d252009d9ff3f6997c27b533ea52550">tesseract::Classify::AdaptableWord</a></div><div class="ttdeci">bool AdaptableWord(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00823">adaptmatch.cpp:823</a></div></div>
<div class="ttc" id="a01541_html_ae31e31904810bc4e3407c2f324cf7edb"><div class="ttname"><a href="a01541.html#ae31e31904810bc4e3407c2f324cf7edb">create_fx_win</a></div><div class="ttdeci">void create_fx_win()</div><div class="ttdef"><b>Definition:</b> <a href="a01541_source.html#l00059">drawfx.cpp:59</a></div></div>
<div class="ttc" id="a01544_html"><div class="ttname"><a href="a01544.html">drawfx.h</a></div></div>
<div class="ttc" id="a02630_html_aec56187613797fe011b1f3b12021e0e1"><div class="ttname"><a href="a02630.html#aec56187613797fe011b1f3b12021e0e1">STATS::mode</a></div><div class="ttdeci">int32_t mode() const</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00114">statistc.cpp:114</a></div></div>
<div class="ttc" id="a02358_html_a41e9f6171e3dddf77b16fecab0016375"><div class="ttname"><a href="a02358.html#a41e9f6171e3dddf77b16fecab0016375">tesseract::Tesseract::tessedit_enable_bigram_correction</a></div><div class="ttdeci">bool tessedit_enable_bigram_correction</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00877">tesseractclass.h:877</a></div></div>
<div class="ttc" id="a02542_html_a37a6c598c67dcbcce6af7fbd6e2c595f"><div class="ttname"><a href="a02542.html#a37a6c598c67dcbcce6af7fbd6e2c595f">WERD_RES::fontinfo</a></div><div class="ttdeci">const FontInfo * fontinfo</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00304">pageres.h:304</a></div></div>
<div class="ttc" id="a02358_html_ad78f0499b8efaaa828b181fe318c72fb"><div class="ttname"><a href="a02358.html#ad78f0499b8efaaa828b181fe318c72fb">tesseract::Tesseract::set_word_fonts</a></div><div class="ttdeci">void set_word_fonts(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01981">control.cpp:1981</a></div></div>
<div class="ttc" id="a00503_html_a035b82243d07c39f12fcd8bf45a47493"><div class="ttname"><a href="a00503.html#a035b82243d07c39f12fcd8bf45a47493">LOC_DOC_BLK_REJ</a></div><div class="ttdeci">#define LOC_DOC_BLK_REJ</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00053">errcode.h:53</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="a02730_html_a6e86ffdfaba525c20e1a87c418ba980b"><div class="ttname"><a href="a02730.html#a6e86ffdfaba525c20e1a87c418ba980b">tesseract::PointerVector::truncate</a></div><div class="ttdeci">void truncate(int size)</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00497">genericvector.h:497</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="a00167_html"><div class="ttname"><a href="a00167.html">reject.h</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="a03998_html_a0a2c418c138725aa9fbd2bc9559d7c84"><div class="ttname"><a href="a03998.html#a0a2c418c138725aa9fbd2bc9559d7c84">tesseract::Classify::AdaptiveClassifierIsEmpty</a></div><div class="ttdeci">bool AdaptiveClassifierIsEmpty() const</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00326">classify.h:326</a></div></div>
<div class="ttc" id="a04290_html_a6b589339233b375b190427055e4ecf6c"><div class="ttname"><a href="a04290.html#a6b589339233b375b190427055e4ecf6c">tesseract::Dict::valid_bigram</a></div><div class="ttdeci">bool valid_bigram(const WERD_CHOICE &word1, const WERD_CHOICE &word2) const</div><div class="ttdef"><b>Definition:</b> <a href="a00905_source.html#l00787">dict.cpp:787</a></div></div>
<div class="ttc" id="a03950_html_aecb5fe27d6bc4bac136abf86c12dac7d"><div class="ttname"><a href="a03950.html#aecb5fe27d6bc4bac136abf86c12dac7d">UNICHARSET::script_has_xheight</a></div><div class="ttdeci">bool script_has_xheight() const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00898">unicharset.h:898</a></div></div>
<div class="ttc" id="a02730_html"><div class="ttname"><a href="a02730.html">tesseract::PointerVector< WERD_RES ></a></div></div>
<div class="ttc" id="a02630_html"><div class="ttname"><a href="a02630.html">STATS</a></div><div class="ttdef"><b>Definition:</b> <a href="a00431_source.html#l00033">statistc.h:33</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="a03998_html_ab51ed503c5a8490efaf909d7973880ed"><div class="ttname"><a href="a03998.html#ab51ed503c5a8490efaf909d7973880ed">tesseract::Classify::AdaptiveClassifierIsFull</a></div><div class="ttdeci">bool AdaptiveClassifierIsFull() const</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00325">classify.h:325</a></div></div>
<div class="ttc" id="a02370_html_aa9c239d91fa6c86b5f597addbed06ce1"><div class="ttname"><a href="a02370.html#aa9c239d91fa6c86b5f597addbed06ce1">BlamerBundle::CopyTruth</a></div><div class="ttdeci">void CopyTruth(const BlamerBundle &other)</div><div class="ttdef"><b>Definition:</b> <a href="a00218_source.html#l00199">blamer.h:199</a></div></div>
<div class="ttc" id="a02458_html_ac0ed297774ba680aa307bf0866b0d6c4"><div class="ttname"><a href="a02458.html#ac0ed297774ba680aa307bf0866b0d6c4">tesseract::FontInfo::is_bold</a></div><div class="ttdeci">bool is_bold() const</div><div class="ttdef"><b>Definition:</b> <a href="a00284_source.html#l00112">fontinfo.h:112</a></div></div>
<div class="ttc" id="a02638_html_a0c26b86030e756d76e2425b1d2daf908"><div class="ttname"><a href="a02638.html#a0c26b86030e756d76e2425b1d2daf908">WERD::rej_cblob_list</a></div><div class="ttdeci">C_BLOB_LIST * rej_cblob_list()</div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00093">werd.h:93</a></div></div>
<div class="ttc" id="a02358_html_a6c90c990768b60d5c9fb3148edaf70e9"><div class="ttname"><a href="a02358.html#a6c90c990768b60d5c9fb3148edaf70e9">tesseract::Tesseract::tessedit_minimal_rej_pass1</a></div><div class="ttdeci">bool tessedit_minimal_rej_pass1</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00914">tesseractclass.h:914</a></div></div>
<div class="ttc" id="a02786_html_a3b103545a36543dd4f16c496838d99eb"><div class="ttname"><a href="a02786.html#a3b103545a36543dd4f16c496838d99eb">ETEXT_DESC::ocr_alive</a></div><div class="ttdeci">volatile int8_t ocr_alive</div><div class="ttdoc">true if not last </div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00127">ocrclass.h:127</a></div></div>
<div class="ttc" id="a02358_html_a823125104b6a53995352959ba68eda74"><div class="ttname"><a href="a02358.html#a823125104b6a53995352959ba68eda74">tesseract::Tesseract::SubAndSuperscriptFix</a></div><div class="ttdeci">bool SubAndSuperscriptFix(WERD_RES *word_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00176_source.html#l00102">superscript.cpp:102</a></div></div>
<div class="ttc" id="a02542_html_afd3a82dce3b9d8af86fe10a2eb117ce1"><div class="ttname"><a href="a02542.html#afd3a82dce3b9d8af86fe10a2eb117ce1">WERD_RES::baseline_shift</a></div><div class="ttdeci">float baseline_shift</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00313">pageres.h:313</a></div></div>
<div class="ttc" id="a02370_html_ab8943bffa947612e66873bc8b7b94b27"><div class="ttname"><a href="a02370.html#ab8943bffa947612e66873bc8b7b94b27">BlamerBundle::IncorrectReasonName</a></div><div class="ttdeci">static const char * IncorrectReasonName(IncorrectResultReason irr)</div><div class="ttdef"><b>Definition:</b> <a href="a00215_source.html#l00061">blamer.cpp:61</a></div></div>
<div class="ttc" id="a02606_html_a0e746a8089d60f66d712573b441e961b"><div class="ttname"><a href="a02606.html#a0e746a8089d60f66d712573b441e961b">WERD_CHOICE::shallow_copy</a></div><div class="ttdeci">WERD_CHOICE shallow_copy(int start, int end) const</div><div class="ttdef"><b>Definition:</b> <a href="a00398_source.html#l00414">ratngs.cpp:414</a></div></div>
<div class="ttc" id="a04778_html_a0830a51981a20c8700b5ec49137e46e9"><div class="ttname"><a href="a04778.html#a0830a51981a20c8700b5ec49137e46e9">ScrollView::Update</a></div><div class="ttdeci">static void Update()</div><div class="ttdef"><b>Definition:</b> <a href="a01493_source.html#l00711">scrollview.cpp:711</a></div></div>
<div class="ttc" id="a03950_html"><div class="ttname"><a href="a03950.html">UNICHARSET</a></div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00146">unicharset.h:146</a></div></div>
<div class="ttc" id="a02370_html_a8cd8f387ec0049639db990b4ceae5c89"><div class="ttname"><a href="a02370.html#a8cd8f387ec0049639db990b4ceae5c89">BlamerBundle::SetMisAdaptionDebug</a></div><div class="ttdeci">void SetMisAdaptionDebug(const WERD_CHOICE *best_choice, bool debug)</div><div class="ttdef"><b>Definition:</b> <a href="a00215_source.html#l00579">blamer.cpp:579</a></div></div>
<div class="ttc" id="a02182_html_a48b82547ebbaa5fedecfdebe7e2f155a"><div class="ttname"><a href="a02182.html#a48b82547ebbaa5fedecfdebe7e2f155a">GenericVector::back</a></div><div class="ttdeci">T & back() const</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00730">genericvector.h:730</a></div></div>
<div class="ttc" id="a02358_html_a05f11182c05c592d3e17d836686f022f"><div class="ttname"><a href="a02358.html#a05f11182c05c592d3e17d836686f022f">tesseract::Tesseract::test_pt_y</a></div><div class="ttdeci">double test_pt_y</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00921">tesseractclass.h:921</a></div></div>
<div class="ttc" id="a02358_html_ab9f43297023769eb21510a8f4a98f69f"><div class="ttname"><a href="a02358.html#ab9f43297023769eb21510a8f4a98f69f">tesseract::Tesseract::chs_trailing_punct2</a></div><div class="ttdeci">char * chs_trailing_punct2</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00904">tesseractclass.h:904</a></div></div>
<div class="ttc" id="a02358_html_aec5d4e081fee6da40258b0b074342205"><div class="ttname"><a href="a02358.html#aec5d4e081fee6da40258b0b074342205">tesseract::Tesseract::BestPix</a></div><div class="ttdeci">Pix * BestPix() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00229">tesseractclass.h:229</a></div></div>
<div class="ttc" id="a02542_html_a9396676a933d148c488dcc0a723bb199"><div class="ttname"><a href="a02542.html#a9396676a933d148c488dcc0a723bb199">WERD_RES::SetScriptPositions</a></div><div class="ttdeci">void SetScriptPositions()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00864">pageres.cpp:864</a></div></div>
<div class="ttc" id="a02358_html_a5da2276e5c64aaf048acf9e65a4f7a75"><div class="ttname"><a href="a02358.html#a5da2276e5c64aaf048acf9e65a4f7a75">tesseract::Tesseract::noise_cert_punc</a></div><div class="ttdeci">double noise_cert_punc</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00894">tesseractclass.h:894</a></div></div>
<div class="ttc" id="a02542_html_a3583f31731a0399b098394abd6f1dcdc"><div class="ttname"><a href="a02542.html#a3583f31731a0399b098394abd6f1dcdc">WERD_RES::fontinfo_id2_count</a></div><div class="ttdeci">int8_t fontinfo_id2_count</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00307">pageres.h:307</a></div></div>
<div class="ttc" id="a02542_html_ac14d59010b792d434b39e991b0c8a962"><div class="ttname"><a href="a02542.html#ac14d59010b792d434b39e991b0c8a962">WERD_RES::small_caps</a></div><div class="ttdeci">bool small_caps</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00299">pageres.h:299</a></div></div>
<div class="ttc" id="a02354_html_abb1834fafca588a45c64bebcfad8e795"><div class="ttname"><a href="a02354.html#abb1834fafca588a45c64bebcfad8e795">tesseract::WordData::lang_words</a></div><div class="ttdeci">PointerVector< WERD_RES > lang_words</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00159">tesseractclass.h:159</a></div></div>
<div class="ttc" id="a02546_html_a373f92e21392e8a929bb88f17d6b63e1"><div class="ttname"><a href="a02546.html#a373f92e21392e8a929bb88f17d6b63e1">PAGE_RES_IT::ResetWordIterator</a></div><div class="ttdeci">void ResetWordIterator()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01533">pageres.cpp:1533</a></div></div>
<div class="ttc" id="a02358_html_a991cd3e6b917b850d7cccb7df1fabfa5"><div class="ttname"><a href="a02358.html#a991cd3e6b917b850d7cccb7df1fabfa5">tesseract::Tesseract::quality_min_initial_alphas_reqd</a></div><div class="ttdeci">int quality_min_initial_alphas_reqd</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00910">tesseractclass.h:910</a></div></div>
<div class="ttc" id="a02358_html_a06a50ff442548e63afcdc9dcddb73817"><div class="ttname"><a href="a02358.html#a06a50ff442548e63afcdc9dcddb73817">tesseract::Tesseract::noise_cert_factor</a></div><div class="ttdeci">double noise_cert_factor</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00897">tesseractclass.h:897</a></div></div>
<div class="ttc" id="a02542_html_a5fba3dcf00c81b9032ef9a0cad32b3ec"><div class="ttname"><a href="a02542.html#a5fba3dcf00c81b9032ef9a0cad32b3ec">WERD_RES::IsAmbiguous</a></div><div class="ttdeci">bool IsAmbiguous()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00458">pageres.cpp:458</a></div></div>
<div class="ttc" id="a02606_html_ad5de9fce903ff6d884e60a639f750367"><div class="ttname"><a href="a02606.html#ad5de9fce903ff6d884e60a639f750367">WERD_CHOICE::max_x_height</a></div><div class="ttdeci">float max_x_height() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00339">ratngs.h:339</a></div></div>
<div class="ttc" id="a02358_html_a13ea89e3142b76dfa3ff40d24f333578"><div class="ttname"><a href="a02358.html#a13ea89e3142b76dfa3ff40d24f333578">tesseract::Tesseract::match_word_pass_n</a></div><div class="ttdeci">void match_word_pass_n(int pass_n, WERD_RES *word, ROW *row, BLOCK *block)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01649">control.cpp:1649</a></div></div>
<div class="ttc" id="a02358_html_ad0d6e09c6386cb0d6d1bc4a34beb23fa"><div class="ttname"><a href="a02358.html#ad0d6e09c6386cb0d6d1bc4a34beb23fa">tesseract::Tesseract::word_blob_quality</a></div><div class="ttdeci">int16_t word_blob_quality(WERD_RES *word, ROW *row)</div><div class="ttdef"><b>Definition:</b> <a href="a00077_source.html#l00061">docqual.cpp:61</a></div></div>
<div class="ttc" id="a01629_html_a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b"><div class="ttname"><a href="a01629.html#a04550a0ed1279562027bf2fc92c421aead84e1ef94e50df1622b4fcd189c6c00b">tesseract::OEM_LSTM_ONLY</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00270">publictypes.h:270</a></div></div>
<div class="ttc" id="a00875_html"><div class="ttname"><a href="a00875.html">globals.h</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="a02638_html_a5a2d228e15200b7535fac2144109b677"><div class="ttname"><a href="a02638.html#a5a2d228e15200b7535fac2144109b677">WERD::print</a></div><div class="ttdeci">void print()</div><div class="ttdef"><b>Definition:</b> <a href="a00446_source.html#l00265">werd.cpp:265</a></div></div>
<div class="ttc" id="a02358_html_a886bd9a9910c385d5c1a38a7c340d2b2"><div class="ttname"><a href="a02358.html#a886bd9a9910c385d5c1a38a7c340d2b2">tesseract::Tesseract::quality_rej_pc</a></div><div class="ttdeci">double quality_rej_pc</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00905">tesseractclass.h:905</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="a02638_html_a2fb1e087221cb657546cba853dcc6732"><div class="ttname"><a href="a02638.html#a2fb1e087221cb657546cba853dcc6732">WERD::AddSelectedOutlines</a></div><div class="ttdeci">bool AddSelectedOutlines(const GenericVector< bool > &wanted, const GenericVector< C_BLOB *> &target_blobs, const GenericVector< C_OUTLINE *> &outlines, bool *make_next_word_fuzzy)</div><div class="ttdef"><b>Definition:</b> <a href="a00446_source.html#l00547">werd.cpp:547</a></div></div>
<div class="ttc" id="a02542_html_a157b8504ddf7ff46910697a59c219bde"><div class="ttname"><a href="a02542.html#a157b8504ddf7ff46910697a59c219bde">WERD_RES::tess_would_adapt</a></div><div class="ttdeci">bool tess_would_adapt</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00297">pageres.h:297</a></div></div>
<div class="ttc" id="a02358_html_a8c1e482784c433ed2d49d2da708a3d29"><div class="ttname"><a href="a02358.html#a8c1e482784c433ed2d49d2da708a3d29">tesseract::Tesseract::tessedit_enable_doc_dict</a></div><div class="ttdeci">bool tessedit_enable_doc_dict</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00873">tesseractclass.h:873</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="a02546_html_a1d1af03a63da4b7f551770e07ca86414"><div class="ttname"><a href="a02546.html#a1d1af03a63da4b7f551770e07ca86414">PAGE_RES_IT::rej_stat_word</a></div><div class="ttdeci">void rej_stat_word()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01674">pageres.cpp:1674</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="a02358_html_a8ecdf25c9fe0f5c122081a3956a96720"><div class="ttname"><a href="a02358.html#a8ecdf25c9fe0f5c122081a3956a96720">tesseract::Tesseract::chs_leading_punct</a></div><div class="ttdeci">char * chs_leading_punct</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00902">tesseractclass.h:902</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeea7bae128b501c1b34213e7ce6b17f7988"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea7bae128b501c1b34213e7ce6b17f7988">AC_LC_ABBREV</a></div><div class="ttdoc">a.b.c. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00034">control.h:34</a></div></div>
<div class="ttc" id="a02358_html_a4442b2aaadb400453163da233cdd4c5c"><div class="ttname"><a href="a02358.html#a4442b2aaadb400453163da233cdd4c5c">tesseract::Tesseract::tessedit_test_adaption</a></div><div class="ttdeci">bool tessedit_test_adaption</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00915">tesseractclass.h:915</a></div></div>
<div class="ttc" id="a02354_html_ab189fc52942daf7523d8a38c4f89dc03"><div class="ttname"><a href="a02354.html#ab189fc52942daf7523d8a38c4f89dc03">tesseract::WordData::word</a></div><div class="ttdeci">WERD_RES * word</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00155">tesseractclass.h:155</a></div></div>
<div class="ttc" id="a02358_html_ac5790042616434be2d95f33dc62f9c04"><div class="ttname"><a href="a02358.html#ac5790042616434be2d95f33dc62f9c04">tesseract::Tesseract::ProcessTargetWord</a></div><div class="ttdeci">bool ProcessTargetWord(const TBOX &word_box, const TBOX &target_word_box, const char *word_config, int pass)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00125">control.cpp:125</a></div></div>
<div class="ttc" id="a02606_html_aea0fc2f641f1332d4079bb57bc1f14ab"><div class="ttname"><a href="a02606.html#aea0fc2f641f1332d4079bb57bc1f14ab">WERD_CHOICE::GetNonSuperscriptSpan</a></div><div class="ttdeci">void GetNonSuperscriptSpan(int *start, int *end) const</div><div class="ttdef"><b>Definition:</b> <a href="a00398_source.html#l00397">ratngs.cpp:397</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="a02458_html_a948c9f88952c8c48ca5fa37fb33085d8"><div class="ttname"><a href="a02458.html#a948c9f88952c8c48ca5fa37fb33085d8">tesseract::FontInfo::name</a></div><div class="ttdeci">char * name</div><div class="ttdef"><b>Definition:</b> <a href="a00284_source.html#l00117">fontinfo.h:117</a></div></div>
<div class="ttc" id="a02358_html_a691620dfdff9adbe43d2631589c91eaf"><div class="ttname"><a href="a02358.html#a691620dfdff9adbe43d2631589c91eaf">tesseract::Tesseract::TestNewNormalization</a></div><div class="ttdeci">bool TestNewNormalization(int original_misfits, float baseline_shift, float new_x_ht, WERD_RES *word, BLOCK *block, ROW *row)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01538">control.cpp:1538</a></div></div>
<div class="ttc" id="a02358_html_afefbce16d3525d8790755bb9070ecf0b"><div class="ttname"><a href="a02358.html#afefbce16d3525d8790755bb9070ecf0b">tesseract::Tesseract::ReportXhtFixResult</a></div><div class="ttdeci">void ReportXhtFixResult(bool accept_new_word, float new_x_ht, WERD_RES *word, WERD_RES *new_word)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01481">control.cpp:1481</a></div></div>
<div class="ttc" id="a00503_html_aab54db69aaf3fd317086ea2ee52ffa5d"><div class="ttname"><a href="a00503.html#aab54db69aaf3fd317086ea2ee52ffa5d">LOC_WRITE_RESULTS</a></div><div class="ttdeci">#define LOC_WRITE_RESULTS</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00054">errcode.h:54</a></div></div>
<div class="ttc" id="a02182_html"><div class="ttname"><a href="a02182.html">GenericVector</a></div><div class="ttdef"><b>Definition:</b> <a href="a00008_source.html#l00037">baseapi.h:37</a></div></div>
<div class="ttc" id="a02582_html"><div class="ttname"><a href="a02582.html">POLY_BLOCK</a></div><div class="ttdef"><b>Definition:</b> <a href="a00374_source.html#l00027">polyblk.h:27</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="a00212_html"><div class="ttname"><a href="a00212.html">werdit.h</a></div></div>
<div class="ttc" id="a01629_html_ac50ad7dad904ed14e81cd29a3bfdb82d"><div class="ttname"><a href="a01629.html#ac50ad7dad904ed14e81cd29a3bfdb82d">tesseract::WordRecognizer</a></div><div class="ttdeci">void(Tesseract::* WordRecognizer)(const WordData &word_data, WERD_RES **in_word, PointerVector< WERD_RES > *out_words)</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00169">tesseractclass.h:169</a></div></div>
<div class="ttc" id="a02350_html_a920c51d67fd617d9bf3684693723675c"><div class="ttname"><a href="a02350.html#a920c51d67fd617d9bf3684693723675c">tesseract::TesseractStats::doc_char_quality</a></div><div class="ttdeci">int16_t doc_char_quality</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00133">tesseractclass.h:133</a></div></div>
<div class="ttc" id="a02370_html"><div class="ttname"><a href="a02370.html">BlamerBundle</a></div><div class="ttdef"><b>Definition:</b> <a href="a00218_source.html#l00100">blamer.h:100</a></div></div>
<div class="ttc" id="a02358_html_ad60055acf007ba8d471935ee5ec50543"><div class="ttname"><a href="a02358.html#ad60055acf007ba8d471935ee5ec50543">tesseract::Tesseract::word_adaptable</a></div><div class="ttdeci">bool word_adaptable(WERD_RES *word, uint16_t mode)</div><div class="ttdef"><b>Definition:</b> <a href="a00065_source.html#l00035">adaptions.cpp:35</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="a02358_html_ae6ced41202a774688e1c29e27fda712c"><div class="ttname"><a href="a02358.html#ae6ced41202a774688e1c29e27fda712c">tesseract::Tesseract::script_pos_pass</a></div><div class="ttdeci">void script_pos_pass(PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00740">control.cpp:740</a></div></div>
<div class="ttc" id="a02542_html_ad6811048a1a3a210905ec907233defd1"><div class="ttname"><a href="a02542.html#ad6811048a1a3a210905ec907233defd1">WERD_RES::fix_quotes</a></div><div class="ttdeci">void fix_quotes()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01024">pageres.cpp:1024</a></div></div>
<div class="ttc" id="a02618_html_a2ddec73fd1a7288568496353d75a00e8"><div class="ttname"><a href="a02618.html#a2ddec73fd1a7288568496353d75a00e8">REJMAP::reject_count</a></div><div class="ttdeci">int16_t reject_count()</div><div class="ttdef"><b>Definition:</b> <a href="a00413_source.html#l00229">rejctmap.h:229</a></div></div>
<div class="ttc" id="a02542_html_a5d887fd12d885c0575559a66f292d128"><div class="ttname"><a href="a02542.html#a5d887fd12d885c0575559a66f292d128">WERD_RES::PrintBestChoices</a></div><div class="ttdeci">void PrintBestChoices() const</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00723">pageres.cpp:723</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="a02182_html_a069bfd13dc842908a6355ad918b9c7f4"><div class="ttname"><a href="a02182.html#a069bfd13dc842908a6355ad918b9c7f4">GenericVector::init_to_size</a></div><div class="ttdeci">void init_to_size(int size, const T &t)</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00708">genericvector.h:708</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="a02358_html_a5873c7054e8cba3e64fc3f20b2a93ca3"><div class="ttname"><a href="a02358.html#a5873c7054e8cba3e64fc3f20b2a93ca3">tesseract::Tesseract::textord_use_cjk_fp_model</a></div><div class="ttdeci">bool textord_use_cjk_fp_model</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01101">tesseractclass.h:1101</a></div></div>
<div class="ttc" id="a02458_html_a32425f25da06fd353479d9406c0b969a"><div class="ttname"><a href="a02458.html#a32425f25da06fd353479d9406c0b969a">tesseract::FontInfo::is_italic</a></div><div class="ttdeci">bool is_italic() const</div><div class="ttdef"><b>Definition:</b> <a href="a00284_source.html#l00111">fontinfo.h:111</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="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeea6d37e3775faa628c72b7953f89caeb22"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea6d37e3775faa628c72b7953f89caeb22">AC_UC_ABBREV</a></div><div class="ttdoc">A.B.C. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00035">control.h:35</a></div></div>
<div class="ttc" id="a02350_html_a78080370c4ae37371b06b410878b87fd"><div class="ttname"><a href="a02350.html#a78080370c4ae37371b06b410878b87fd">tesseract::TesseractStats::doc_good_char_quality</a></div><div class="ttdeci">int16_t doc_good_char_quality</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00135">tesseractclass.h:135</a></div></div>
<div class="ttc" id="a00158_html"><div class="ttname"><a href="a00158.html">pgedit.h</a></div></div>
<div class="ttc" id="a02542_html_aab88c163b4ef9e6a147222f2ec981a9c"><div class="ttname"><a href="a02542.html#aab88c163b4ef9e6a147222f2ec981a9c">WERD_RES::bold</a></div><div class="ttdeci">int8_t bold</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00302">pageres.h:302</a></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="a02610_html_ade947e3871fa316e3e0b0864905c2997"><div class="ttname"><a href="a02610.html#ade947e3871fa316e3e0b0864905c2997">TBOX::major_x_overlap</a></div><div class="ttdeci">bool major_x_overlap(const TBOX &box) const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00412">rect.h:412</a></div></div>
<div class="ttc" id="a02786_html_a84e8d7c830a6b08ad1ebdbdf872c887a"><div class="ttname"><a href="a02786.html#a84e8d7c830a6b08ad1ebdbdf872c887a">ETEXT_DESC::deadline_exceeded</a></div><div class="ttdeci">bool deadline_exceeded() const</div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00164">ocrclass.h:164</a></div></div>
<div class="ttc" id="a02370_html_abc20fe96d8a4c62d877d87a3682658d6"><div class="ttname"><a href="a02370.html#abc20fe96d8a4c62d877d87a3682658d6">BlamerBundle::incorrect_result_reason</a></div><div class="ttdeci">IncorrectResultReason incorrect_result_reason() const</div><div class="ttdef"><b>Definition:</b> <a href="a00218_source.html#l00118">blamer.h:118</a></div></div>
<div class="ttc" id="a03950_html_ac1148cef18a324b1c1eeffaf354ab80f"><div class="ttname"><a href="a03950.html#ac1148cef18a324b1c1eeffaf354ab80f">UNICHARSET::debug_str</a></div><div class="ttdeci">STRING debug_str(UNICHAR_ID id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00620_source.html#l00342">unicharset.cpp:342</a></div></div>
<div class="ttc" id="a02358_html_a36528329a2255d819b87c7d0962a23c4"><div class="ttname"><a href="a02358.html#a36528329a2255d819b87c7d0962a23c4">tesseract::Tesseract::noise_maxperword</a></div><div class="ttdeci">int noise_maxperword</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00899">tesseractclass.h:899</a></div></div>
<div class="ttc" id="a02358_html_ae4177172ea8b2b5f0f4282927f0073e4"><div class="ttname"><a href="a02358.html#ae4177172ea8b2b5f0f4282927f0073e4">tesseract::Tesseract::right_to_left</a></div><div class="ttdeci">bool right_to_left() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00270">tesseractclass.h:270</a></div></div>
<div class="ttc" id="a02794_html_a0709ab180ade22613925bc317ddf34b7"><div class="ttname"><a href="a02794.html#a0709ab180ade22613925bc317ddf34b7">tesseract::ParamUtils::ReadParamsFile</a></div><div class="ttdeci">static bool ReadParamsFile(const char *file, SetParamConstraint constraint, ParamsVectors *member_params)</div><div class="ttdef"><b>Definition:</b> <a href="a00554_source.html#l00039">params.cpp:39</a></div></div>
<div class="ttc" id="a02542_html_aa7f56655eb0e5164f2d2e85906475cb1"><div class="ttname"><a href="a02542.html#aa7f56655eb0e5164f2d2e85906475cb1">WERD_RES::tess_accepted</a></div><div class="ttdeci">bool tess_accepted</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00296">pageres.h:296</a></div></div>
<div class="ttc" id="a02358_html_a5439cd8199c72bfc34530cc41c252a64"><div class="ttname"><a href="a02358.html#a5439cd8199c72bfc34530cc41c252a64">tesseract::Tesseract::test_pt</a></div><div class="ttdeci">bool test_pt</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00919">tesseractclass.h:919</a></div></div>
<div class="ttc" id="a02358_html_abcefdada877f6fa25c95baf4e1fad9c4"><div class="ttname"><a href="a02358.html#abcefdada877f6fa25c95baf4e1fad9c4">tesseract::Tesseract::debug_x_ht_level</a></div><div class="ttdeci">int debug_x_ht_level</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00900">tesseractclass.h:900</a></div></div>
<div class="ttc" id="a00071_html_a91ae9908e7c8f49bf292bbdd6678230e"><div class="ttname"><a href="a00071.html#a91ae9908e7c8f49bf292bbdd6678230e">kMinRefitXHeightFraction</a></div><div class="ttdeci">const double kMinRefitXHeightFraction</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00056">control.cpp:56</a></div></div>
<div class="ttc" id="a02358_html_a06f65b0780b3a888457de0752113cfd5"><div class="ttname"><a href="a02358.html#a06f65b0780b3a888457de0752113cfd5">tesseract::Tesseract::tessedit_fix_fuzzy_spaces</a></div><div class="ttdeci">bool tessedit_fix_fuzzy_spaces</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00867">tesseractclass.h:867</a></div></div>
<div class="ttc" id="a02602_html_ab8179e5026a2b8f06f68b8efd5efc883"><div class="ttname"><a href="a02602.html#ab8179e5026a2b8f06f68b8efd5efc883">BLOB_CHOICE::fonts</a></div><div class="ttdeci">const GenericVector< tesseract::ScoredFont > & fonts() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00092">ratngs.h:92</a></div></div>
<div class="ttc" id="a03998_html_a03c6f57fc6ce80fc38c2229836f52a37"><div class="ttname"><a href="a03998.html#a03c6f57fc6ce80fc38c2229836f52a37">tesseract::Classify::classify_max_rating_ratio</a></div><div class="ttdeci">double classify_max_rating_ratio</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00443">classify.h:443</a></div></div>
<div class="ttc" id="a02514_html_aa41ae9661d53570dd6365d3ac8ac4c15"><div class="ttname"><a href="a02514.html#aa41ae9661d53570dd6365d3ac8ac4c15">BLOCK::classify_rotation</a></div><div class="ttdeci">FCOORD classify_rotation() const</div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00142">ocrblock.h:142</a></div></div>
<div class="ttc" id="a02182_html_a6af4e0a2a30dda267d19bf783ae22eb7"><div class="ttname"><a href="a02182.html#a6af4e0a2a30dda267d19bf783ae22eb7">GenericVector::length</a></div><div class="ttdeci">int length() const</div><div class="ttdef"><b>Definition:</b> <a href="a00518_source.html#l00085">genericvector.h:85</a></div></div>
<div class="ttc" id="a02358_html_af9405001d9b64c8716e6cdc01eb448f0"><div class="ttname"><a href="a02358.html#af9405001d9b64c8716e6cdc01eb448f0">tesseract::Tesseract::make_reject_map</a></div><div class="ttdeci">void make_reject_map(WERD_RES *word, ROW *row, int16_t pass)</div></div>
<div class="ttc" id="a02402_html_afe89f2f31b48fa578028f2527b55e144"><div class="ttname"><a href="a02402.html#afe89f2f31b48fa578028f2527b55e144">TWERD::plot</a></div><div class="ttdeci">void plot(ScrollView *window)</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00907">blobs.cpp:907</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="a02542_html_adac960c00c2ae389886c91af9882ae00"><div class="ttname"><a href="a02542.html#adac960c00c2ae389886c91af9882ae00">WERD_RES::SetupForRecognition</a></div><div class="ttdeci">bool SetupForRecognition(const UNICHARSET &unicharset_in, tesseract::Tesseract *tesseract, Pix *pix, int norm_mode, const TBOX *norm_box, bool numeric_mode, bool use_body_size, bool allow_detailed_fx, ROW *row, const BLOCK *block)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00308">pageres.cpp:308</a></div></div>
<div class="ttc" id="a02558_html_a87856f8400f0629dc761fec0f7a17b57"><div class="ttname"><a href="a02558.html#a87856f8400f0629dc761fec0f7a17b57">PDBLK::poly_block</a></div><div class="ttdeci">POLY_BLOCK * poly_block() const</div><div class="ttdef"><b>Definition:</b> <a href="a00356_source.html#l00056">pdblock.h:56</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="a02358_html_a90fbdb46a983a7da9a3625a8e5a5fe5a"><div class="ttname"><a href="a02358.html#a90fbdb46a983a7da9a3625a8e5a5fe5a">tesseract::Tesseract::quality_char_pc</a></div><div class="ttdeci">double quality_char_pc</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00909">tesseractclass.h:909</a></div></div>
<div class="ttc" id="a02358_html_ad9642eb80c64d2a28542c15a9fc7d297"><div class="ttname"><a href="a02358.html#ad9642eb80c64d2a28542c15a9fc7d297">tesseract::Tesseract::tessedit_bigram_debug</a></div><div class="ttdeci">int tessedit_bigram_debug</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00881">tesseractclass.h:881</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="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="a02542_html_ad0c2fc4f0aea1e5cf9b5f4789b05f3e4"><div class="ttname"><a href="a02542.html#ad0c2fc4f0aea1e5cf9b5f4789b05f3e4">WERD_RES::fontinfo_id_count</a></div><div class="ttdeci">int8_t fontinfo_id_count</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00306">pageres.h:306</a></div></div>
<div class="ttc" id="a02358_html_a4a426a366547fd63b58db52447f9840a"><div class="ttname"><a href="a02358.html#a4a426a366547fd63b58db52447f9840a">tesseract::Tesseract::tessedit_reject_bad_qual_wds</a></div><div class="ttdeci">bool tessedit_reject_bad_qual_wds</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00959">tesseractclass.h:959</a></div></div>
<div class="ttc" id="a02606_html_a76b18095a88a05db299aa84451a5f52c"><div class="ttname"><a href="a02606.html#a76b18095a88a05db299aa84451a5f52c">WERD_CHOICE::unichar_id</a></div><div class="ttdeci">UNICHAR_ID unichar_id(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00315">ratngs.h:315</a></div></div>
<div class="ttc" id="a02826_html"><div class="ttname"><a href="a02826.html">SortHelper</a></div><div class="ttdef"><b>Definition:</b> <a href="a00578_source.html#l00036">sorthelper.h:36</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="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="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="a02358_html_a37bfb6999dc3b5d05d4eeafa38571d9f"><div class="ttname"><a href="a02358.html#a37bfb6999dc3b5d05d4eeafa38571d9f">tesseract::Tesseract::word_outline_errs</a></div><div class="ttdeci">int16_t word_outline_errs(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00077_source.html#l00073">docqual.cpp:73</a></div></div>
<div class="ttc" id="a02530_html_ad89f8ec4b63b4650cd9c35eb1eb82ca7"><div class="ttname"><a href="a02530.html#ad89f8ec4b63b4650cd9c35eb1eb82ca7">PAGE_RES::char_count</a></div><div class="ttdeci">int32_t char_count</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00079">pageres.h:79</a></div></div>
<div class="ttc" id="a02582_html_a4eb55be5fc2ed33312e4410f5ee2cf88"><div class="ttname"><a href="a02582.html#a4eb55be5fc2ed33312e4410f5ee2cf88">POLY_BLOCK::IsText</a></div><div class="ttdeci">bool IsText() const</div><div class="ttdef"><b>Definition:</b> <a href="a00374_source.html#l00049">polyblk.h:49</a></div></div>
<div class="ttc" id="a02358_html_a51f2ad8b2d849d90bbcfbfca3067c0f1"><div class="ttname"><a href="a02358.html#a51f2ad8b2d849d90bbcfbfca3067c0f1">tesseract::Tesseract::acceptable_word_string</a></div><div class="ttdeci">ACCEPTABLE_WERD_TYPE acceptable_word_string(const UNICHARSET &char_set, const char *s, const char *lengths)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01764">control.cpp:1764</a></div></div>
<div class="ttc" id="a00578_html"><div class="ttname"><a href="a00578.html">sorthelper.h</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="a02546_html_aab221a373111c4be685444b5633e22a5"><div class="ttname"><a href="a02546.html#aab221a373111c4be685444b5633e22a5">PAGE_RES_IT::page_res</a></div><div class="ttdeci">PAGE_RES * page_res</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00677">pageres.h:677</a></div></div>
<div class="ttc" id="a02638_html_a174baefaa99afbfdbf444e4199f3b529"><div class="ttname"><a href="a02638.html#a174baefaa99afbfdbf444e4199f3b529">WERD::cblob_list</a></div><div class="ttdeci">C_BLOB_LIST * cblob_list()</div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00098">werd.h:98</a></div></div>
<div class="ttc" id="a02542_html_aea384afb374c13829bfaab3efa5eafa0"><div class="ttname"><a href="a02542.html#aea384afb374c13829bfaab3efa5eafa0">WERD_RES::caps_height</a></div><div class="ttdeci">float caps_height</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00312">pageres.h:312</a></div></div>
<div class="ttc" id="a00398_html_a98992670ff5a4da6695f318643d48ca4"><div class="ttname"><a href="a00398.html#a98992670ff5a4da6695f318643d48ca4">EqualIgnoringCaseAndTerminalPunct</a></div><div class="ttdeci">bool EqualIgnoringCaseAndTerminalPunct(const WERD_CHOICE &word1, const WERD_CHOICE &word2)</div><div class="ttdef"><b>Definition:</b> <a href="a00398_source.html#l00808">ratngs.cpp:808</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeea71786bea8ae4bacc2670610dde24e707"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeea71786bea8ae4bacc2670610dde24e707">AC_INITIAL_CAP</a></div><div class="ttdoc">ALL but initial lc. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00033">control.h:33</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="a02630_html_a5ce26a26c81c69a3e27616669998abe2"><div class="ttname"><a href="a02630.html#a5ce26a26c81c69a3e27616669998abe2">STATS::add</a></div><div class="ttdeci">void add(int32_t value, int32_t count)</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00100">statistc.cpp:100</a></div></div>
<div class="ttc" id="a02606_html_acb9b3195ec05dbf12160ac52a79aff36"><div class="ttname"><a href="a02606.html#acb9b3195ec05dbf12160ac52a79aff36">WERD_CHOICE::min_x_height</a></div><div class="ttdeci">float min_x_height() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00336">ratngs.h:336</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="a02458_html"><div class="ttname"><a href="a02458.html">tesseract::FontInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="a00284_source.html#l00062">fontinfo.h:62</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="a02358_html_a383d244125cd6c1523777278d0ed1d50"><div class="ttname"><a href="a02358.html#a383d244125cd6c1523777278d0ed1d50">tesseract::Tesseract::rejection_passes</a></div><div class="ttdeci">void rejection_passes(PAGE_RES *page_res, ETEXT_DESC *monitor, const TBOX *target_word_box, const char *word_config)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00618">control.cpp:618</a></div></div>
<div class="ttc" id="a02358_html_a0f66184981a2875773aad0b4c0dc210c"><div class="ttname"><a href="a02358.html#a0f66184981a2875773aad0b4c0dc210c">tesseract::Tesseract::tessedit_debug_fonts</a></div><div class="ttdeci">bool tessedit_debug_fonts</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00874">tesseractclass.h:874</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="a02542_html_a2bd2ff4f993746fc87d3ee88357a4a88"><div class="ttname"><a href="a02542.html#a2bd2ff4f993746fc87d3ee88357a4a88">WERD_RES::done</a></div><div class="ttdeci">bool done</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00298">pageres.h:298</a></div></div>
<div class="ttc" id="a02546_html_a1b3d11938500869049e926daa7948ad3"><div class="ttname"><a href="a02546.html#a1b3d11938500869049e926daa7948ad3">PAGE_RES_IT::MakeCurrentWordFuzzy</a></div><div class="ttdeci">void MakeCurrentWordFuzzy()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01483">pageres.cpp:1483</a></div></div>
<div class="ttc" id="a02358_html_a2583789c60aec43911ef1b2cf01b9d45"><div class="ttname"><a href="a02358.html#a2583789c60aec43911ef1b2cf01b9d45">tesseract::Tesseract::fix_rep_char</a></div><div class="ttdeci">void fix_rep_char(PAGE_RES_IT *page_res_it)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01725">control.cpp:1725</a></div></div>
<div class="ttc" id="a02358_html_a3093301b400c069c830fcf58f19ae4c6"><div class="ttname"><a href="a02358.html#a3093301b400c069c830fcf58f19ae4c6">tesseract::Tesseract::recog_pseudo_word</a></div><div class="ttdeci">void recog_pseudo_word(PAGE_RES *page_res, TBOX &selection_box)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00067">control.cpp:67</a></div></div>
<div class="ttc" id="a02358_html_a0096aa50725c746d70a7aee34ab45214"><div class="ttname"><a href="a02358.html#a0096aa50725c746d70a7aee34ab45214">tesseract::Tesseract::SelectGoodDiacriticOutlines</a></div><div class="ttdeci">bool SelectGoodDiacriticOutlines(int pass, float certainty_threshold, PAGE_RES_IT *pr_it, C_BLOB *blob, const GenericVector< C_OUTLINE *> &outlines, int num_outlines, GenericVector< bool > *ok_outlines)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01152">control.cpp:1152</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="a02354_html_a09761e92902bb23f628aad4f1921e185"><div class="ttname"><a href="a02354.html#a09761e92902bb23f628aad4f1921e185">tesseract::WordData::row</a></div><div class="ttdeci">ROW * row</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00156">tesseractclass.h:156</a></div></div>
<div class="ttc" id="a02358_html_ae333d858e257bbd5ac32eeb4aff2b19e"><div class="ttname"><a href="a02358.html#ae333d858e257bbd5ac32eeb4aff2b19e">tesseract::Tesseract::tess_acceptable_word</a></div><div class="ttdeci">bool tess_acceptable_word(WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00062">tessbox.cpp:62</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="a02542_html_a2e616f878c75833272f3f800827c2db6"><div class="ttname"><a href="a02542.html#a2e616f878c75833272f3f800827c2db6">WERD_RES::tesseract</a></div><div class="ttdeci">tesseract::Tesseract * tesseract</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00282">pageres.h:282</a></div></div>
<div class="ttc" id="a01541_html_af3d3389751226a339de88b46cfc58f66"><div class="ttname"><a href="a01541.html#af3d3389751226a339de88b46cfc58f66">fx_win</a></div><div class="ttdeci">EXTERN ScrollView * fx_win</div><div class="ttdef"><b>Definition:</b> <a href="a01541_source.html#l00050">drawfx.cpp:50</a></div></div>
<div class="ttc" id="a02358_html_a1638a97da03d2372190d29ae9b286f0d"><div class="ttname"><a href="a02358.html#a1638a97da03d2372190d29ae9b286f0d">tesseract::Tesseract::bigram_correction_pass</a></div><div class="ttdeci">void bigram_correction_pass(PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00473">control.cpp:473</a></div></div>
<div class="ttc" id="a03998_html_aa08ead4bccd3a3c602f4c28b1c91bbe6"><div class="ttname"><a href="a03998.html#aa08ead4bccd3a3c602f4c28b1c91bbe6">tesseract::Classify::SwitchAdaptiveClassifier</a></div><div class="ttdeci">void SwitchAdaptiveClassifier()</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00614">adaptmatch.cpp:614</a></div></div>
<div class="ttc" id="a02542_html_a42ec9dbb998f7da714ace13ee30cb86e"><div class="ttname"><a href="a02542.html#a42ec9dbb998f7da714ace13ee30cb86e">WERD_RES::x_height</a></div><div class="ttdeci">float x_height</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00311">pageres.h:311</a></div></div>
<div class="ttc" id="a03998_html_ae6dea981b2f591921d798ea83b0fa455"><div class="ttname"><a href="a03998.html#ae6dea981b2f591921d798ea83b0fa455">tesseract::Classify::fontinfo_table_</a></div><div class="ttdeci">UnicityTable< FontInfo > fontinfo_table_</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00529">classify.h:529</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="a02370_html_a78d90126d9698bc65c47a712c0aeafb1"><div class="ttname"><a href="a02370.html#a78d90126d9698bc65c47a712c0aeafb1">BlamerBundle::misadaption_debug</a></div><div class="ttdeci">const STRING & misadaption_debug() const</div><div class="ttdef"><b>Definition:</b> <a href="a00218_source.html#l00131">blamer.h:131</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="a02634_html_a9b2a8bdd86c5989f6036dd6b7e5e3811"><div class="ttname"><a href="a02634.html#a9b2a8bdd86c5989f6036dd6b7e5e3811">C_BLOB::SortByXMiddle</a></div><div class="ttdeci">static int SortByXMiddle(const void *v1, const void *v2)</div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00125">stepblob.h:125</a></div></div>
<div class="ttc" id="a02358_html_a25b9d2e69623b7abd26993cce6b3a6fc"><div class="ttname"><a href="a02358.html#a25b9d2e69623b7abd26993cce6b3a6fc">tesseract::Tesseract::chs_trailing_punct1</a></div><div class="ttdeci">char * chs_trailing_punct1</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00903">tesseractclass.h:903</a></div></div>
<div class="ttc" id="a02834_html_ac8c4ceca1e688adcdf188aef108dc18b"><div class="ttname"><a href="a02834.html#ac8c4ceca1e688adcdf188aef108dc18b">STRING::contains</a></div><div class="ttdeci">bool contains(const char c) const</div><div class="ttdef"><b>Definition:</b> <a href="a00581_source.html#l00187">strngs.cpp:187</a></div></div>
<div class="ttc" id="a02358_html_a2e84c55acc11dc7d1840d0aac4984e6a"><div class="ttname"><a href="a02358.html#a2e84c55acc11dc7d1840d0aac4984e6a">tesseract::Tesseract::SetupWordPassN</a></div><div class="ttdeci">void SetupWordPassN(int pass_n, WordData *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00182">control.cpp:182</a></div></div>
<div class="ttc" id="a02358_html_a2d143387187922d0ea471164dbf1f228"><div class="ttname"><a href="a02358.html#a2d143387187922d0ea471164dbf1f228">tesseract::Tesseract::tessedit_enable_dict_correction</a></div><div class="ttdeci">bool tessedit_enable_dict_correction</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00879">tesseractclass.h:879</a></div></div>
<div class="ttc" id="a02358_html_ae08214652c8e5a05331ae2a095a57849"><div class="ttname"><a href="a02358.html#ae08214652c8e5a05331ae2a095a57849">tesseract::Tesseract::fix_fuzzy_spaces</a></div><div class="ttdeci">void fix_fuzzy_spaces(ETEXT_DESC *monitor, int32_t word_count, PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00089_source.html#l00078">fixspace.cpp:78</a></div></div>
<div class="ttc" id="a00503_html_ae281080023125653d85cd946e95f626c"><div class="ttname"><a href="a00503.html#ae281080023125653d85cd946e95f626c">set_global_loc_code</a></div><div class="ttdeci">void set_global_loc_code(int loc_code)</div><div class="ttdef"><b>Definition:</b> <a href="a00521_source.html#l00080">globaloc.cpp:80</a></div></div>
<div class="ttc" id="a02606_html_a1f82cc6f4b84821576491fcf902a6f41"><div class="ttname"><a href="a02606.html#a1f82cc6f4b84821576491fcf902a6f41">WERD_CHOICE::debug_string</a></div><div class="ttdeci">const STRING debug_string() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00505">ratngs.h:505</a></div></div>
<div class="ttc" id="a02358_html_aea9ca5556015a303b77e5e8c7ad4b176"><div class="ttname"><a href="a02358.html#aea9ca5556015a303b77e5e8c7ad4b176">tesseract::Tesseract::RecogAllWordsPassN</a></div><div class="ttdeci">bool RecogAllWordsPassN(int pass_n, ETEXT_DESC *monitor, PAGE_RES_IT *pr_it, GenericVector< WordData > *words)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00218">control.cpp:218</a></div></div>
<div class="ttc" id="a00857_html"><div class="ttname"><a href="a00857.html">callcpp.h</a></div></div>
<div class="ttc" id="a00074_html"><div class="ttname"><a href="a00074.html">control.h</a></div></div>
<div class="ttc" id="a02634_html_a50bd7e9c66492bebdba6aadcc806bf93"><div class="ttname"><a href="a02634.html#a50bd7e9c66492bebdba6aadcc806bf93">C_BLOB::bounding_box</a></div><div class="ttdeci">TBOX bounding_box() const</div><div class="ttdef"><b>Definition:</b> <a href="a00434_source.html#l00255">stepblob.cpp:255</a></div></div>
<div class="ttc" id="a02358_html_acf64fde8187041f90359fb507242bbb0"><div class="ttname"><a href="a02358.html#acf64fde8187041f90359fb507242bbb0">tesseract::Tesseract::CountMisfitTops</a></div><div class="ttdeci">int CountMisfitTops(WERD_RES *word_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00095_source.html#l00070">fixxht.cpp:70</a></div></div>
<div class="ttc" id="a02546_html_afb987bf467ef552c49b962bf6872ad34"><div class="ttname"><a href="a02546.html#afb987bf467ef552c49b962bf6872ad34">PAGE_RES_IT::DeleteCurrentWord</a></div><div class="ttdeci">void DeleteCurrentWord()</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01450">pageres.cpp:1450</a></div></div>
<div class="ttc" id="a02530_html_a5aa8ac782c653b77b29590d72ba3d33a"><div class="ttname"><a href="a02530.html#a5aa8ac782c653b77b29590d72ba3d33a">PAGE_RES::blame_reasons</a></div><div class="ttdeci">GenericVector< int > blame_reasons</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00087">pageres.h:87</a></div></div>
<div class="ttc" id="a00071_html_a4976a2b3ea53d82ffdb2767bba98aa80"><div class="ttname"><a href="a00071.html#a4976a2b3ea53d82ffdb2767bba98aa80">kBackUpConfigFile</a></div><div class="ttdeci">const char *const kBackUpConfigFile</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00053">control.cpp:53</a></div></div>
<div class="ttc" id="a02350_html_a607c354651f1d8eb319b0dab6199592e"><div class="ttname"><a href="a02350.html#a607c354651f1d8eb319b0dab6199592e">tesseract::TesseractStats::word_count</a></div><div class="ttdeci">int32_t word_count</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00136">tesseractclass.h:136</a></div></div>
<div class="ttc" id="a02610_html_acfa252ec4b65cbf808349f70fcf62019"><div class="ttname"><a href="a02610.html#acfa252ec4b65cbf808349f70fcf62019">TBOX::contains</a></div><div class="ttdeci">bool contains(const FCOORD pt) const</div><div class="ttdef"><b>Definition:</b> <a href="a00407_source.html#l00333">rect.h:333</a></div></div>
<div class="ttc" id="a02546_html_ae4c91c0bdc362a0cebcbc644cf6ef2bf"><div class="ttname"><a href="a02546.html#ae4c91c0bdc362a0cebcbc644cf6ef2bf">PAGE_RES_IT::InsertSimpleCloneWord</a></div><div class="ttdeci">WERD_RES * InsertSimpleCloneWord(const WERD_RES &clone_res, WERD *new_word)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l01269">pageres.cpp:1269</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="a00449_html_ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce"><div class="ttname"><a href="a00449.html#ad6968adbf8f2cc44adf333ec96efb0beaa20dcde8552519bb81c4206b0e57a8ce">W_REP_CHAR</a></div><div class="ttdef"><b>Definition:</b> <a href="a00449_source.html#l00040">werd.h:40</a></div></div>
<div class="ttc" id="a02542_html_a053a2aeeddc26a93a41a04fa08dd688a"><div class="ttname"><a href="a02542.html#a053a2aeeddc26a93a41a04fa08dd688a">WERD_RES::uch_set</a></div><div class="ttdeci">const UNICHARSET * uch_set</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00206">pageres.h:206</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="a02414_html_a594719f667105487f0c3f78de6f85f77"><div class="ttname"><a href="a02414.html#a594719f667105487f0c3f78de6f85f77">tesseract::CCStruct::kXHeightCapRatio</a></div><div class="ttdeci">static const double kXHeightCapRatio</div><div class="ttdef"><b>Definition:</b> <a href="a00254_source.html#l00037">ccstruct.h:37</a></div></div>
<div class="ttc" id="a02410_html_a2505cb916ecbd87e4ba1a44654b1e078"><div class="ttname"><a href="a02410.html#a2505cb916ecbd87e4ba1a44654b1e078">tesseract::BoxWord::length</a></div><div class="ttdeci">int length() const</div><div class="ttdef"><b>Definition:</b> <a href="a00248_source.html#l00083">boxword.h:83</a></div></div>
<div class="ttc" id="a02542_html_a267e5d5e9fe67117e47223c5d336b8ba"><div class="ttname"><a href="a02542.html#a267e5d5e9fe67117e47223c5d336b8ba">WERD_RES::blamer_bundle</a></div><div class="ttdeci">BlamerBundle * blamer_bundle</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00246">pageres.h:246</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="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="a02542_html_af63cf973974fc961f82fae0af07a635d"><div class="ttname"><a href="a02542.html#af63cf973974fc961f82fae0af07a635d">WERD_RES::InitForRetryRecognition</a></div><div class="ttdeci">void InitForRetryRecognition(const WERD_RES &source)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00283">pageres.cpp:283</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeead58aa8857ae2a3ec6a90b29a849700d7"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeead58aa8857ae2a3ec6a90b29a849700d7">AC_UPPER_CASE</a></div><div class="ttdoc">ALL upper case. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00032">control.h:32</a></div></div>
<div class="ttc" id="a00209_html_a4033d1ec3632e2e780817fc5932f5951"><div class="ttname"><a href="a00209.html#a4033d1ec3632e2e780817fc5932f5951">make_pseudo_word</a></div><div class="ttdeci">PAGE_RES_IT * make_pseudo_word(PAGE_RES *page_res, const TBOX &selection_box)</div><div class="ttdef"><b>Definition:</b> <a href="a00209_source.html#l00035">werdit.cpp:35</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="a02786_html_a51ef2705184520ed0b44e218aa2b1706"><div class="ttname"><a href="a02786.html#a51ef2705184520ed0b44e218aa2b1706">ETEXT_DESC::progress_callback2</a></div><div class="ttdeci">PROGRESS_FUNC2 progress_callback2</div><div class="ttdoc">called whenever progress increases </div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00131">ocrclass.h:131</a></div></div>
<div class="ttc" id="a02358_html_a8ac4f5ef5b69323c047c824f4ad9e548"><div class="ttname"><a href="a02358.html#a8ac4f5ef5b69323c047c824f4ad9e548">tesseract::Tesseract::noise_cert_basechar</a></div><div class="ttdeci">double noise_cert_basechar</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00888">tesseractclass.h:888</a></div></div>
<div class="ttc" id="a02542_html_a4ffd6b844b62d19df43effdc3faec8e3"><div class="ttname"><a href="a02542.html#a4ffd6b844b62d19df43effdc3faec8e3">WERD_RES::part_of_combo</a></div><div class="ttdeci">bool part_of_combo</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00335">pageres.h:335</a></div></div>
<div class="ttc" id="a02358_html_a91dd02088541c2b02ff3b70810c71eff"><div class="ttname"><a href="a02358.html#a91dd02088541c2b02ff3b70810c71eff">tesseract::Tesseract::check_debug_pt</a></div><div class="ttdeci">bool check_debug_pt(WERD_RES *word, int location)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01868">control.cpp:1868</a></div></div>
<div class="ttc" id="a00401_html_a18e2c75cefe9e5b78e8ce41aa5fa25bca5e293e54fa687876197992131e779d54"><div class="ttname"><a href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca5e293e54fa687876197992131e779d54">USER_DAWG_PERM</a></div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00253">ratngs.h:253</a></div></div>
<div class="ttc" id="a02354_html"><div class="ttname"><a href="a02354.html">tesseract::WordData</a></div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00147">tesseractclass.h:147</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_abe5cec86d3d10ccebd9adb222803e7a5"><div class="ttname"><a href="a02358.html#abe5cec86d3d10ccebd9adb222803e7a5">tesseract::Tesseract::AnyTessLang</a></div><div class="ttdeci">bool AnyTessLang() const</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00280">tesseractclass.h:280</a></div></div>
<div class="ttc" id="a03998_html_a0f934f0b39cb869d2a4973269fb696cf"><div class="ttname"><a href="a03998.html#a0f934f0b39cb869d2a4973269fb696cf">tesseract::Classify::classify_debug_level</a></div><div class="ttdeci">int classify_debug_level</div><div class="ttdef"><b>Definition:</b> <a href="a00659_source.html#l00431">classify.h:431</a></div></div>
<div class="ttc" id="a03998_html_a3a1062b97626a08de9736ac3a6bc513a"><div class="ttname"><a href="a03998.html#a3a1062b97626a08de9736ac3a6bc513a">tesseract::Classify::StartBackupAdaptiveClassifier</a></div><div class="ttdeci">void StartBackupAdaptiveClassifier()</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00630">adaptmatch.cpp:630</a></div></div>
<div class="ttc" id="a02458_html_a1100e3d0a24568ffaf0b7cbf570b25c8"><div class="ttname"><a href="a02458.html#a1100e3d0a24568ffaf0b7cbf570b25c8">tesseract::FontInfo::universal_id</a></div><div class="ttdeci">int32_t universal_id</div><div class="ttdef"><b>Definition:</b> <a href="a00284_source.html#l00123">fontinfo.h:123</a></div></div>
<div class="ttc" id="a00218_html_a8faf52e106c04bfdc9898ffa90b821e1a5b7e21438ec02ceeba07bf96049d84d5"><div class="ttname"><a href="a00218.html#a8faf52e106c04bfdc9898ffa90b821e1a5b7e21438ec02ceeba07bf96049d84d5">IRR_NUM_REASONS</a></div><div class="ttdef"><b>Definition:</b> <a href="a00218_source.html#l00096">blamer.h:96</a></div></div>
<div class="ttc" id="a02358_html_a1968245f2d1cf2f62d9b5fd437ba13a6"><div class="ttname"><a href="a02358.html#a1968245f2d1cf2f62d9b5fd437ba13a6">tesseract::Tesseract::noise_maxperblob</a></div><div class="ttdeci">int noise_maxperblob</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00898">tesseractclass.h:898</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eee"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eee">ACCEPTABLE_WERD_TYPE</a></div><div class="ttdeci">ACCEPTABLE_WERD_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00028">control.h:28</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="a02358_html_a6c2fe027fce0afe0a8b4b4e3f10266a4"><div class="ttname"><a href="a02358.html#a6c2fe027fce0afe0a8b4b4e3f10266a4">tesseract::Tesseract::quality_based_rejection</a></div><div class="ttdeci">void quality_based_rejection(PAGE_RES_IT &page_res_it, bool good_quality_doc)</div><div class="ttdef"><b>Definition:</b> <a href="a00077_source.html#l00139">docqual.cpp:139</a></div></div>
<div class="ttc" id="a02606_html_a572009e61b85e6001bb1ed1494733c22"><div class="ttname"><a href="a02606.html#a572009e61b85e6001bb1ed1494733c22">WERD_CHOICE::IsAllSpaces</a></div><div class="ttdeci">bool IsAllSpaces() const</div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00521">ratngs.h:521</a></div></div>
<div class="ttc" id="a00398_html_ae7d10d7f2ebc33a80d4c2ec84996e121"><div class="ttname"><a href="a00398.html#ae7d10d7f2ebc33a80d4c2ec84996e121">FindMatchingChoice</a></div><div class="ttdeci">BLOB_CHOICE * FindMatchingChoice(UNICHAR_ID char_id, BLOB_CHOICE_LIST *bc_list)</div><div class="ttdef"><b>Definition:</b> <a href="a00398_source.html#l00180">ratngs.cpp:180</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="a02358_html_aa8f33558afec91ea781fc11368ce209b"><div class="ttname"><a href="a02358.html#aa8f33558afec91ea781fc11368ce209b">tesseract::Tesseract::quality_outline_pc</a></div><div class="ttdeci">double quality_outline_pc</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00908">tesseractclass.h:908</a></div></div>
<div class="ttc" id="a03950_html_a55071e756e234d8c51ca08079c1847cd"><div class="ttname"><a href="a03950.html#a55071e756e234d8c51ca08079c1847cd">UNICHARSET::get_isupper</a></div><div class="ttdeci">bool get_isupper(UNICHAR_ID unichar_id) const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00500">unicharset.h:500</a></div></div>
<div class="ttc" id="a00092_html"><div class="ttname"><a href="a00092.html">fixspace.h</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="a02370_html_a58f3814814a816e89faf1444b90c36e1"><div class="ttname"><a href="a02370.html#a58f3814814a816e89faf1444b90c36e1">BlamerBundle::LastChanceBlame</a></div><div class="ttdeci">static void LastChanceBlame(bool debug, WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00215_source.html#l00552">blamer.cpp:552</a></div></div>
<div class="ttc" id="a02358_html_a86c6f34b0388d11a0c63cd468947a4ad"><div class="ttname"><a href="a02358.html#a86c6f34b0388d11a0c63cd468947a4ad">tesseract::Tesseract::tessedit_write_unlv</a></div><div class="ttdeci">bool tessedit_write_unlv</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01037">tesseractclass.h:1037</a></div></div>
<div class="ttc" id="a02358_html_a99a1e1a4cd1134ecab8028de820ae57a"><div class="ttname"><a href="a02358.html#a99a1e1a4cd1134ecab8028de820ae57a">tesseract::Tesseract::word_char_quality</a></div><div class="ttdeci">void word_char_quality(WERD_RES *word, ROW *row, int16_t *match_count, int16_t *accepted_match_count)</div><div class="ttdef"><b>Definition:</b> <a href="a00077_source.html#l00093">docqual.cpp:93</a></div></div>
<div class="ttc" id="a02542_html_ab4d02a7548dab0a4522f02ed90e48100"><div class="ttname"><a href="a02542.html#ab4d02a7548dab0a4522f02ed90e48100">WERD_RES::raw_choice</a></div><div class="ttdeci">WERD_CHOICE * raw_choice</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00240">pageres.h:240</a></div></div>
<div class="ttc" id="a02358_html_aadf7ce5c811a4c404560aee6ed5c75e2"><div class="ttname"><a href="a02358.html#aadf7ce5c811a4c404560aee6ed5c75e2">tesseract::Tesseract::ReassignDiacritics</a></div><div class="ttdeci">bool ReassignDiacritics(int pass, PAGE_RES_IT *pr_it, bool *make_next_word_fuzzy)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00949">control.cpp:949</a></div></div>
<div class="ttc" id="a04866_html_a76e95cb7cbfe636ab00ec46150b5524d"><div class="ttname"><a href="a04866.html#a76e95cb7cbfe636ab00ec46150b5524d">tesseract::Wordrec::wordrec_debug_blamer</a></div><div class="ttdeci">bool wordrec_debug_blamer</div><div class="ttdef"><b>Definition:</b> <a href="a01622_source.html#l00236">wordrec.h:236</a></div></div>
<div class="ttc" id="a04674_html_a8ad2a2ff59d9dcbd82217076d4466344"><div class="ttname"><a href="a04674.html#a8ad2a2ff59d9dcbd82217076d4466344">tesseract::Textord::CleanupSingleRowResult</a></div><div class="ttdeci">void CleanupSingleRowResult(PageSegMode pageseg_mode, PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a01274_source.html#l00322">textord.cpp:322</a></div></div>
<div class="ttc" id="a02354_html_a57d68d6db8d0d8304c7c6fbc1e53e6ee"><div class="ttname"><a href="a02354.html#a57d68d6db8d0d8304c7c6fbc1e53e6ee">tesseract::WordData::prev_word</a></div><div class="ttdeci">WordData * prev_word</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00158">tesseractclass.h:158</a></div></div>
<div class="ttc" id="a00080_html"><div class="ttname"><a href="a00080.html">docqual.h</a></div></div>
<div class="ttc" id="a02542_html_ad1d449f93bb0150bc7ef0d9b59ed27ba"><div class="ttname"><a href="a02542.html#ad1d449f93bb0150bc7ef0d9b59ed27ba">WERD_RES::chopped_word</a></div><div class="ttdeci">TWERD * chopped_word</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00215">pageres.h:215</a></div></div>
<div class="ttc" id="a02542_html_a423e27ea457c33aed9178dd064b38b6c"><div class="ttname"><a href="a02542.html#a423e27ea457c33aed9178dd064b38b6c">WERD_RES::ReplaceBestChoice</a></div><div class="ttdeci">void ReplaceBestChoice(WERD_CHOICE *choice)</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00801">pageres.cpp:801</a></div></div>
<div class="ttc" id="a02358_html_af4932764d7877f68efcf04570a2e4123"><div class="ttname"><a href="a02358.html#af4932764d7877f68efcf04570a2e4123">tesseract::Tesseract::blamer_pass</a></div><div class="ttdeci">void blamer_pass(PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00716">control.cpp:716</a></div></div>
<div class="ttc" id="a02358_html_a0bf402e18a4253490a46b6a37bf3d67d"><div class="ttname"><a href="a02358.html#a0bf402e18a4253490a46b6a37bf3d67d">tesseract::Tesseract::tessedit_tess_adaption_mode</a></div><div class="ttdeci">int tessedit_tess_adaption_mode</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00912">tesseractclass.h:912</a></div></div>
<div class="ttc" id="a02358_html_a0b6bb89073c94c41d635dfa715da3056"><div class="ttname"><a href="a02358.html#a0b6bb89073c94c41d635dfa715da3056">tesseract::Tesseract::recog_interactive</a></div><div class="ttdeci">bool recog_interactive(PAGE_RES_IT *pr_it)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l00082">control.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="a00401_html_a18e2c75cefe9e5b78e8ce41aa5fa25bca4fd9d3b025ecc5ea8f2248fea29543e4"><div class="ttname"><a href="a00401.html#a18e2c75cefe9e5b78e8ce41aa5fa25bca4fd9d3b025ecc5ea8f2248fea29543e4">FREQ_DAWG_PERM</a></div><div class="ttdef"><b>Definition:</b> <a href="a00401_source.html#l00254">ratngs.h:254</a></div></div>
<div class="ttc" id="a02358_html_a25ed767b346d06161940bd2288d137b9"><div class="ttname"><a href="a02358.html#a25ed767b346d06161940bd2288d137b9">tesseract::Tesseract::tessedit_display_outwords</a></div><div class="ttdeci">bool tessedit_display_outwords</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00863">tesseractclass.h:863</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="a02358_html_ac2050c8b5f78b667d2a1eaa33777b420"><div class="ttname"><a href="a02358.html#ac2050c8b5f78b667d2a1eaa33777b420">tesseract::Tesseract::multilang_debug_level</a></div><div class="ttdeci">int multilang_debug_level</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00922">tesseractclass.h:922</a></div></div>
<div class="ttc" id="a02358_html_a8eaae506cccb353fadda129e070853fe"><div class="ttname"><a href="a02358.html#a8eaae506cccb353fadda129e070853fe">tesseract::Tesseract::dictionary_correction_pass</a></div><div class="ttdeci">void dictionary_correction_pass(PAGE_RES *page_res)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l02117">control.cpp:2117</a></div></div>
<div class="ttc" id="a02358_html_a3b191f48cb43dc1796b039650f7de09a"><div class="ttname"><a href="a02358.html#a3b191f48cb43dc1796b039650f7de09a">tesseract::Tesseract::tess_segment_pass_n</a></div><div class="ttdeci">void tess_segment_pass_n(int pass_n, WERD_RES *word)</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00032">tessbox.cpp:32</a></div></div>
<div class="ttc" id="a00503_html_a2547c1ff4f32e0726fd745c388e50aa0"><div class="ttname"><a href="a00503.html#a2547c1ff4f32e0726fd745c388e50aa0">SUBLOC_NORM</a></div><div class="ttdeci">#define SUBLOC_NORM</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00059">errcode.h:59</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="a04290_html_a6332398cf9ef4a202d2a6f7142d51e3d"><div class="ttname"><a href="a04290.html#a6332398cf9ef4a202d2a6f7142d51e3d">tesseract::Dict::valid_word_permuter</a></div><div class="ttdeci">static bool valid_word_permuter(uint8_t perm, bool numbers_ok)</div><div class="ttdoc">Check all the DAWGs to see if this word is in any of them. </div><div class="ttdef"><b>Definition:</b> <a href="a00908_source.html#l00459">dict.h:459</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="a03950_html_a543cc7f8a76417b75d52fbba623be5fc"><div class="ttname"><a href="a03950.html#a543cc7f8a76417b75d52fbba623be5fc">UNICHARSET::top_bottom_useful</a></div><div class="ttdeci">bool top_bottom_useful() const</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l00532">unicharset.h:532</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaab0741a5a5ff9757ca343af255353ba0">AC_UNACCEPTABLE</a></div><div class="ttdoc">Unacceptable word. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00030">control.h:30</a></div></div>
<div class="ttc" id="a02786_html_a469c1ab091847e37969871bd89cf1005"><div class="ttname"><a href="a02786.html#a469c1ab091847e37969871bd89cf1005">ETEXT_DESC::progress</a></div><div class="ttdeci">int16_t progress</div><div class="ttdoc">chars in this buffer(0) </div><div class="ttdef"><b>Definition:</b> <a href="a00551_source.html#l00122">ocrclass.h:122</a></div></div>
<div class="ttc" id="a00503_html_a6b2566a0d57e097555b339d08379ac0d"><div class="ttname"><a href="a00503.html#a6b2566a0d57e097555b339d08379ac0d">LOC_MM_ADAPT</a></div><div class="ttdeci">#define LOC_MM_ADAPT</div><div class="ttdef"><b>Definition:</b> <a href="a00503_source.html#l00052">errcode.h:52</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="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="a02358_html_aed023036d84d981089ea0a0828e0e595"><div class="ttname"><a href="a02358.html#aed023036d84d981089ea0a0828e0e595">tesseract::Tesseract::PrerecAllWordsPar</a></div><div class="ttdeci">void PrerecAllWordsPar(const GenericVector< WordData > &words)</div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00039">par_control.cpp:39</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="a00197_html"><div class="ttname"><a href="a00197.html">tessvars.h</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="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="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="a02350_html_a37743585e9509a4533ae54df8f575f27"><div class="ttname"><a href="a02350.html#a37743585e9509a4533ae54df8f575f27">tesseract::TesseractStats::doc_outline_errs</a></div><div class="ttdeci">int16_t doc_outline_errs</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l00132">tesseractclass.h:132</a></div></div>
<div class="ttc" id="a02630_html_a92ab39b34f7a99ff3272e614a946513c"><div class="ttname"><a href="a02630.html#a92ab39b34f7a99ff3272e614a946513c">STATS::get_total</a></div><div class="ttdeci">int32_t get_total() const</div><div class="ttdef"><b>Definition:</b> <a href="a00431_source.html#l00086">statistc.h:86</a></div></div>
<div class="ttc" id="a02634_html_abe4a0174938ec7e4d968382e8274c237"><div class="ttname"><a href="a02634.html#abe4a0174938ec7e4d968382e8274c237">C_BLOB::deep_copy</a></div><div class="ttdeci">static C_BLOB * deep_copy(const C_BLOB *src)</div><div class="ttdef"><b>Definition:</b> <a href="a00437_source.html#l00119">stepblob.h:119</a></div></div>
<div class="ttc" id="a02358_html_ae1206c0c4b63a008cc01650004fb7b03"><div class="ttname"><a href="a02358.html#ae1206c0c4b63a008cc01650004fb7b03">tesseract::Tesseract::poly_allow_detailed_fx</a></div><div class="ttdeci">bool poly_allow_detailed_fx</div><div class="ttdef"><b>Definition:</b> <a href="a00191_source.html#l01103">tesseractclass.h:1103</a></div></div>
<div class="ttc" id="a02358_html_a08393cbe8d9fec500ddce395d3319b32"><div class="ttname"><a href="a02358.html#a08393cbe8d9fec500ddce395d3319b32">tesseract::Tesseract::AssignDiacriticsToOverlappingBlobs</a></div><div class="ttdeci">void AssignDiacriticsToOverlappingBlobs(const GenericVector< C_OUTLINE *> &outlines, int pass, WERD *real_word, PAGE_RES_IT *pr_it, GenericVector< bool > *word_wanted, GenericVector< bool > *overlapped_any_blob, GenericVector< C_BLOB *> *target_blobs)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01019">control.cpp:1019</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="a02618_html_a124889539460b8c200b3186da4a692e0"><div class="ttname"><a href="a02618.html#a124889539460b8c200b3186da4a692e0">REJMAP::print</a></div><div class="ttdeci">void print(FILE *fp)</div><div class="ttdef"><b>Definition:</b> <a href="a00410_source.html#l00323">rejctmap.cpp:323</a></div></div>
<div class="ttc" id="a01629_html_a04550a0ed1279562027bf2fc92c421aead2a8d49560cbb1670cb06c547760b113"><div class="ttname"><a href="a01629.html#a04550a0ed1279562027bf2fc92c421aead2a8d49560cbb1670cb06c547760b113">tesseract::OEM_TESSERACT_LSTM_COMBINED</a></div><div class="ttdef"><b>Definition:</b> <a href="a00380_source.html#l00271">publictypes.h:271</a></div></div>
<div class="ttc" id="a02618_html_aa0e131c139fe56b044b20cc8fd2a645c"><div class="ttname"><a href="a02618.html#aa0e131c139fe56b044b20cc8fd2a645c">REJMAP::rej_word_bad_quality</a></div><div class="ttdeci">void rej_word_bad_quality()</div><div class="ttdef"><b>Definition:</b> <a href="a00410_source.html#l00417">rejctmap.cpp:417</a></div></div>
<div class="ttc" id="a02542_html_afd5df4b31d6cfc9fc05d79e5fd774212"><div class="ttname"><a href="a02542.html#afd5df4b31d6cfc9fc05d79e5fd774212">WERD_RES::GetBlobChoice</a></div><div class="ttdeci">BLOB_CHOICE * GetBlobChoice(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="a00341_source.html#l00756">pageres.cpp:756</a></div></div>
<div class="ttc" id="a02618_html_a798c11e002b9421b26a748f5186bdae9"><div class="ttname"><a href="a02618.html#a798c11e002b9421b26a748f5186bdae9">REJMAP::initialise</a></div><div class="ttdeci">void initialise(int16_t length)</div><div class="ttdef"><b>Definition:</b> <a href="a00410_source.html#l00275">rejctmap.cpp:275</a></div></div>
<div class="ttc" id="a02358_html_a5f959a7836868be2a58cce02195b7878"><div class="ttname"><a href="a02358.html#a5f959a7836868be2a58cce02195b7878">tesseract::Tesseract::output_pass</a></div><div class="ttdeci">void output_pass(PAGE_RES_IT &page_res_it, const TBOX *target_word_box)</div><div class="ttdef"><b>Definition:</b> <a href="a00119_source.html#l00043">output.cpp:43</a></div></div>
<div class="ttc" id="a02358_html_ad14592439397161692776a9068dffe43"><div class="ttname"><a href="a02358.html#ad14592439397161692776a9068dffe43">tesseract::Tesseract::TrainedXheightFix</a></div><div class="ttdeci">bool TrainedXheightFix(WERD_RES *word, BLOCK *block, ROW *row)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01504">control.cpp:1504</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="a02514_html_ab1ac3646c85d17089af85a306ef8a7e7"><div class="ttname"><a href="a02514.html#ab1ac3646c85d17089af85a306ef8a7e7">BLOCK::x_height</a></div><div class="ttdeci">int32_t x_height() const</div><div class="ttdoc">return xheight </div><div class="ttdef"><b>Definition:</b> <a href="a00320_source.html#l00108">ocrblock.h:108</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="a02542_html_a42a1961e381f0b4df731321552fe771c"><div class="ttname"><a href="a02542.html#a42a1961e381f0b4df731321552fe771c">WERD_RES::fontinfo2</a></div><div class="ttdeci">const FontInfo * fontinfo2</div><div class="ttdef"><b>Definition:</b> <a href="a00344_source.html#l00305">pageres.h:305</a></div></div>
<div class="ttc" id="a00074_html_af9ff5a7d7a1b9eeea7ce4106bffa7eeeaf8e947b78fa9ddbd1172c0157a3516ff"><div class="ttname"><a href="a00074.html#af9ff5a7d7a1b9eeea7ce4106bffa7eeeaf8e947b78fa9ddbd1172c0157a3516ff">AC_LOWER_CASE</a></div><div class="ttdoc">ALL lower case. </div><div class="ttdef"><b>Definition:</b> <a href="a00074_source.html#l00031">control.h:31</a></div></div>
<div class="ttc" id="a02358_html_a0ed7f2173b7ac61d85a0660821a03572"><div class="ttname"><a href="a02358.html#a0ed7f2173b7ac61d85a0660821a03572">tesseract::Tesseract::classify_word_and_language</a></div><div class="ttdeci">void classify_word_and_language(int pass_n, PAGE_RES_IT *pr_it, WordData *word_data)</div><div class="ttdef"><b>Definition:</b> <a href="a00071_source.html#l01338">control.cpp:1338</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><!-- 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_f676e76c9a53ee7edd5046de803da784.html">ccmain</a></li><li class="navelem"><a class="el" href="a00071.html">control.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>