<!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: tesseract::SquishedDawg Class Reference</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">3.05.02</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('a04537.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="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="a04534.html">List of all members</a> </div> <div class="headertitle"> <div class="title">tesseract::SquishedDawg Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include <<a class="el" href="a01139_source.html">dawg.h</a>></code></p> <div class="dynheader"> Inheritance diagram for tesseract::SquishedDawg:</div> <div class="dyncontent"> <div class="center"> <img src="a04537.png" usemap="#tesseract::SquishedDawg_map" alt=""/> <map id="tesseract::SquishedDawg_map" name="tesseract::SquishedDawg_map"> <area href="a04525.html" alt="tesseract::Dawg" shape="rect" coords="0,0,152,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:acc5922a679ddb742a41581f4bef3e8f1"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#acc5922a679ddb742a41581f4bef3e8f1">SquishedDawg</a> (FILE *file, <a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> <a class="el" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, const <a class="el" href="a02929.html">STRING</a> &<a class="el" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, <a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> perm, int debug_level)</td></tr> <tr class="separator:acc5922a679ddb742a41581f4bef3e8f1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:addfd050f731473fc423b6a864bda0b5d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#addfd050f731473fc423b6a864bda0b5d">SquishedDawg</a> (const char *filename, <a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> <a class="el" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, const <a class="el" href="a02929.html">STRING</a> &<a class="el" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, <a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> perm, int debug_level)</td></tr> <tr class="separator:addfd050f731473fc423b6a864bda0b5d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad7466d6af8db28db33569a447c6f039c"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#ad7466d6af8db28db33569a447c6f039c">SquishedDawg</a> (<a class="el" href="a01139.html#a51438783ac73f19b33094c73c9d55ce7">EDGE_ARRAY</a> edges, int num_edges, <a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> <a class="el" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, const <a class="el" href="a02929.html">STRING</a> &<a class="el" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, <a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> perm, int unicharset_size, int debug_level)</td></tr> <tr class="separator:ad7466d6af8db28db33569a447c6f039c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6fda4e74006c7510c36f323cd29b724d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a6fda4e74006c7510c36f323cd29b724d">~SquishedDawg</a> ()</td></tr> <tr class="separator:a6fda4e74006c7510c36f323cd29b724d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac31f8bc5673fbda1ec05208f9b8caacc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#ac31f8bc5673fbda1ec05208f9b8caacc">NumEdges</a> ()</td></tr> <tr class="separator:ac31f8bc5673fbda1ec05208f9b8caacc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1b18c79b76c21d16c29f3f60736d7f90"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a1b18c79b76c21d16c29f3f60736d7f90">edge_char_of</a> (<a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> node, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id, bool word_end) const</td></tr> <tr class="memdesc:a1b18c79b76c21d16c29f3f60736d7f90"><td class="mdescLeft"> </td><td class="mdescRight">Returns the edge that corresponds to the letter out of this node. <a href="#a1b18c79b76c21d16c29f3f60736d7f90">More...</a><br /></td></tr> <tr class="separator:a1b18c79b76c21d16c29f3f60736d7f90"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a153afa8a2cdf01c5431b77f463fd3af5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a153afa8a2cdf01c5431b77f463fd3af5">unichar_ids_of</a> (<a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> node, <a class="el" href="a01738.html#a5084886f7cd9adefa73d03111d92f593">NodeChildVector</a> *vec, bool word_end) const</td></tr> <tr class="separator:a153afa8a2cdf01c5431b77f463fd3af5"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab2bd8e73d29ef362d8b20134b7603cf8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#ab2bd8e73d29ef362d8b20134b7603cf8">next_node</a> (<a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge) const</td></tr> <tr class="separator:ab2bd8e73d29ef362d8b20134b7603cf8"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa5540965df5277f08e17754f4c1e91da"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#aa5540965df5277f08e17754f4c1e91da">end_of_word</a> (<a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge_ref) const</td></tr> <tr class="separator:aa5540965df5277f08e17754f4c1e91da"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a64658d779aa3300938e1e0d93ac4b206"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a64658d779aa3300938e1e0d93ac4b206">edge_letter</a> (<a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge_ref) const</td></tr> <tr class="memdesc:a64658d779aa3300938e1e0d93ac4b206"><td class="mdescLeft"> </td><td class="mdescRight">Returns UNICHAR_ID stored in the edge indicated by the given EDGE_REF. <a href="#a64658d779aa3300938e1e0d93ac4b206">More...</a><br /></td></tr> <tr class="separator:a64658d779aa3300938e1e0d93ac4b206"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad1967f664815b772205830f30a26ecc0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#ad1967f664815b772205830f30a26ecc0">print_node</a> (<a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> node, int max_num_edges) const</td></tr> <tr class="separator:ad1967f664815b772205830f30a26ecc0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5b6d0a893b2a8e64c901d514a3da924e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a5b6d0a893b2a8e64c901d514a3da924e">write_squished_dawg</a> (FILE *file)</td></tr> <tr class="memdesc:a5b6d0a893b2a8e64c901d514a3da924e"><td class="mdescLeft"> </td><td class="mdescRight">Writes the squished/reduced <a class="el" href="a04525.html">Dawg</a> to a file. <a href="#a5b6d0a893b2a8e64c901d514a3da924e">More...</a><br /></td></tr> <tr class="separator:a5b6d0a893b2a8e64c901d514a3da924e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a090fe2daf7bedae8d2a2403eb2cdfe38"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04537.html#a090fe2daf7bedae8d2a2403eb2cdfe38">write_squished_dawg</a> (const char *filename)</td></tr> <tr class="separator:a090fe2daf7bedae8d2a2403eb2cdfe38"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_a04525"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_a04525')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="a04525.html">tesseract::Dawg</a></td></tr> <tr class="memitem:ab21ea9b8f44a9eb0ae18357d23a63d74 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a> () const</td></tr> <tr class="separator:ab21ea9b8f44a9eb0ae18357d23a63d74 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad992d65fe05685da6b3aac0bb442bd59 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a02929.html">STRING</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a> () const</td></tr> <tr class="separator:ad992d65fe05685da6b3aac0bb442bd59 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aca7e80095930ad1b8ca0a8f852f1c865 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#aca7e80095930ad1b8ca0a8f852f1c865">permuter</a> () const</td></tr> <tr class="separator:aca7e80095930ad1b8ca0a8f852f1c865 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad54b2916f52c1db80bfeda8bd712228e inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad54b2916f52c1db80bfeda8bd712228e">~Dawg</a> ()</td></tr> <tr class="separator:ad54b2916f52c1db80bfeda8bd712228e inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a45a81cfb10d6c1bbf1115831c585936c inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a45a81cfb10d6c1bbf1115831c585936c">word_in_dawg</a> (const <a class="el" href="a02709.html">WERD_CHOICE</a> &word) const</td></tr> <tr class="memdesc:a45a81cfb10d6c1bbf1115831c585936c inherit pub_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the given word is in the <a class="el" href="a04525.html">Dawg</a>. <a href="a04525.html#a45a81cfb10d6c1bbf1115831c585936c">More...</a><br /></td></tr> <tr class="separator:a45a81cfb10d6c1bbf1115831c585936c inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2306a358490ae46f060f8ad5fa6db832 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a2306a358490ae46f060f8ad5fa6db832">prefix_in_dawg</a> (const <a class="el" href="a02709.html">WERD_CHOICE</a> &prefix, bool requires_complete) const</td></tr> <tr class="separator:a2306a358490ae46f060f8ad5fa6db832 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac0c47bdfd5ff7cdd8a37be641fe7c0e2 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ac0c47bdfd5ff7cdd8a37be641fe7c0e2">check_for_words</a> (const char *filename, const <a class="el" href="a04041.html">UNICHARSET</a> &unicharset, bool enable_wildcard) const</td></tr> <tr class="separator:ac0c47bdfd5ff7cdd8a37be641fe7c0e2 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab190c6e464559774b0fe120369ae6288 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ab190c6e464559774b0fe120369ae6288">iterate_words</a> (const <a class="el" href="a04041.html">UNICHARSET</a> &unicharset, <a class="el" href="a03129.html">TessCallback1</a>< const <a class="el" href="a02709.html">WERD_CHOICE</a> *> *cb) const</td></tr> <tr class="separator:ab190c6e464559774b0fe120369ae6288 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2226aaa9c04a9fe947b7de3d88f2057a inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a2226aaa9c04a9fe947b7de3d88f2057a">iterate_words</a> (const <a class="el" href="a04041.html">UNICHARSET</a> &unicharset, <a class="el" href="a03129.html">TessCallback1</a>< const char *> *cb) const</td></tr> <tr class="separator:a2226aaa9c04a9fe947b7de3d88f2057a inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae87a24dc8ed45799abbcd048d0226178 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ae87a24dc8ed45799abbcd048d0226178">unichar_id_to_patterns</a> (<a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id, const <a class="el" href="a04041.html">UNICHARSET</a> &unicharset, <a class="el" href="a02297.html">GenericVector</a>< <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> > *vec) const</td></tr> <tr class="separator:ae87a24dc8ed45799abbcd048d0226178 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:abfa158a70b41c2b27f5344021b9c1ba4 inherit pub_methods_a04525"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#abfa158a70b41c2b27f5344021b9c1ba4">pattern_loop_edge</a> (<a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge_ref, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id, bool word_end) const</td></tr> <tr class="separator:abfa158a70b41c2b27f5344021b9c1ba4 inherit pub_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pub_static_attribs_a04525"><td colspan="2" onclick="javascript:toggleInherit('pub_static_attribs_a04525')"><img src="closed.png" alt="-"/> Static Public Attributes inherited from <a class="el" href="a04525.html">tesseract::Dawg</a></td></tr> <tr class="memitem:a6f2b9b30147a54ee156dcb2aa49b110d inherit pub_static_attribs_a04525"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="a00524.html#a8d41499d38c24d39b221ab0c158fe5a8">inT16</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a6f2b9b30147a54ee156dcb2aa49b110d">kDawgMagicNumber</a> = 42</td></tr> <tr class="memdesc:a6f2b9b30147a54ee156dcb2aa49b110d inherit pub_static_attribs_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Magic number to determine endianness when reading the <a class="el" href="a04525.html">Dawg</a> from file. <a href="a04525.html#a6f2b9b30147a54ee156dcb2aa49b110d">More...</a><br /></td></tr> <tr class="separator:a6f2b9b30147a54ee156dcb2aa49b110d inherit pub_static_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af6a39872b9a20f3b02020f237731af87 inherit pub_static_attribs_a04525"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#af6a39872b9a20f3b02020f237731af87">kPatternUnicharID</a> = 0</td></tr> <tr class="separator:af6a39872b9a20f3b02020f237731af87 inherit pub_static_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pro_methods_a04525"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_a04525')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="a04525.html">tesseract::Dawg</a></td></tr> <tr class="memitem:aa433840463bbc95c36f6418bd64fb8bd inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#aa433840463bbc95c36f6418bd64fb8bd">Dawg</a> ()</td></tr> <tr class="separator:aa433840463bbc95c36f6418bd64fb8bd inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0766fcf101abfe7f1d9bd9db9ce0ae3f inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">next_node_from_edge_rec</a> (const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="memdesc:a0766fcf101abfe7f1d9bd9db9ce0ae3f inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns the next node visited by following this edge. <a href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">More...</a><br /></td></tr> <tr class="separator:a0766fcf101abfe7f1d9bd9db9ce0ae3f inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa97244b8e6e7dbf8a7a3b4cbbb8c667a inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#aa97244b8e6e7dbf8a7a3b4cbbb8c667a">marker_flag_from_edge_rec</a> (const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="memdesc:aa97244b8e6e7dbf8a7a3b4cbbb8c667a inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns the marker flag of this edge. <a href="a04525.html#aa97244b8e6e7dbf8a7a3b4cbbb8c667a">More...</a><br /></td></tr> <tr class="separator:aa97244b8e6e7dbf8a7a3b4cbbb8c667a inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad4f2e1baa33904a9b7062bd94a152cf5 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad4f2e1baa33904a9b7062bd94a152cf5">direction_from_edge_rec</a> (const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="memdesc:ad4f2e1baa33904a9b7062bd94a152cf5 inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns the direction flag of this edge. <a href="a04525.html#ad4f2e1baa33904a9b7062bd94a152cf5">More...</a><br /></td></tr> <tr class="separator:ad4f2e1baa33904a9b7062bd94a152cf5 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa6795f3e7e2e9c6943957ec09f8e9444 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">end_of_word_from_edge_rec</a> (const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="memdesc:aa6795f3e7e2e9c6943957ec09f8e9444 inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if this edge marks the end of a word. <a href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">More...</a><br /></td></tr> <tr class="separator:aa6795f3e7e2e9c6943957ec09f8e9444 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab7847f3606ca465452ac1840015bfe9a inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">unichar_id_from_edge_rec</a> (const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="memdesc:ab7847f3606ca465452ac1840015bfe9a inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Returns UNICHAR_ID recorded in this edge. <a href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">More...</a><br /></td></tr> <tr class="separator:ab7847f3606ca465452ac1840015bfe9a inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4a4b153bf6de3083aaac1af0600fa4ee inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a4a4b153bf6de3083aaac1af0600fa4ee">set_next_node_in_edge_rec</a> (<a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> *edge_rec, <a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> value)</td></tr> <tr class="memdesc:a4a4b153bf6de3083aaac1af0600fa4ee inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Sets the next node link for this edge in the <a class="el" href="a04525.html">Dawg</a>. <a href="a04525.html#a4a4b153bf6de3083aaac1af0600fa4ee">More...</a><br /></td></tr> <tr class="separator:a4a4b153bf6de3083aaac1af0600fa4ee inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab55a9591be8d4332a62c25c527db3479 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ab55a9591be8d4332a62c25c527db3479">set_marker_flag_in_edge_rec</a> (<a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> *edge_rec)</td></tr> <tr class="memdesc:ab55a9591be8d4332a62c25c527db3479 inherit pro_methods_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Sets this edge record to be the last one in a sequence of edges. <a href="a04525.html#ab55a9591be8d4332a62c25c527db3479">More...</a><br /></td></tr> <tr class="separator:ab55a9591be8d4332a62c25c527db3479 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a27dbfb5dbe47cebcf7b11b63604b387a inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a27dbfb5dbe47cebcf7b11b63604b387a">given_greater_than_edge_rec</a> (<a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> <a class="el" href="a04525.html#ae68706a55d86637dec1da9615effb659">next_node</a>, bool word_end, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id, const <a class="el" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> &edge_rec) const</td></tr> <tr class="separator:a27dbfb5dbe47cebcf7b11b63604b387a inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0105d73ef39d750f38c9bd260ba63a53 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a0105d73ef39d750f38c9bd260ba63a53">edge_rec_match</a> (<a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> <a class="el" href="a04525.html#ae68706a55d86637dec1da9615effb659">next_node</a>, bool word_end, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id, <a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> other_next_node, bool other_word_end, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> other_unichar_id) const</td></tr> <tr class="separator:a0105d73ef39d750f38c9bd260ba63a53 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6b415183039524d69b370b4e93acdf56 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a6b415183039524d69b370b4e93acdf56">init</a> (<a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> <a class="el" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, const <a class="el" href="a02929.html">STRING</a> &<a class="el" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, <a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> perm, int unicharset_size, int debug_level)</td></tr> <tr class="separator:a6b415183039524d69b370b4e93acdf56 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a49f0181a443ed9fdd75e59ed0013fcd2 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a49f0181a443ed9fdd75e59ed0013fcd2">match_words</a> (<a class="el" href="a02709.html">WERD_CHOICE</a> *word, <a class="el" href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a> index, <a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> node, <a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> wildcard) const</td></tr> <tr class="separator:a49f0181a443ed9fdd75e59ed0013fcd2 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7201a6226eaf9cd348c507188084f466 inherit pro_methods_a04525"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a7201a6226eaf9cd348c507188084f466">iterate_words_rec</a> (const <a class="el" href="a02709.html">WERD_CHOICE</a> &word_so_far, <a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> to_explore, <a class="el" href="a03129.html">TessCallback1</a>< const <a class="el" href="a02709.html">WERD_CHOICE</a> *> *cb) const</td></tr> <tr class="separator:a7201a6226eaf9cd348c507188084f466 inherit pro_methods_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pro_attribs_a04525"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_a04525')"><img src="closed.png" alt="-"/> Protected Attributes inherited from <a class="el" href="a04525.html">tesseract::Dawg</a></td></tr> <tr class="memitem:a8f628fef1da0ff7323958362f8286695 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a8f628fef1da0ff7323958362f8286695">type_</a></td></tr> <tr class="separator:a8f628fef1da0ff7323958362f8286695 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac03a89c4ecb3dc5b99ca0500f7f5db41 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a02929.html">STRING</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ac03a89c4ecb3dc5b99ca0500f7f5db41">lang_</a></td></tr> <tr class="separator:ac03a89c4ecb3dc5b99ca0500f7f5db41 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad33dc7881a2f933e801f0d5fd4ccbe41 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad33dc7881a2f933e801f0d5fd4ccbe41">perm_</a></td></tr> <tr class="memdesc:ad33dc7881a2f933e801f0d5fd4ccbe41 inherit pro_attribs_a04525"><td class="mdescLeft"> </td><td class="mdescRight">Permuter code that should be used if the word is found in this <a class="el" href="a04525.html">Dawg</a>. <a href="a04525.html#ad33dc7881a2f933e801f0d5fd4ccbe41">More...</a><br /></td></tr> <tr class="separator:ad33dc7881a2f933e801f0d5fd4ccbe41 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a96b429ef5449ad3cab057eb27d199c66 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a96b429ef5449ad3cab057eb27d199c66">unicharset_size_</a></td></tr> <tr class="separator:a96b429ef5449ad3cab057eb27d199c66 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1c15b73bdf9dc00d548836439a61925c inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a1c15b73bdf9dc00d548836439a61925c">flag_start_bit_</a></td></tr> <tr class="separator:a1c15b73bdf9dc00d548836439a61925c inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8a140175a0051a3691084942da99dfb0 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a8a140175a0051a3691084942da99dfb0">next_node_start_bit_</a></td></tr> <tr class="separator:a8a140175a0051a3691084942da99dfb0 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a35d2c5deb0a9bf3bc9452187aec40410 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00524.html#a7b5288262772176824620c2fb01a0abc">uinT64</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#a35d2c5deb0a9bf3bc9452187aec40410">next_node_mask_</a></td></tr> <tr class="separator:a35d2c5deb0a9bf3bc9452187aec40410 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad60ae15e5b48287343657d9ea9f20f15 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00524.html#a7b5288262772176824620c2fb01a0abc">uinT64</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad60ae15e5b48287343657d9ea9f20f15">flags_mask_</a></td></tr> <tr class="separator:ad60ae15e5b48287343657d9ea9f20f15 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad67c4d32f31869f9a592d01fc65a3a73 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00524.html#a7b5288262772176824620c2fb01a0abc">uinT64</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#ad67c4d32f31869f9a592d01fc65a3a73">letter_mask_</a></td></tr> <tr class="separator:ad67c4d32f31869f9a592d01fc65a3a73 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adc74b0871a5aafecd0daaf87b6cf4141 inherit pro_attribs_a04525"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a04525.html#adc74b0871a5aafecd0daaf87b6cf4141">debug_level_</a></td></tr> <tr class="separator:adc74b0871a5aafecd0daaf87b6cf4141 inherit pro_attribs_a04525"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Concrete class that can operate on a compacted (squished) <a class="el" href="a04525.html">Dawg</a> (read, search and write to file). This class is read-only in the sense that new words can not be added to an instance of <a class="el" href="a04537.html">SquishedDawg</a>. The underlying representation of the nodes and edges in <a class="el" href="a04537.html">SquishedDawg</a> is stored as a contiguous EDGE_ARRAY (read from file or given as an argument to the constructor). </p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00408">408</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="acc5922a679ddb742a41581f4bef3e8f1"></a> <h2 class="memtitle"><span class="permalink"><a href="#acc5922a679ddb742a41581f4bef3e8f1">◆ </a></span>SquishedDawg() <span class="overload">[1/3]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">tesseract::SquishedDawg::SquishedDawg </td> <td>(</td> <td class="paramtype">FILE * </td> <td class="paramname"><em>file</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a02929.html">STRING</a> & </td> <td class="paramname"><em>lang</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>debug_level</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00410">410</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  {</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  read_squished_dawg(file, <a class="code" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, <a class="code" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, perm, debug_level);</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  num_forward_edges_in_node0 = num_forward_edges(0);</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  }</div><div class="ttc" id="a04525_html_ab21ea9b8f44a9eb0ae18357d23a63d74"><div class="ttname"><a href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">tesseract::Dawg::type</a></div><div class="ttdeci">DawgType type() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00127">dawg.h:127</a></div></div> <div class="ttc" id="a04525_html_ad992d65fe05685da6b3aac0bb442bd59"><div class="ttname"><a href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">tesseract::Dawg::lang</a></div><div class="ttdeci">const STRING & lang() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00128">dawg.h:128</a></div></div> </div><!-- fragment --> </div> </div> <a id="addfd050f731473fc423b6a864bda0b5d"></a> <h2 class="memtitle"><span class="permalink"><a href="#addfd050f731473fc423b6a864bda0b5d">◆ </a></span>SquishedDawg() <span class="overload">[2/3]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">tesseract::SquishedDawg::SquishedDawg </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>filename</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a02929.html">STRING</a> & </td> <td class="paramname"><em>lang</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>debug_level</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00415">415</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><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>  FILE *file = fopen(<a class="code" href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">filename</a>, <span class="stringliteral">"rb"</span>);</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">if</span> (file == NULL) {</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Failed to open dawg file %s\n"</span>, <a class="code" href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">filename</a>);</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  exit(1);</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  }</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  read_squished_dawg(file, <a class="code" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, <a class="code" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, perm, debug_level);</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  num_forward_edges_in_node0 = num_forward_edges(0);</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  fclose(file);</div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  }</div><div class="ttc" id="a01739_html_ab85cc7ce156038d7a91fc6b51085c72e"><div class="ttname"><a href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">tesseract-c_api-demo.filename</a></div><div class="ttdeci">string filename</div><div class="ttdef"><b>Definition:</b> <a href="a00854_source.html#l00029">tesseract-c_api-demo.py:29</a></div></div> <div class="ttc" id="a04525_html_ab21ea9b8f44a9eb0ae18357d23a63d74"><div class="ttname"><a href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">tesseract::Dawg::type</a></div><div class="ttdeci">DawgType type() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00127">dawg.h:127</a></div></div> <div class="ttc" id="a00608_html_a02aa7cca2c3857c14716e8cca96ace6c"><div class="ttname"><a href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a></div><div class="ttdeci">#define tprintf(...)</div><div class="ttdef"><b>Definition:</b> <a href="a00608_source.html#l00031">tprintf.h:31</a></div></div> <div class="ttc" id="a04525_html_ad992d65fe05685da6b3aac0bb442bd59"><div class="ttname"><a href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">tesseract::Dawg::lang</a></div><div class="ttdeci">const STRING & lang() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00128">dawg.h:128</a></div></div> </div><!-- fragment --> </div> </div> <a id="ad7466d6af8db28db33569a447c6f039c"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad7466d6af8db28db33569a447c6f039c">◆ </a></span>SquishedDawg() <span class="overload">[3/3]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">tesseract::SquishedDawg::SquishedDawg </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#a51438783ac73f19b33094c73c9d55ce7">EDGE_ARRAY</a> </td> <td class="paramname"><em>edges</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>num_edges</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a01738.html#a07c41f251f1782c60df4e626c35d2151">DawgType</a> </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="a02929.html">STRING</a> & </td> <td class="paramname"><em>lang</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00395.html#a18e2c75cefe9e5b78e8ce41aa5fa25bc">PermuterType</a> </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>unicharset_size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>debug_level</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00426">426</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  :</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  edges_(edges), num_edges_(num_edges) {</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <a class="code" href="a04525.html#a6b415183039524d69b370b4e93acdf56">init</a>(<a class="code" href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">type</a>, <a class="code" href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">lang</a>, perm, unicharset_size, debug_level);</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  num_forward_edges_in_node0 = num_forward_edges(0);</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keywordflow">if</span> (debug_level > 3) print_all(<span class="stringliteral">"SquishedDawg:"</span>);</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  }</div><div class="ttc" id="a04525_html_ab21ea9b8f44a9eb0ae18357d23a63d74"><div class="ttname"><a href="a04525.html#ab21ea9b8f44a9eb0ae18357d23a63d74">tesseract::Dawg::type</a></div><div class="ttdeci">DawgType type() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00127">dawg.h:127</a></div></div> <div class="ttc" id="a04525_html_a6b415183039524d69b370b4e93acdf56"><div class="ttname"><a href="a04525.html#a6b415183039524d69b370b4e93acdf56">tesseract::Dawg::init</a></div><div class="ttdeci">void init(DawgType type, const STRING &lang, PermuterType perm, int unicharset_size, int debug_level)</div><div class="ttdef"><b>Definition:</b> <a href="a01136_source.html#l00176">dawg.cpp:176</a></div></div> <div class="ttc" id="a04525_html_ad992d65fe05685da6b3aac0bb442bd59"><div class="ttname"><a href="a04525.html#ad992d65fe05685da6b3aac0bb442bd59">tesseract::Dawg::lang</a></div><div class="ttdeci">const STRING & lang() const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00128">dawg.h:128</a></div></div> </div><!-- fragment --> </div> </div> <a id="a6fda4e74006c7510c36f323cd29b724d"></a> <h2 class="memtitle"><span class="permalink"><a href="#a6fda4e74006c7510c36f323cd29b724d">◆ </a></span>~SquishedDawg()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">tesseract::SquishedDawg::~SquishedDawg </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="a01136_source.html#l00199">199</a> of file <a class="el" href="a01136_source.html">dawg.cpp</a>.</p> <div class="fragment"><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> { <span class="keyword">delete</span>[] edges_; }</div></div><!-- fragment --> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a1b18c79b76c21d16c29f3f60736d7f90"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1b18c79b76c21d16c29f3f60736d7f90">◆ </a></span>edge_char_of()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> tesseract::SquishedDawg::edge_char_of </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> </td> <td class="paramname"><em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> </td> <td class="paramname"><em>unichar_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>word_end</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the edge that corresponds to the letter out of this node. </p> <p>Implements <a class="el" href="a04525.html#ad75874486a2a4d1f104df83ecb9fa321">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01136_source.html#l00201">201</a> of file <a class="el" href="a01136_source.html">dawg.cpp</a>.</p> <div class="fragment"><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge = node;</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">if</span> (node == 0) { <span class="comment">// binary search</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> start = 0;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> end = num_forward_edges_in_node0 - 1;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordtype">int</span> compare;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">while</span> (start <= end) {</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  edge = (start + end) >> 1; <span class="comment">// (start + end) / 2</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  compare = <a class="code" href="a04525.html#a27dbfb5dbe47cebcf7b11b63604b387a">given_greater_than_edge_rec</a>(NO_EDGE, word_end,</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  unichar_id, edges_[edge]);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keywordflow">if</span> (compare == 0) { <span class="comment">// given == vec[k]</span></div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordflow">return</span> edge;</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (compare == 1) { <span class="comment">// given > vec[k]</span></div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  start = edge + 1;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  } <span class="keywordflow">else</span> { <span class="comment">// given < vec[k]</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  end = edge - 1;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  }</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  } <span class="keywordflow">else</span> { <span class="comment">// linear search</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">if</span> (edge != NO_EDGE && edge_occupied(edge)) {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> ((<a class="code" href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">unichar_id_from_edge_rec</a>(edges_[edge]) == unichar_id) &&</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  (!word_end || <a class="code" href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">end_of_word_from_edge_rec</a>(edges_[edge])))</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">return</span> (edge);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  } <span class="keywordflow">while</span> (!last_edge(edge++));</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  }</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  }</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">return</span> (NO_EDGE); <span class="comment">// not found</span></div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> }</div><div class="ttc" id="a01139_html_a178eb445f9820b58d062f0c988a6f54f"><div class="ttname"><a href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a></div><div class="ttdeci">inT64 EDGE_REF</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00054">dawg.h:54</a></div></div> <div class="ttc" id="a04525_html_a27dbfb5dbe47cebcf7b11b63604b387a"><div class="ttname"><a href="a04525.html#a27dbfb5dbe47cebcf7b11b63604b387a">tesseract::Dawg::given_greater_than_edge_rec</a></div><div class="ttdeci">int given_greater_than_edge_rec(NODE_REF next_node, bool word_end, UNICHAR_ID unichar_id, const EDGE_RECORD &edge_rec) const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00245">dawg.h:245</a></div></div> <div class="ttc" id="a04525_html_aa6795f3e7e2e9c6943957ec09f8e9444"><div class="ttname"><a href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">tesseract::Dawg::end_of_word_from_edge_rec</a></div><div class="ttdeci">bool end_of_word_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns true if this edge marks the end of a word. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00220">dawg.h:220</a></div></div> <div class="ttc" id="a04525_html_ab7847f3606ca465452ac1840015bfe9a"><div class="ttname"><a href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">tesseract::Dawg::unichar_id_from_edge_rec</a></div><div class="ttdeci">UNICHAR_ID unichar_id_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns UNICHAR_ID recorded in this edge. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00224">dawg.h:224</a></div></div> </div><!-- fragment --> </div> </div> <a id="a64658d779aa3300938e1e0d93ac4b206"></a> <h2 class="memtitle"><span class="permalink"><a href="#a64658d779aa3300938e1e0d93ac4b206">◆ </a></span>edge_letter()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> tesseract::SquishedDawg::edge_letter </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> </td> <td class="paramname"><em>edge_ref</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns UNICHAR_ID stored in the edge indicated by the given EDGE_REF. </p> <p>Implements <a class="el" href="a04525.html#aeb12fee19d228b6225a495c9c115a77e">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00469">469</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><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>  <span class="keywordflow">return</span> <a class="code" href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">unichar_id_from_edge_rec</a>((edges_[edge_ref]));</div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  }</div><div class="ttc" id="a04525_html_ab7847f3606ca465452ac1840015bfe9a"><div class="ttname"><a href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">tesseract::Dawg::unichar_id_from_edge_rec</a></div><div class="ttdeci">UNICHAR_ID unichar_id_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns UNICHAR_ID recorded in this edge. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00224">dawg.h:224</a></div></div> </div><!-- fragment --> </div> </div> <a id="aa5540965df5277f08e17754f4c1e91da"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa5540965df5277f08e17754f4c1e91da">◆ </a></span>end_of_word()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool tesseract::SquishedDawg::end_of_word </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> </td> <td class="paramname"><em>edge_ref</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the edge indicated by the given EDGE_REF marks the end of a word. </p> <p>Implements <a class="el" href="a04525.html#a4b81cd795923fc21e8a0f9ea9a1f8626">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00464">464</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><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">return</span> <a class="code" href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">end_of_word_from_edge_rec</a>((edges_[edge_ref]));</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  }</div><div class="ttc" id="a04525_html_aa6795f3e7e2e9c6943957ec09f8e9444"><div class="ttname"><a href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">tesseract::Dawg::end_of_word_from_edge_rec</a></div><div class="ttdeci">bool end_of_word_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns true if this edge marks the end of a word. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00220">dawg.h:220</a></div></div> </div><!-- fragment --> </div> </div> <a id="ab2bd8e73d29ef362d8b20134b7603cf8"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab2bd8e73d29ef362d8b20134b7603cf8">◆ </a></span>next_node()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> tesseract::SquishedDawg::next_node </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> </td> <td class="paramname"><em>edge</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the next node visited by following the edge indicated by the given EDGE_REF. </p> <p>Implements <a class="el" href="a04525.html#ae68706a55d86637dec1da9615effb659">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00458">458</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  {</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="keywordflow">return</span> <a class="code" href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">next_node_from_edge_rec</a>((edges_[edge]));</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  }</div><div class="ttc" id="a04525_html_a0766fcf101abfe7f1d9bd9db9ce0ae3f"><div class="ttname"><a href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">tesseract::Dawg::next_node_from_edge_rec</a></div><div class="ttdeci">NODE_REF next_node_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns the next node visited by following this edge. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00207">dawg.h:207</a></div></div> </div><!-- fragment --> </div> </div> <a id="ac31f8bc5673fbda1ec05208f9b8caacc"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac31f8bc5673fbda1ec05208f9b8caacc">◆ </a></span>NumEdges()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int tesseract::SquishedDawg::NumEdges </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00436">436</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00436"></a><span class="lineno"> 436</span> { <span class="keywordflow">return</span> num_edges_; }</div></div><!-- fragment --> </div> </div> <a id="ad1967f664815b772205830f30a26ecc0"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad1967f664815b772205830f30a26ecc0">◆ </a></span>print_node()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void tesseract::SquishedDawg::print_node </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> </td> <td class="paramname"><em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>max_num_edges</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Prints the contents of the node indicated by the given NODE_REF. At most max_num_edges will be printed. </p> <p>Implements <a class="el" href="a04525.html#aa9e379edd04453122e805d9266f8f21c">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01136_source.html#l00246">246</a> of file <a class="el" href="a01136_source.html">dawg.cpp</a>.</p> <div class="fragment"><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  {</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordflow">if</span> (node == NO_EDGE) <span class="keywordflow">return</span>; <span class="comment">// nothing to print</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> </div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge = node;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *forward_string = <span class="stringliteral">"FORWARD"</span>;</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *backward_string = <span class="stringliteral">" "</span>;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *last_string = <span class="stringliteral">"LAST"</span>;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *not_last_string = <span class="stringliteral">" "</span>;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> </div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *eow_string = <span class="stringliteral">"EOW"</span>;</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *not_eow_string = <span class="stringliteral">" "</span>;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> </div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a>;</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *is_last;</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *eow;</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> </div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <a class="code" href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a> unichar_id;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> </div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="keywordflow">if</span> (edge_occupied(edge)) {</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <a class="code" href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a> =</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  forward_edge(edge) ? forward_string : backward_string;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  is_last = last_edge(edge) ? last_string : not_last_string;</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  eow = <a class="code" href="a04537.html#aa5540965df5277f08e17754f4c1e91da">end_of_word</a>(edge) ? eow_string : not_eow_string;</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>  unichar_id = <a class="code" href="a04537.html#a64658d779aa3300938e1e0d93ac4b206">edge_letter</a>(edge);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<a class="code" href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a> <span class="stringliteral">" : next = "</span> <a class="code" href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a> <span class="stringliteral">", unichar_id = %d, %s %s %s\n"</span>,</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  edge, <a class="code" href="a04537.html#ab2bd8e73d29ef362d8b20134b7603cf8">next_node</a>(edge), unichar_id,</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <a class="code" href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a>, is_last, eow);</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span> </div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">if</span> (edge - node > max_num_edges) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  } <span class="keywordflow">while</span> (!last_edge(edge++));</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span> </div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">if</span> (edge < num_edges_ &&</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  edge_occupied(edge) && backward_edge(edge)) {</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <a class="code" href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a> =</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  forward_edge(edge) ? forward_string : backward_string;</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  is_last = last_edge(edge) ? last_string : not_last_string;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  eow = <a class="code" href="a04537.html#aa5540965df5277f08e17754f4c1e91da">end_of_word</a>(edge) ? eow_string : not_eow_string;</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span> </div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  unichar_id = <a class="code" href="a04537.html#a64658d779aa3300938e1e0d93ac4b206">edge_letter</a>(edge);</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<a class="code" href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a> <span class="stringliteral">" : next = "</span> <a class="code" href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a></div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="stringliteral">", unichar_id = %d, %s %s %s\n"</span>,</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  edge, <a class="code" href="a04537.html#ab2bd8e73d29ef362d8b20134b7603cf8">next_node</a>(edge), unichar_id,</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <a class="code" href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a>, is_last, eow);</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> </div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">if</span> (edge - node > <a class="code" href="a01139.html#a2d04619cb05b140c086f2ec13778d235">MAX_NODE_EDGES_DISPLAY</a>) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  } <span class="keywordflow">while</span> (!last_edge(edge++));</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  }</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<a class="code" href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a> <span class="stringliteral">" : no edges in this node\n"</span>, node);</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  }</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"\n"</span>);</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> }</div><div class="ttc" id="a01139_html_a2d04619cb05b140c086f2ec13778d235"><div class="ttname"><a href="a01139.html#a2d04619cb05b140c086f2ec13778d235">MAX_NODE_EDGES_DISPLAY</a></div><div class="ttdeci">#define MAX_NODE_EDGES_DISPLAY</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00086">dawg.h:86</a></div></div> <div class="ttc" id="a01139_html_a178eb445f9820b58d062f0c988a6f54f"><div class="ttname"><a href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a></div><div class="ttdeci">inT64 EDGE_REF</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00054">dawg.h:54</a></div></div> <div class="ttc" id="a04537_html_ab2bd8e73d29ef362d8b20134b7603cf8"><div class="ttname"><a href="a04537.html#ab2bd8e73d29ef362d8b20134b7603cf8">tesseract::SquishedDawg::next_node</a></div><div class="ttdeci">NODE_REF next_node(EDGE_REF edge) const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00458">dawg.h:458</a></div></div> <div class="ttc" id="a04537_html_a64658d779aa3300938e1e0d93ac4b206"><div class="ttname"><a href="a04537.html#a64658d779aa3300938e1e0d93ac4b206">tesseract::SquishedDawg::edge_letter</a></div><div class="ttdeci">UNICHAR_ID edge_letter(EDGE_REF edge_ref) const</div><div class="ttdoc">Returns UNICHAR_ID stored in the edge indicated by the given EDGE_REF. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00469">dawg.h:469</a></div></div> <div class="ttc" id="a00434_html_a57d4a186a22b01e2110793bc22a5d8f0"><div class="ttname"><a href="a00434.html#a57d4a186a22b01e2110793bc22a5d8f0">direction</a></div><div class="ttdeci">int direction(EDGEPT *point)</div><div class="ttdef"><b>Definition:</b> <a href="a00434_source.html#l00043">vecfuncs.cpp:43</a></div></div> <div class="ttc" id="a00608_html_a02aa7cca2c3857c14716e8cca96ace6c"><div class="ttname"><a href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a></div><div class="ttdeci">#define tprintf(...)</div><div class="ttdef"><b>Definition:</b> <a href="a00608_source.html#l00031">tprintf.h:31</a></div></div> <div class="ttc" id="a01139_html_a85a5bf216156dfa399c5edd26f3694db"><div class="ttname"><a href="a01139.html#a85a5bf216156dfa399c5edd26f3694db">REFFORMAT</a></div><div class="ttdeci">#define REFFORMAT</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00092">dawg.h:92</a></div></div> <div class="ttc" id="a04537_html_aa5540965df5277f08e17754f4c1e91da"><div class="ttname"><a href="a04537.html#aa5540965df5277f08e17754f4c1e91da">tesseract::SquishedDawg::end_of_word</a></div><div class="ttdeci">bool end_of_word(EDGE_REF edge_ref) const</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00464">dawg.h:464</a></div></div> <div class="ttc" id="a00614_html_a8578b19fa1ff5ca75080db1a18ecc32e"><div class="ttname"><a href="a00614.html#a8578b19fa1ff5ca75080db1a18ecc32e">UNICHAR_ID</a></div><div class="ttdeci">int UNICHAR_ID</div><div class="ttdef"><b>Definition:</b> <a href="a00614_source.html#l00033">unichar.h:33</a></div></div> </div><!-- fragment --> </div> </div> <a id="a153afa8a2cdf01c5431b77f463fd3af5"></a> <h2 class="memtitle"><span class="permalink"><a href="#a153afa8a2cdf01c5431b77f463fd3af5">◆ </a></span>unichar_ids_of()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void tesseract::SquishedDawg::unichar_ids_of </td> <td>(</td> <td class="paramtype"><a class="el" href="a01139.html#ac76aca11806fd7167c274dc45b7f7fe8">NODE_REF</a> </td> <td class="paramname"><em>node</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a01738.html#a5084886f7cd9adefa73d03111d92f593">NodeChildVector</a> * </td> <td class="paramname"><em>vec</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>word_end</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Fills the given NodeChildVector with all the unichar ids (and the corresponding EDGE_REFs) for which there is an edge out of this node. </p> <p>Implements <a class="el" href="a04525.html#a42c5fd8a25cc11cd3c059a23b63ced05">tesseract::Dawg</a>.</p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00444">444</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  {</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge = node;</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="keywordflow">if</span> (!edge_occupied(edge) || edge == NO_EDGE) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  assert(forward_edge(edge)); <span class="comment">// we don't expect any backward edges to</span></div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="keywordflow">do</span> { <span class="comment">// be present when this function is called</span></div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  <span class="keywordflow">if</span> (!word_end || <a class="code" href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">end_of_word_from_edge_rec</a>(edges_[edge])) {</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  vec->push_back(NodeChild(<a class="code" href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">unichar_id_from_edge_rec</a>(edges_[edge]), edge));</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  }</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  } <span class="keywordflow">while</span> (!last_edge(edge++));</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  }</div><div class="ttc" id="a01139_html_a178eb445f9820b58d062f0c988a6f54f"><div class="ttname"><a href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a></div><div class="ttdeci">inT64 EDGE_REF</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00054">dawg.h:54</a></div></div> <div class="ttc" id="a04525_html_aa6795f3e7e2e9c6943957ec09f8e9444"><div class="ttname"><a href="a04525.html#aa6795f3e7e2e9c6943957ec09f8e9444">tesseract::Dawg::end_of_word_from_edge_rec</a></div><div class="ttdeci">bool end_of_word_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns true if this edge marks the end of a word. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00220">dawg.h:220</a></div></div> <div class="ttc" id="a04525_html_ab7847f3606ca465452ac1840015bfe9a"><div class="ttname"><a href="a04525.html#ab7847f3606ca465452ac1840015bfe9a">tesseract::Dawg::unichar_id_from_edge_rec</a></div><div class="ttdeci">UNICHAR_ID unichar_id_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns UNICHAR_ID recorded in this edge. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00224">dawg.h:224</a></div></div> </div><!-- fragment --> </div> </div> <a id="a5b6d0a893b2a8e64c901d514a3da924e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5b6d0a893b2a8e64c901d514a3da924e">◆ </a></span>write_squished_dawg() <span class="overload">[1/2]</span></h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void tesseract::SquishedDawg::write_squished_dawg </td> <td>(</td> <td class="paramtype">FILE * </td> <td class="paramname"><em>file</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Writes the squished/reduced <a class="el" href="a04525.html">Dawg</a> to a file. </p> <p class="definition">Definition at line <a class="el" href="a01136_source.html#l00387">387</a> of file <a class="el" href="a01136_source.html">dawg.cpp</a>.</p> <div class="fragment"><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>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> edge;</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <a class="code" href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a> num_edges;</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <a class="code" href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a> node_count = 0;</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <a class="code" href="a01139.html#a62f0e84ff219b74912d723e231fefd00">NODE_MAP</a> node_map;</div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <a class="code" href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a> old_index;</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <a class="code" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a> temp_record;</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span> </div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <span class="keywordflow">if</span> (<a class="code" href="a04525.html#adc74b0871a5aafecd0daaf87b6cf4141">debug_level_</a>) <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"write_squished_dawg\n"</span>);</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> </div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  node_map = build_node_map(&node_count);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span> </div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="comment">// Write the magic number to help detecting a change in endianness.</span></div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="a00524.html#a8d41499d38c24d39b221ab0c158fe5a8">inT16</a> magic = <a class="code" href="a04525.html#a6f2b9b30147a54ee156dcb2aa49b110d">kDawgMagicNumber</a>;</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  fwrite(&magic, <span class="keyword">sizeof</span>(<a class="code" href="a00524.html#a8d41499d38c24d39b221ab0c158fe5a8">inT16</a>), 1, file);</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  fwrite(&<a class="code" href="a04525.html#a96b429ef5449ad3cab057eb27d199c66">unicharset_size_</a>, <span class="keyword">sizeof</span>(<a class="code" href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a>), 1, file);</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="comment">// Count the number of edges in this Dawg.</span></div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  num_edges = 0;</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <span class="keywordflow">for</span> (edge=0; edge < num_edges_; edge++)</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keywordflow">if</span> (forward_edge(edge))</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  num_edges++;</div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span> </div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  fwrite(&num_edges, <span class="keyword">sizeof</span>(<a class="code" href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a>), 1, file); <span class="comment">// write edge count to file</span></div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> </div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="keywordflow">if</span> (<a class="code" href="a04525.html#adc74b0871a5aafecd0daaf87b6cf4141">debug_level_</a>) {</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"%d nodes in DAWG\n"</span>, node_count);</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"%d edges in DAWG\n"</span>, num_edges);</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  }</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="keywordflow">for</span> (edge = 0; edge < num_edges_; edge++) {</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">if</span> (forward_edge(edge)) { <span class="comment">// write forward edges</span></div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <span class="keywordflow">do</span> {</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  old_index = <a class="code" href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">next_node_from_edge_rec</a>(edges_[edge]);</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  set_next_node(edge, node_map[old_index]);</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  temp_record = edges_[edge];</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  fwrite(&(temp_record), <span class="keyword">sizeof</span>(<a class="code" href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a>), 1, file);</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  set_next_node(edge, old_index);</div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  } <span class="keywordflow">while</span> (!last_edge(edge++));</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="keywordflow">if</span> (edge >= num_edges_) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="keywordflow">if</span> (backward_edge(edge)) <span class="comment">// skip back links</span></div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="keywordflow">while</span> (!last_edge(edge++));</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span> </div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  edge--;</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>  }</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  free(node_map);</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span> }</div><div class="ttc" id="a01139_html_a178eb445f9820b58d062f0c988a6f54f"><div class="ttname"><a href="a01139.html#a178eb445f9820b58d062f0c988a6f54f">EDGE_REF</a></div><div class="ttdeci">inT64 EDGE_REF</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00054">dawg.h:54</a></div></div> <div class="ttc" id="a00524_html_a8d41499d38c24d39b221ab0c158fe5a8"><div class="ttname"><a href="a00524.html#a8d41499d38c24d39b221ab0c158fe5a8">inT16</a></div><div class="ttdeci">short inT16</div><div class="ttdef"><b>Definition:</b> <a href="a00524_source.html#l00033">host.h:33</a></div></div> <div class="ttc" id="a04525_html_a6f2b9b30147a54ee156dcb2aa49b110d"><div class="ttname"><a href="a04525.html#a6f2b9b30147a54ee156dcb2aa49b110d">tesseract::Dawg::kDawgMagicNumber</a></div><div class="ttdeci">static const inT16 kDawgMagicNumber</div><div class="ttdoc">Magic number to determine endianness when reading the Dawg from file. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00121">dawg.h:121</a></div></div> <div class="ttc" id="a01139_html_a62f0e84ff219b74912d723e231fefd00"><div class="ttname"><a href="a01139.html#a62f0e84ff219b74912d723e231fefd00">NODE_MAP</a></div><div class="ttdeci">EDGE_REF * NODE_MAP</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00056">dawg.h:56</a></div></div> <div class="ttc" id="a04525_html_a96b429ef5449ad3cab057eb27d199c66"><div class="ttname"><a href="a04525.html#a96b429ef5449ad3cab057eb27d199c66">tesseract::Dawg::unicharset_size_</a></div><div class="ttdeci">int unicharset_size_</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00304">dawg.h:304</a></div></div> <div class="ttc" id="a04525_html_adc74b0871a5aafecd0daaf87b6cf4141"><div class="ttname"><a href="a04525.html#adc74b0871a5aafecd0daaf87b6cf4141">tesseract::Dawg::debug_level_</a></div><div class="ttdeci">int debug_level_</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00311">dawg.h:311</a></div></div> <div class="ttc" id="a00524_html_aba1f582fd0168f3ff9225d8c90fa9eb8"><div class="ttname"><a href="a00524.html#aba1f582fd0168f3ff9225d8c90fa9eb8">inT32</a></div><div class="ttdeci">int inT32</div><div class="ttdef"><b>Definition:</b> <a href="a00524_source.html#l00035">host.h:35</a></div></div> <div class="ttc" id="a00608_html_a02aa7cca2c3857c14716e8cca96ace6c"><div class="ttname"><a href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a></div><div class="ttdeci">#define tprintf(...)</div><div class="ttdef"><b>Definition:</b> <a href="a00608_source.html#l00031">tprintf.h:31</a></div></div> <div class="ttc" id="a04525_html_a0766fcf101abfe7f1d9bd9db9ce0ae3f"><div class="ttname"><a href="a04525.html#a0766fcf101abfe7f1d9bd9db9ce0ae3f">tesseract::Dawg::next_node_from_edge_rec</a></div><div class="ttdeci">NODE_REF next_node_from_edge_rec(const EDGE_RECORD &edge_rec) const</div><div class="ttdoc">Returns the next node visited by following this edge. </div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00207">dawg.h:207</a></div></div> <div class="ttc" id="a01139_html_a04b50b4c4f290148d1bee82f401a31fa"><div class="ttname"><a href="a01139.html#a04b50b4c4f290148d1bee82f401a31fa">EDGE_RECORD</a></div><div class="ttdeci">uinT64 EDGE_RECORD</div><div class="ttdef"><b>Definition:</b> <a href="a01139_source.html#l00050">dawg.h:50</a></div></div> </div><!-- fragment --> </div> </div> <a id="a090fe2daf7bedae8d2a2403eb2cdfe38"></a> <h2 class="memtitle"><span class="permalink"><a href="#a090fe2daf7bedae8d2a2403eb2cdfe38">◆ </a></span>write_squished_dawg() <span class="overload">[2/2]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void tesseract::SquishedDawg::write_squished_dawg </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>filename</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Opens the file with the given filename and writes the squished/reduced <a class="el" href="a04525.html">Dawg</a> to the file. </p> <p class="definition">Definition at line <a class="el" href="a01139_source.html#l00482">482</a> of file <a class="el" href="a01139_source.html">dawg.h</a>.</p> <div class="fragment"><div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  {</div><div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  FILE *file = fopen(<a class="code" href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">filename</a>, <span class="stringliteral">"wb"</span>);</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  <span class="keywordflow">if</span> (file == NULL) {</div><div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  <a class="code" href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a>(<span class="stringliteral">"Error opening %s\n"</span>, <a class="code" href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">filename</a>);</div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  exit(1);</div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  }</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  this-><a class="code" href="a04537.html#a5b6d0a893b2a8e64c901d514a3da924e">write_squished_dawg</a>(file);</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  fclose(file);</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  }</div><div class="ttc" id="a04537_html_a5b6d0a893b2a8e64c901d514a3da924e"><div class="ttname"><a href="a04537.html#a5b6d0a893b2a8e64c901d514a3da924e">tesseract::SquishedDawg::write_squished_dawg</a></div><div class="ttdeci">void write_squished_dawg(FILE *file)</div><div class="ttdoc">Writes the squished/reduced Dawg to a file. </div><div class="ttdef"><b>Definition:</b> <a href="a01136_source.html#l00387">dawg.cpp:387</a></div></div> <div class="ttc" id="a01739_html_ab85cc7ce156038d7a91fc6b51085c72e"><div class="ttname"><a href="a01739.html#ab85cc7ce156038d7a91fc6b51085c72e">tesseract-c_api-demo.filename</a></div><div class="ttdeci">string filename</div><div class="ttdef"><b>Definition:</b> <a href="a00854_source.html#l00029">tesseract-c_api-demo.py:29</a></div></div> <div class="ttc" id="a00608_html_a02aa7cca2c3857c14716e8cca96ace6c"><div class="ttname"><a href="a00608.html#a02aa7cca2c3857c14716e8cca96ace6c">tprintf</a></div><div class="ttdeci">#define tprintf(...)</div><div class="ttdef"><b>Definition:</b> <a href="a00608_source.html#l00031">tprintf.h:31</a></div></div> </div><!-- fragment --> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>dict/<a class="el" href="a01139_source.html">dawg.h</a></li> <li>dict/<a class="el" href="a01136_source.html">dawg.cpp</a></li> </ul> </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="a01738.html">tesseract</a></li><li class="navelem"><a class="el" href="a04537.html">SquishedDawg</a></li> <li class="footer">Generated on Mon Oct 29 2018 11:28:05 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>