<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 2 Nov 2018 at 18:44, Edwin Ancaer <<a href="mailto:eancaer@gmail.com">eancaer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello list, <br></div><div><br></div><div>As I'm looking at a way to automate the search of documents in my humble administration, I read some articles about OCR. I came along an article about using Python with Tesseract, to transform an scan of a document into text, that is searchable. <br></div><div><br></div><div>My question now is if I can do something similar with Squeak. To my inexperienced eye, it seems like I should use FFI to call the functions in the Tesseract API, but this API is in  C++, and I don't know if it is possible to use FFI to call C++ functions?</div></div></blockquote><div><br></div><div>You are right C++ is difficult because of the name mangling of function symbols, </div><div>but good fortune I notice Tesseract has C bindings...</div><div>    <a href="https://github.com/tesseract-ocr/tesseract#for-developers">https://github.com/tesseract-ocr/tesseract#for-developers</a><br></div><div>    <a href="https://github.com/tesseract-ocr/tesseract/blob/master/src/api/capi.h">https://github.com/tesseract-ocr/tesseract/blob/master/src/api/capi.h</a></div><div>so it looks like you are in the clear.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Or should I forget the API and use OSProcess to start the tesseract program? <br></div></div></blockquote><div><br></div><div>FFI will be more flexible.</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Could anyone point me in the right direction, or just tell  if the whole idea is insane?<br></div></div></blockquote><div><br></div><div>I think its a great idea and actually Tesseract FFI is something I've wanted to play with before but not had the time.</div><div>I'd be interested to hear how you go with it.</div><div><br></div><div>cheers -ben</div></div></div></div></div>