fcheng00 / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 1 forks source link

support retrieving paragraph info through capi #1388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Could we add support for retrieving paragraph information 
(TessPageIterator::ParagraphInfo) from the CAPI. 

See the attached patch.

Original issue reported on code.google.com by Charles....@gmail.com on 7 Dec 2014 at 8:16

Attachments:

GoogleCodeExporter commented 9 years ago
thanks. Commited in 4da712d04db9

Original comment by zde...@gmail.com on 7 Dec 2014 at 1:08

GoogleCodeExporter commented 9 years ago
C does not support bool type.

capi.h:

TESS_API void  TESS_CALL TessPageIteratorParagraphInfo(TessPageIterator* 
handle, TessParagraphJustification* justification,
    BOOL *is_list_item, BOOL *is_crown, int *first_line_indent);

capi.cpp:

TESS_API void TESS_CALL TessPageIteratorParagraphInfo(TessPageIterator* handle, 
TessParagraphJustification* justification,
    BOOL *is_list_item,
    BOOL *is_crown,
    int *first_line_indent)
{
    bool bool_is_list_item, bool_is_crown;
    handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
    if (is_list_item)
        *is_list_item = bool_is_list_item ? TRUE : FALSE;
    if (is_crown)
        *is_crown = bool_is_crown ? TRUE : FALSE;
}

Original comment by nguyen...@gmail.com on 22 Dec 2014 at 6:48

GoogleCodeExporter commented 9 years ago
thanks nguyenq87.

Original comment by zde...@gmail.com on 28 Dec 2014 at 4:56