eassert(feof(db));
}
-static void callout_unknown(int w, int h, Pixcol cols[], int unk_l, int unk_r,
+static void callout_unknown(int w, int h, Pixcol cols[],
+ int unk_l, int unk_r, int unk_ctx,
const OcrResultGlyph *sofar, int nsofar) {
int pfd[2], c, r,i, x,y;
const OcrResultGlyph *s;
r= close(pfd[0]); eassert(!r);
resolver= fdopen(pfd[1],"w"); eassert(resolver);
}
- fprintf(resolver,"%d %d",unk_l,unk_r);
+ fprintf(resolver,"%d %d %d",unk_l,unk_r,unk_ctx);
for (i=0, s=sofar; i<nsofar; i++, s++) {
fprintf(resolver," %d %d %d ",s->l,s->r,s->ctx);
for (p=s->s; (c= *p); p++) {
} else {
int rx;
fprintf(debug," UNKNOWN");
- for (rx=lx+1; rx<w && cols[rx]; rx++);
+ for (rx=lx; rx<w && cols[rx]; rx++);
fprintf(debug," x=%d ctx=%d %d..%d\n",x, ctx, lx,rx);
debug_flush();
- callout_unknown(w,h,cols, lx,rx, results,nresults);
+ callout_unknown(w,h,cols, lx,rx-1,ctx, results,nresults);
goto restart;
}
}