X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=pctb%2Fstructure.c;h=8141feb3db461c60099841db25d3a4954d018dec;hp=8919e0b07e9f69a909819d381c6faa0537f579e0;hb=a5c969e80989ea2c678a99b46e7db08ae553e59d;hpb=18c4ed62b79ac9aa7e3f0ec4104068483e03086f diff --git a/pctb/structure.c b/pctb/structure.c index 8919e0b..8141feb 100644 --- a/pctb/structure.c +++ b/pctb/structure.c @@ -339,7 +339,7 @@ static void find_table_entry(Rect commod, int colno, Rect *cellr) { require_rectangle_r(*cellr, " o"); } -static void ocr_rectangle(Rect r, const OcrCellType ct) { +static void ocr_rectangle(Rect r, const OcrCellType ct, FILE *tsv_output) { OcrResultGlyph *results, *res; int w= r.br.x - r.tl.x + 1; @@ -364,10 +364,10 @@ static void ocr_rectangle(Rect r, const OcrCellType ct) { results= ocr(rd,ct,w,cols); for (res=results; res->s; res++) - printf("%s",res->s); + fputs(res->s,tsv_output); } -void analyse(void) { +void analyse(FILE *tsv_output) { Rect thisr, entryr; int page, tryrect, colno; @@ -386,16 +386,17 @@ void analyse(void) { const char *tab= ""; for (colno=0; colno