Using overload to avoid API change

This commit is contained in:
Pablo Duboue 2024-04-03 04:41:40 -07:00
parent 30aef44b9f
commit efb267097d
2 changed files with 19 additions and 1 deletions

View File

@ -564,7 +564,15 @@ public:
* page_number is 0-based but will appear in the output as 1-based.
* Returned string must be freed with the delete [] operator.
*/
char *GetTSVText(int page_number, bool lang_info=false);
char *GetTSVText(int page_number);
/**
* Make a TSV-formatted string from the internal data structures.
* Allows additional column with detected language.
* page_number is 0-based but will appear in the output as 1-based.
* Returned string must be freed with the delete [] operator.
*/
char *GetTSVText(int page_number, bool lang_info);
/**
* Make a box file for LSTM training from the internal data structures.

View File

@ -1421,6 +1421,16 @@ static void AddBoxToTSV(const PageIterator *it, PageIteratorLevel level, std::st
* page_number is 0-based but will appear in the output as 1-based.
* Returned string must be freed with the delete [] operator.
*/
char *TessBaseAPI::GetTSVText(int page_number) {
return GetTSVText(page_number, false);
}
/**
* Make a TSV-formatted string from the internal data structures.
* Allows additional column with detected language.
* page_number is 0-based but will appear in the output as 1-based.
* Returned string must be freed with the delete [] operator.
*/
char *TessBaseAPI::GetTSVText(int page_number, bool lang_info) {
if (tesseract_ == nullptr || (page_res_ == nullptr && Recognize(nullptr) < 0)) {
return nullptr;