Skip to content

Commit 29cc0f3

Browse files
author
Robert Sachunsky
committed
convert more C++ exceptions to Python
1 parent 853a885 commit 29cc0f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tesserocr/tesseract5.pxd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ cdef extern from "tesseract/pageiterator.h" namespace "tesseract" nogil:
146146

147147
cdef extern from "tesseract/ltrresultiterator.h" namespace "tesseract" nogil:
148148
cdef cppclass LTRResultIterator(PageIterator):
149-
char *GetUTF8Text(PageIteratorLevel) const
149+
char *GetUTF8Text(PageIteratorLevel) except + # const (https://stackoverflow.com/a/29396365)
150150
void SetLineSeparator(cchar_t *)
151151
void SetParagraphSeparator(cchar_t *)
152152
float Confidence(PageIteratorLevel) const
@@ -172,7 +172,7 @@ cdef extern from "tesseract/ltrresultiterator.h" namespace "tesseract" nogil:
172172
cdef cppclass ChoiceIterator:
173173
ChoiceIterator(const LTRResultIterator &) except +
174174
bool Next()
175-
cchar_t *GetUTF8Text() const
175+
cchar_t *GetUTF8Text() except + # const (https://stackoverflow.com/a/29396365)
176176
float Confidence() const
177177

178178
cdef extern from "tesseract/resultiterator.h" namespace "tesseract" nogil:
@@ -309,14 +309,14 @@ cdef extern from "tesseract/baseapi.h" namespace "tesseract" nogil:
309309
bool ProcessPages(cchar_t *, cchar_t *, int, TessResultRenderer *)
310310
bool ProcessPage(Pix *, int, cchar_t *, cchar_t *, int, TessResultRenderer *)
311311
ResultIterator *GetIterator()
312-
char *GetUTF8Text()
312+
char *GetUTF8Text() except +
313313
char *GetHOCRText(int)
314314
char *GetTSVText(int)
315315
char *GetBoxText(int)
316316
char *GetUNLVText()
317317
bool DetectOrientationScript(int *, float *, cchar_t **, float *)
318318
int MeanTextConf()
319-
int *AllWordConfidences()
319+
int *AllWordConfidences() except +
320320
bool AdaptToWordStr(PageSegMode, cchar_t *)
321321
void Clear()
322322
void End()

0 commit comments

Comments
 (0)