19#ifndef TESSERACT_TRAINING_UTIL_H_
20#define TESSERACT_TRAINING_UTIL_H_
34 const uint8_t* str =
reinterpret_cast<const uint8_t*
>(s.c_str());
35 for (
unsigned ch = 0; str[ch] != 0; ++ch) {
36 hash_code += str[ch] << (ch % 24);
42struct StringHash :
public stdext::hash_compare <std::string> {
43 size_t operator()(
const std::string& s)
const {
45 const uint8_t* str =
reinterpret_cast<const uint8_t*
>(s.c_str());
46 for (
unsigned ch = 0; str[ch] != 0; ++ch) {
47 hash_code += str[ch] << (ch % 24);
51 bool operator()(
const std::string& s1,
const std::string& s2)
const {
57#ifdef GOOGLE_TESSERACT
58#include "base/heap-checker.h"
59#define DISABLE_HEAP_LEAK_CHECK HeapLeakChecker::Disabler disabler
61#define DISABLE_HEAP_LEAK_CHECK {}
size_t operator()(const std::string &s) const