23 #ifndef TESSERACT_CLASSIFY_SHAPETABLE_H_ 24 #define TESSERACT_CLASSIFY_SHAPETABLE_H_ 50 tprintf(
"Unichar-id=%d, rating=%g, adapted=%d, config=%d, misses=%d," 195 return destination_index_;
198 destination_index_ = index;
201 return unichars_.size();
206 return unichars_[index];
210 unichars_[index].unichar_id = unichar_id;
226 uint32_t properties)
const;
246 bool unichars_sorted_;
249 int destination_index_;
276 return shape_table_.size();
299 int AddShape(
int unichar_id,
int font_id);
307 void AddToShape(
int shape_id,
int unichar_id,
int font_id);
314 int FindShape(
int unichar_id,
int font_id)
const;
317 int* unichar_id,
int* font_id)
const;
321 return *shape_table_[shape_id];
324 return shape_table_[shape_id];
349 void SwapShapes(
int shape_id1,
int shape_id2);
373 bool CommonFont(
int shape_id1,
int shape_id2)
const;
389 int AddUnicharToResults(
int unichar_id,
float rating,
399 mutable int num_fonts_;
404 #endif // TESSERACT_CLASSIFY_SHAPETABLE_H_ bool MergeSubsetUnichar(int merge_id1, int merge_id2, int shape_id) const
bool ContainsFont(int font_id) const
STRING SummaryStr() const
bool Serialize(FILE *fp) const
void set_unicharset(const UNICHARSET &unicharset)
const UNICHARSET & unicharset() const
bool DeSerialize(TFile *fp)
static int FirstResultWithUnichar(const GenericVector< ShapeRating > &results, const ShapeTable &shape_table, UNICHAR_ID unichar_id)
bool CommonFont(int shape_id1, int shape_id2) const
STRING DebugStr(int shape_id) const
int MasterUnicharCount(int shape_id) const
bool IsSubsetOf(const Shape &other) const
UnicharRating(int u, float r)
int BuildFromShape(const Shape &shape, const ShapeTable &master_shapes)
bool DeSerialize(TFile *fp)
static int FirstResultWithUnichar(const GenericVector< UnicharRating > &results, UNICHAR_ID unichar_id)
bool Serialize(FILE *fp) const
bool Serialize(FILE *fp) const
bool CommonUnichars(int shape_id1, int shape_id2) const
int FindShape(int unichar_id, int font_id) const
bool AnyMultipleUnichars() const
void SwapShapes(int shape_id1, int shape_id2)
bool ContainsFontProperties(const FontInfoTable &font_table, uint32_t properties) const
static int SortByUnicharId(const void *v1, const void *v2)
static int SortDescendingRating(const void *t1, const void *t2)
const UnicharAndFonts & operator[](int index) const
Shape * MutableShape(int shape_id)
void AppendMasterShapes(const ShapeTable &other, GenericVector< int > *shape_map)
int MasterFontCount(int shape_id) const
bool ContainsUnicharAndFont(int unichar_id, int font_id) const
bool AlreadyMerged(int shape_id1, int shape_id2) const
int NumMasterShapes() const
ShapeQueueEntry(const ShapeRating &rating, int level0)
void set_destination_index(int index)
void AddShape(const Shape &other)
bool operator==(const Shape &other) const
bool SubsetUnichar(int shape_id1, int shape_id2) const
int MaxNumUnichars() const
void AddToShape(int shape_id, int unichar_id, int font_id)
bool IsEqualUnichars(Shape *other)
static int SortDescendingRating(const void *t1, const void *t2)
DLLSYM void tprintf(const char *format,...)
int MasterDestinationIndex(int shape_id) const
const Shape & GetShape(int shape_id) const
void DeleteShape(int shape_id)
bool MergeEqualUnichars(int merge_id1, int merge_id2, int shape_id) const
int destination_index() const
int AddShape(int unichar_id, int font_id)
bool ContainsUnichar(int unichar_id) const
void ReMapClassIds(const GenericVector< int > &unicharset_map)
void GetFirstUnicharAndFont(int shape_id, int *unichar_id, int *font_id) const
void AddShapeToResults(const ShapeRating &shape_rating, GenericVector< int > *unichar_map, GenericVector< UnicharRating > *results) const
void ForceFontMerges(int start, int end)
void MergeShapes(int shape_id1, int shape_id2)
void AddShapeToShape(int shape_id, const Shape &other)
UnicharAndFonts(int uni_id, int font_id)
GenericVector< int32_t > font_ids
int MergedUnicharCount(int shape_id1, int shape_id2) const
void SetUnicharId(int index, int unichar_id)
bool operator<(const ShapeQueueEntry &other) const
void AddToShape(int unichar_id, int font_id)
bool EqualUnichars(int shape_id1, int shape_id2) const
bool ContainsMultipleFontProperties(const FontInfoTable &font_table) const
ShapeRating(int s, float r)
GenericVector< ScoredFont > fonts
bool DeSerialize(TFile *fp)