MCPcopy Create free account
hub / github.com/creatale/node-dv / SummaryStr

Method SummaryStr

deps/tesseract/classify/shapetable.cpp:323–341  ·  view source on GitHub ↗

Returns a debug string summarizing the table.

Source from the content-addressed store, hash-verified

321
322// Returns a debug string summarizing the table.
323STRING ShapeTable::SummaryStr() const {
324 int max_unichars = 0;
325 int num_multi_shapes = 0;
326 int num_master_shapes = 0;
327 for (int s = 0; s < shape_table_.size(); ++s) {
328 if (MasterDestinationIndex(s) != s) continue;
329 ++num_master_shapes;
330 int shape_size = GetShape(s).size();
331 if (shape_size > 1)
332 ++num_multi_shapes;
333 if (shape_size > max_unichars)
334 max_unichars = shape_size;
335 }
336 STRING result;
337 result.add_str_int("Number of shapes = ", num_master_shapes);
338 result.add_str_int(" max unichars = ", max_unichars);
339 result.add_str_int(" number with multiple unichars = ", num_multi_shapes);
340 return result;
341}
342
343
344// Adds a new shape starting with the given unichar_id and font_id.

Callers 1

SetupMasterShapesMethod · 0.80

Calls 2

add_str_intMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected