X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Focr.c;h=92b09031c5c53ccde0029c0b7a26343db68645c6;hb=9d525e44bd9642a72eb7acd81bd9956b014e3872;hp=8d1b88bbf1f20f35e992c82cbf357ecb1385800b;hpb=d79262d3c0bc002beb7888568d74d26e27852699;p=ypp-sc-tools.web-live.git diff --git a/pctb/ocr.c b/pctb/ocr.c index 8d1b88b..92b0903 100644 --- a/pctb/ocr.c +++ b/pctb/ocr.c @@ -122,7 +122,7 @@ static void readdb1(OcrReader *rd, const char *which, int local) { int h, endsword; char lbuf[100]; - char *dbfname= masprintf("%s/#%s-char%d#.txt", + char *dbfname= masprintf("%s/_%s-char%d.txt", get_vardir(), which, rd->h); if (!dbfile_open(dbfname)) @@ -238,7 +238,7 @@ Rejection *rejections; static void load_rejections(const char *which) { char lbuf[1000]; - char *fname= masprintf("%s/#%s-reject#.txt", get_vardir(), which); + char *fname= masprintf("%s/_%s-reject.txt", get_vardir(), which); int c, lno=0; Rejection *rej; @@ -397,7 +397,7 @@ static DatabaseNode *findchar_1ctx(const FindCharArgs *fca, int x= fca->x; for (;;) { - debug_flush(); + if (DEBUGP(ocr)) debug_flush(); debugf(" | x=%d",x); if (x > fca->w) break; Pixcol cv= fca->cols[x]; @@ -531,7 +531,7 @@ OcrResultGlyph *ocr(OcrReader *rd, OcrCellType ct, int w, x=0; for (;;) { - debug_flush(); + if (DEBUGP(ocr)) debug_flush(); /* skip spaces */ if (x>=w) break; @@ -597,7 +597,6 @@ OcrReader *ocr_init(int h) { if (o_flags & ff_dict_fetch) { char *fetchfile= masprintf("char%d",h); - progress("Updating %s...",fetchfile); fetch_with_rsync(fetchfile); free(fetchfile); } @@ -649,7 +648,7 @@ void ocr_showcharsets(void) { memset(found,0,sizeof(found)); - fnpat= pcre_compile("\\#(?:master|local)\\-char([1-9]\\d{0,2})\\#\\.txt$", + fnpat= pcre_compile("_(?:master|local)\\-char([1-9]\\d{0,2})\\.txt$", PCRE_ANCHORED|PCRE_DOLLAR_ENDONLY, &pcre_err,&pcre_erroffset, 0); debugf("pcre_compile %p %s\n",fnpat,pcre_err);