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

Method GetUTF8Text

deps/tesseract/api/baseapi.cpp:1281–1297  ·  view source on GitHub ↗

Make a text string from the internal data structures. */

Source from the content-addressed store, hash-verified

1279
1280/** Make a text string from the internal data structures. */
1281char* TessBaseAPI::GetUTF8Text() {
1282 if (tesseract_ == NULL ||
1283 (!recognition_done_ && Recognize(NULL) < 0))
1284 return NULL;
1285 STRING text("");
1286 ResultIterator *it = GetIterator();
1287 do {
1288 if (it->Empty(RIL_PARA)) continue;
1289 char *para_text = it->GetUTF8Text(RIL_PARA);
1290 text += para_text;
1291 delete []para_text;
1292 } while (it->Next(RIL_PARA));
1293 char* result = new char[text.length() + 1];
1294 strncpy(result, text.string(), text.length() + 1);
1295 delete it;
1296 return result;
1297}
1298
1299/**
1300 * Gets the block orientation at the current iterator position.

Callers 10

NAN_METHODFunction · 0.45
TransformResultMethod · 0.45
TessBaseAPIGetUTF8TextFunction · 0.45
GetHOCRTextMethod · 0.45
GetTSVTextMethod · 0.45
GetBoxTextMethod · 0.45
GetPDFTextObjectsMethod · 0.45
AddImageHandlerMethod · 0.45

Calls 4

EmptyMethod · 0.45
NextMethod · 0.45
lengthMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected