From 3fad53f3bc8c29335f290c1fb5e2563b711becfc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 6 Jun 2009 00:13:15 +0100 Subject: [PATCH] seems to be able to do most scanning --- pctb/charset-15.txt | 9 +++++++++ pctb/ocr.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pctb/charset-15.txt b/pctb/charset-15.txt index 8c7b13a..0a82f9b 100644 --- a/pctb/charset-15.txt +++ b/pctb/charset-15.txt @@ -584,6 +584,15 @@ f80 10 8 +Upper +b +ff8 +440 +820 +820 +820 +7c0 + Upper c 7c0 diff --git a/pctb/ocr.c b/pctb/ocr.c index 04aecc0..48c25c0 100644 --- a/pctb/ocr.c +++ b/pctb/ocr.c @@ -24,6 +24,8 @@ static const char *context_names[]= { #define NCONTEXTS (sizeof(context_names)/sizeof(context_names[0])) +#define SPACE_SPACES 3 + struct OcrReader { int h; DatabaseNode contexts[NCONTEXTS]; @@ -305,13 +307,16 @@ OcrResultGlyph *ocr(OcrReader *rd, OcrCellType ct, int w, Pixcol cols[]) { if (!cols[x]) { nspaces++; x++; - if (nspaces==3) { + if (nspaces==SPACE_SPACES) { fprintf(debug,"OCR x=%x nspaces=%d space\n",x,nspaces); - add_result(rd," ",x-nspaces,x+1,0); ctxmap= ct->nextword; } continue; } + + /* something here, so we need to add the spaces */ + if (nspaces>=SPACE_SPACES) + add_result(rd," ",x-nspaces,x+1,0); nspaces=0; /* find character */ -- 2.30.2