diff --git a/src/api/hocrrenderer.cpp b/src/api/hocrrenderer.cpp index cd3016ac2c..fe88164a73 100644 --- a/src/api/hocrrenderer.cpp +++ b/src/api/hocrrenderer.cpp @@ -209,8 +209,21 @@ char* TessBaseAPI::GetHOCRText(ETEXT_DESC* monitor, int page_number) { AddBoxTohOCR(res_it.get(), RIL_PARA, hocr_str); } if (res_it->IsAtBeginningOf(RIL_TEXTLINE)) { - hocr_str << "\n BlockType()) { + case PT_HEADING_TEXT: + hocr_str << "ocr_header"; + break; + case PT_PULLOUT_TEXT: + hocr_str << "ocr_textfloat"; + break; + case PT_CAPTION_TEXT: + hocr_str << "ocr_caption"; + break; + default: + hocr_str << "ocr_line"; + } + hocr_str << "' id='" << "line_" << page_id << "_" << lcnt << "'"; AddBoxTohOCR(res_it.get(), RIL_TEXTLINE, hocr_str); }