#include <search_node.h>
Definition at line 109 of file search_node.h.
◆ SearchNodeHashTable()
tesseract::SearchNodeHashTable::SearchNodeHashTable |
( |
| ) |
|
|
inline |
Definition at line 111 of file search_node.h.
112 memset(bin_size_array_, 0,
sizeof(bin_size_array_));
◆ ~SearchNodeHashTable()
tesseract::SearchNodeHashTable::~SearchNodeHashTable |
( |
| ) |
|
|
inline |
◆ Insert()
Definition at line 119 of file search_node.h.
121 unsigned int edge_hash = lang_mod_edge->Hash();
122 unsigned int parent_hash = (srch_node->ParentNode() == NULL ?
123 0 : srch_node->ParentNode()->LangModelEdge()->Hash());
124 unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
127 if (bin_size_array_[hash_bin] >= kMaxSearchNodePerBin) {
131 bin_array_[hash_bin][bin_size_array_[hash_bin]++] = srch_node;
◆ Lookup()
Definition at line 137 of file search_node.h.
140 unsigned int edge_hash = lang_mod_edge->Hash();
141 unsigned int parent_hash = (parent_node == NULL ?
142 0 : parent_node->LangModelEdge()->Hash());
143 unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
146 for (
int node_idx = 0; node_idx < bin_size_array_[hash_bin]; node_idx++) {
147 if (lang_mod_edge->IsIdentical(
148 bin_array_[hash_bin][node_idx]->LangModelEdge()) ==
true &&
150 bin_array_[hash_bin][node_idx]->ParentNode(), parent_node) ==
true) {
151 return bin_array_[hash_bin][node_idx];
static bool IdenticalPath(SearchNode *node1, SearchNode *node2)
The documentation for this class was generated from the following file: